diff --git a/.travis.yml b/.travis.yml index 59203ba..7eab2c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ gemfile: - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.0_mongo_mapper.gemfile - gemfiles/rails_4.2.gemfile + - gemfiles/rails_4.2_mongoid_4.gemfile - gemfiles/rails_4.2_mongoid_5.gemfile - gemfiles/rails_4.2_mongo_mapper.gemfile - gemfiles/rails_5.0.gemfile @@ -35,12 +36,20 @@ matrix: - rvm: rbx-2.5.8 gemfile: gemfiles/rails_5.0.gemfile exclude: + - rvm: 1.9.3 + gemfile: gemfiles/rails_4.2_mongoid_4.gemfile + - rvm: 1.9.3 + gemfile: gemfiles/rails_4.2_mongoid_5.gemfile - rvm: 1.9.3 gemfile: gemfiles/rails_5.0.gemfile - rvm: 2.2.5 gemfile: gemfiles/rails_3.2_stable.gemfile - rvm: 2.3.1 gemfile: gemfiles/rails_3.2_stable.gemfile + - rvm: jruby-1.7 + gemfile: gemfiles/rails_4.2_mongoid_4.gemfile + - rvm: jruby-1.7 + gemfile: gemfiles/rails_4.2_mongoid_5.gemfile - rvm: jruby-1.7 gemfile: gemfiles/rails_5.0.gemfile diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..2b32e3d --- /dev/null +++ b/Appraisals @@ -0,0 +1,117 @@ +appraise 'rails_3.2_stable' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'rails', :github => 'rails/rails', :branch => '3-2-stable' + gem 'mongoid', '~>3.1' + gem 'sequel' + gem 'mongo_mapper', '~>0.13' + gem 'bson_ext', :platforms => :ruby + gem 'test-unit', '~> 3.0' +end + +appraise 'rails_4.0' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.0.13' + gem 'mongoid', '~>4.0' + gem 'sequel' + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby + gem 'redis-objects' +end + +appraise 'rails_4.0_mongo_mapper' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.0.13' + gem 'sequel' + gem 'mongo_mapper', '~>0.13.1' + gem 'bson_ext', :platforms => :ruby + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby +end + +appraise 'rails_4.2' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.2.5' + gem 'sequel' + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby +end + +appraise 'rails_4.2_mongoid_4' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.2.5' + gem 'mongoid', '~>4.0', :platforms => [:ruby_22, :ruby_23, :jruby] + gem 'sequel' + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby +end + +appraise 'rails_4.2_mongoid_5' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.2.5' + gem 'mongoid', '~>5.0', :platforms => [:ruby_22, :ruby_23, :jruby] + gem 'sequel' + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby +end + +appraise 'rails_4.2_mongo_mapper' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'mime-types', '~> 2', :platforms => [:ruby_19, :jruby] + gem 'rails', '4.2.5' + gem 'sequel' + gem 'mongo_mapper' + gem 'bson_ext', :platforms => :ruby + gem 'dynamoid', '~> 1', :platforms => :ruby + gem 'aws-sdk', '~>2', :platforms => :ruby + gem 'redis-objects' +end + +appraise 'rails_5.0' do + gem 'sqlite3', :platforms => :ruby + gem 'rubysl', :platforms => :rbx + gem 'rubinius-developer_tools', :platforms => :rbx + gem 'jruby-openssl', :platforms => :jruby + gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby + gem 'rails', '5.0.0' + # mongoid is not yet Rails 5 compatible + # gem 'mongoid', '~>4.0', :platforms => [:ruby_22, :ruby_23, :jruby] + gem 'sequel' + + # dynamoid is not yet Rails 5 compatible + # gem 'dynamoid', '~> 1', :platforms => :ruby + + gem 'aws-sdk', '~>2', :platforms => :ruby +end diff --git a/Gemfile b/Gemfile index 46eb0b4..b4e2a20 100644 --- a/Gemfile +++ b/Gemfile @@ -1,24 +1,3 @@ source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby -gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') -gem "rails", ">= 4.2", "< 6" -gem 'mongoid', '~>4.0' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') -gem 'sequel' - -# testing dynamoid -# gem 'dynamoid', '~> 1' -# gem 'aws-sdk', '~>2' - -# Since mongoid V4 requires incompatible bson V2, cannot have mongoid (V4 or greater) -# and mongo_mapper ( or mongo ) in the same application -# gem 'mongo_mapper', '~> 0.13' -# gem 'bson_ext', :platforms => :ruby - -# uncomment if you want to run specs for Redis persistence -# gem "redis-objects" - gemspec diff --git a/Rakefile b/Rakefile index 83089eb..fb8a83c 100644 --- a/Rakefile +++ b/Rakefile @@ -23,4 +23,9 @@ Rake::RDocTask.new do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -task :default => :spec +if ENV["APPRAISAL_INITIALIZED"] || ENV["TRAVIS"] + task :default => :spec +else + require 'appraisal' + task :default => :appraisal +end diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..dfd7247 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,17 @@ +## Install dependency matrix + + appraisal install + +This will re-generate Gemfiles in `gemfile` folder + +Use rvm gemsets or similar to avoid global gem pollution + +## Run specs + +For all supported Rails/ORM combinations: + + appraisal rspec + +Or for s specific one: + + appraisal rails_4.2 rspec diff --git a/aasm.gemspec b/aasm.gemspec index 5e49fc6..e08307a 100644 --- a/aasm.gemspec +++ b/aasm.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'sdoc' s.add_development_dependency 'rspec', ">= 3" s.add_development_dependency 'generator_spec' + s.add_development_dependency 'appraisal' # debugging # s.add_development_dependency 'debugger' diff --git a/gemfiles/rails_3.2_stable.gemfile b/gemfiles/rails_3.2_stable.gemfile index 946afb6..c2afda1 100644 --- a/gemfiles/rails_3.2_stable.gemfile +++ b/gemfiles/rails_3.2_stable.gemfile @@ -1,15 +1,17 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "rails", :github => "rails/rails", :branch => "3-2-stable" -gem 'mongoid', '~>3.1' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') -gem 'sequel' -gem 'mongo_mapper', '~>0.13' -gem 'bson_ext', :platforms => :ruby -gem 'test-unit', '~> 3.0' +gem "rails", :github => "rails/rails", :branch => "3-2-stable" +gem "mongoid", "~>3.1" +gem "sequel" +gem "mongo_mapper", "~>0.13" +gem "bson_ext", :platforms => :ruby +gem "test-unit", "~> 3.0" gemspec :path => "../" diff --git a/gemfiles/rails_4.0.gemfile b/gemfiles/rails_4.0.gemfile index c5c87eb..6609c3a 100644 --- a/gemfiles/rails_4.0.gemfile +++ b/gemfiles/rails_4.0.gemfile @@ -1,16 +1,18 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] gem "rails", "4.0.13" -gem 'mongoid', '~>4.0' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') -gem 'sequel' -gem 'dynamoid', '~> 1', :platforms => :ruby -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "mongoid", "~>4.0" +gem "sequel" +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby gem "redis-objects" gemspec :path => "../" diff --git a/gemfiles/rails_4.0_mongo_mapper.gemfile b/gemfiles/rails_4.0_mongo_mapper.gemfile index 707fd6b..acb4167 100644 --- a/gemfiles/rails_4.0_mongo_mapper.gemfile +++ b/gemfiles/rails_4.0_mongo_mapper.gemfile @@ -1,16 +1,18 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] gem "rails", "4.0.13" -gem 'sequel' -gem 'mongo_mapper', '~>0.13' -gem 'bson_ext', :platforms => :ruby -gem 'dynamoid', '~> 1', :platforms => :ruby -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "sequel" +gem "mongo_mapper", "~>0.13.1" +gem "bson_ext", :platforms => :ruby +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby gemspec :path => "../" diff --git a/gemfiles/rails_4.2.gemfile b/gemfiles/rails_4.2.gemfile index bbdafa7..3d3fe07 100644 --- a/gemfiles/rails_4.2.gemfile +++ b/gemfiles/rails_4.2.gemfile @@ -1,15 +1,16 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] gem "rails", "4.2.5" -gem 'mongoid', '~>4.0' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') -gem 'sequel' -gem 'dynamoid', '~> 1', :platforms => :ruby -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "sequel" +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby gemspec :path => "../" diff --git a/gemfiles/rails_4.2_mongo_mapper.gemfile b/gemfiles/rails_4.2_mongo_mapper.gemfile index c113b26..abb909d 100644 --- a/gemfiles/rails_4.2_mongo_mapper.gemfile +++ b/gemfiles/rails_4.2_mongo_mapper.gemfile @@ -1,17 +1,19 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] gem "rails", "4.2.5" -gem 'sequel' -gem 'mongo_mapper' -gem 'bson_ext', :platforms => :ruby -gem 'dynamoid', '~> 1', :platforms => :ruby -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "sequel" +gem "mongo_mapper" +gem "bson_ext", :platforms => :ruby +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby gem "redis-objects" gemspec :path => "../" diff --git a/gemfiles/rails_4.2_mongoid_4.gemfile b/gemfiles/rails_4.2_mongoid_4.gemfile new file mode 100644 index 0000000..38daf98 --- /dev/null +++ b/gemfiles/rails_4.2_mongoid_4.gemfile @@ -0,0 +1,17 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby +gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] +gem "rails", "4.2.5" +gem "mongoid", "~>4.0", :platforms => [:ruby_22, :ruby_23, :jruby] +gem "sequel" +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby + +gemspec :path => "../" diff --git a/gemfiles/rails_4.2_mongoid_5.gemfile b/gemfiles/rails_4.2_mongoid_5.gemfile index e17f547..eaadcce 100644 --- a/gemfiles/rails_4.2_mongoid_5.gemfile +++ b/gemfiles/rails_4.2_mongoid_5.gemfile @@ -1,15 +1,17 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby -gem "mime-types", "~> 2" if Gem::Version.create(RUBY_VERSION.dup) <= Gem::Version.create('1.9.3') +gem "mime-types", "~> 2", :platforms => [:ruby_19, :jruby] gem "rails", "4.2.5" -gem 'mongoid', '~>5.0' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') -gem 'sequel' -gem 'dynamoid', '~> 1', :platforms => :ruby -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "mongoid", "~>5.0", :platforms => [:ruby_22, :ruby_23, :jruby] +gem "sequel" +gem "dynamoid", "~> 1", :platforms => :ruby +gem "aws-sdk", "~>2", :platforms => :ruby gemspec :path => "../" diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_5.0.gemfile index d2d20ee..9d1b434 100644 --- a/gemfiles/rails_5.0.gemfile +++ b/gemfiles/rails_5.0.gemfile @@ -1,21 +1,14 @@ +# This file was generated by Appraisal + source "https://rubygems.org" -gem "sqlite3", :platforms => :ruby -gem 'rubysl', :platforms => :rbx -gem 'rubinius-developer_tools', :platforms => :rbx -gem "jruby-openssl", :platforms => :jruby +gem "sqlite3", :platforms => :ruby +gem "rubysl", :platforms => :rbx +gem "rubinius-developer_tools", :platforms => :rbx +gem "jruby-openssl", :platforms => :jruby gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby - gem "rails", "5.0.0" - -# mongoid is not yet Rails 5 compatible -# gem 'mongoid', '~>4.0' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3') - -gem 'sequel' - -# dynamoid is not yet Rails 5 compatible -# gem 'dynamoid', '~> 1', :platforms => :ruby - -gem 'aws-sdk', '~>2', :platforms => :ruby +gem "sequel" +gem "aws-sdk", "~>2", :platforms => :ruby gemspec :path => "../"