Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis-CI support #99

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rvm:
- 1.9.3
- 1.9.2
- 1.8.7
env:
- RAILS_VERSION=3.0.10
- RAILS_VERSION=3.1.0
branches:
only: master
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
source "http://rubygems.org"
gemspec

gem 'activerecord', ENV['RAILS_VERSION'] || "3.1.0"
38 changes: 21 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ PATH
GEM
remote: http://rubygems.org/
specs:
activemodel (3.0.9)
activesupport (= 3.0.9)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activesupport (3.1.0)
multi_json (~> 1.0)
arel (2.2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
diff-lcs (1.1.2)
i18n (0.5.0)
mysql (2.8.1)
i18n (0.6.0)
multi_json (1.0.3)
rake (0.9.2)
rcov (0.9.9)
rdoc (3.6.1)
Expand All @@ -32,16 +35,17 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
tzinfo (0.3.28)
sqlite3 (1.3.4)
tzinfo (0.3.29)

PLATFORMS
ruby

DEPENDENCIES
activerecord
activerecord (= 3.1.0)
machinist!
mysql
rake
rcov
rdoc
rspec
sqlite3
3 changes: 3 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

*Fixtures aren't fun. Machinist is.*

[![Build Status](https://secure.travis-ci.org/hosh/machinist.png)](http://travis-ci.org/hosh/machinist)


Machinist 2 is **still in beta**!

If you're using Rails 3, you'll want to give Machinist 2 a go, but be aware
Expand Down
14 changes: 14 additions & 0 deletions lib/machinist/active_resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'active_resource'
require 'machinist'
require 'machinist/active_resource/blueprint'
require 'machinist/active_record/lathe'

module ActiveResource #:nodoc:
class Base #:nodoc:
extend Machinist::Machinable

def self.blueprint_class
Machinist::ActiveResource::Blueprint
end
end
end
16 changes: 16 additions & 0 deletions lib/machinist/active_resource/blueprint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Machinist::ActiveResource
class Blueprint < Machinist::Blueprint

# Make and save an object.
def make!(attributes = {})
object = make(attributes)
object.save!
object.reload
end

def lathe_class #:nodoc:
Machinist::ActiveRecord::Lathe
end

end
end
2 changes: 1 addition & 1 deletion machinist.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_development_dependency "activerecord"
s.add_development_dependency "mysql"
s.add_development_dependency "sqlite3"
s.add_development_dependency "rake"
s.add_development_dependency "rcov"
s.add_development_dependency "rspec"
Expand Down
7 changes: 3 additions & 4 deletions spec/support/active_record_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
require 'machinist/active_record'

ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:database => "machinist",
:username => "root",
:password => ""
:adapter => "sqlite3",
:database => ":memory:",
:timeout => 500
)

ActiveRecord::Schema.define(:version => 0) do
Expand Down