From 17e10961557f62c2ce21b89b9e51a0bb8632edc7 Mon Sep 17 00:00:00 2001 From: Ryan Fitzgerald Date: Sat, 22 Nov 2014 23:09:58 -0800 Subject: [PATCH] Update Appraisals, remove Ruby 1.8 and 1.9.2 support --- .travis.yml | 9 +-------- Appraisals | 19 ++++++++++++++++--- Appraisals-1.8 | 14 -------------- Rakefile | 8 -------- Readme.md | 12 ++++++------ gemfiles/rails30.gemfile | 2 +- gemfiles/rails31.gemfile | 2 +- gemfiles/rails32.gemfile | 4 ++-- gemfiles/rails40.gemfile | 9 +++++++++ gemfiles/{rails4.gemfile => rails41.gemfile} | 5 +++-- gemfiles/rails42.gemfile | 9 +++++++++ spec/config/environment.rb | 2 +- spec/config/routes.rb | 1 + spec/show_middleware_spec.rb | 2 +- spec/show_model_spec.rb | 3 ++- spec/show_models_spec.rb | 5 +++-- 16 files changed, 56 insertions(+), 50 deletions(-) delete mode 100644 Appraisals-1.8 create mode 100644 gemfiles/rails40.gemfile rename gemfiles/{rails4.gemfile => rails41.gemfile} (59%) create mode 100644 gemfiles/rails42.gemfile diff --git a/.travis.yml b/.travis.yml index 4ad5b9f..d75e6db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,10 @@ services: mongodb rvm: - - 1.9.2 - 1.9.3 - 2.0.0 - - 2.1.2 + - 2.1.5 gemfile: - gemfiles/rails30.gemfile - gemfiles/rails31.gemfile - gemfiles/rails32.gemfile - gemfiles/rails4.gemfile -matrix: - exclude: - - rvm: 1.9.2 - gemfile: gemfiles/rails32.gemfile - - rvm: 1.9.2 - gemfile: gemfiles/rails4.gemfile diff --git a/Appraisals b/Appraisals index 5c5b8b7..037d1f4 100644 --- a/Appraisals +++ b/Appraisals @@ -10,12 +10,25 @@ appraise "rails31" do end appraise "rails32" do - gem "rails", "3.2.14" + gem "rails", "3.2.21" gem "mongoid" gem "sqlite3" end -appraise "rails4" do - gem "rails", "4.0.0" +appraise "rails40" do + gem "rails", "4.0.12" + gem "mongoid" + gem "sqlite3" +end + +appraise "rails41" do + gem "rails", "4.1.8" + gem "mongoid" + gem "sqlite3" +end + +appraise "rails42" do + gem "rails", "4.2.0beta4" + gem "mongoid" gem "sqlite3" end diff --git a/Appraisals-1.8 b/Appraisals-1.8 deleted file mode 100644 index b37ad3b..0000000 --- a/Appraisals-1.8 +++ /dev/null @@ -1,14 +0,0 @@ -appraise "rails30" do - gem "rails", "3.0.15" - gem "sqlite3" -end - -appraise "rails31" do - gem "rails", "3.1.6" - gem "sqlite3" -end - -appraise "rails32" do - gem "rails", "3.2.6" - gem "sqlite3" -end diff --git a/Rakefile b/Rakefile index 9ae3c57..019958d 100644 --- a/Rakefile +++ b/Rakefile @@ -4,14 +4,6 @@ require "bundler/gem_tasks" require "rake/testtask" require "appraisal" -if RUBY_VERSION =~ /^1.8/ - class Appraisal::File - def path - 'Appraisals-1.8' - end - end -end - Rake::TestTask.new do |t| t.libs.concat %w(pry-rails spec) t.pattern = "spec/*_spec.rb" diff --git a/Readme.md b/Readme.md index 6d49cda..a306d07 100644 --- a/Readme.md +++ b/Readme.md @@ -77,15 +77,15 @@ irb(main):001:0> # Developing and Testing -To generate Gemfiles for Rails 3.0, 3.1, 3.2, and 4.0, run -`rake appraisal:gemfiles appraisal:install`. +To generate Gemfiles for Rails 3.0, 3.1, 3.2, 4.0, 4.1, and 4.2, run `rake +appraisal:gemfiles appraisal:install`. -You can then run the tests across all four versions with `rake appraisal`. -You can also manually run the Rails console and server with `rake -appraisal console` and `rake appraisal server`. +You can then run the tests across all four versions with `rake appraisal`. You +can also manually run the Rails console and server with `rake appraisal +console` and `rake appraisal server`. For a specific version of Rails, use `rake appraisal:rails30`, `rake -appraisal:rails31`, `rake appraisal:rails32`, or `rake appraisal:rails4`. +appraisal:rails31`, `rake appraisal:rails32`, etc. # Alternative diff --git a/gemfiles/rails30.gemfile b/gemfiles/rails30.gemfile index d722afe..2c8f4b3 100644 --- a/gemfiles/rails30.gemfile +++ b/gemfiles/rails30.gemfile @@ -5,4 +5,4 @@ source "http://rubygems.org" gem "rails", "3.0.20" gem "sqlite3" -gemspec :path=>"../" \ No newline at end of file +gemspec :path => "../" diff --git a/gemfiles/rails31.gemfile b/gemfiles/rails31.gemfile index d0eef6c..970782f 100644 --- a/gemfiles/rails31.gemfile +++ b/gemfiles/rails31.gemfile @@ -6,4 +6,4 @@ gem "rails", "3.1.12" gem "mongoid" gem "sqlite3" -gemspec :path=>"../" \ No newline at end of file +gemspec :path => "../" diff --git a/gemfiles/rails32.gemfile b/gemfiles/rails32.gemfile index 7b9b350..4f009db 100644 --- a/gemfiles/rails32.gemfile +++ b/gemfiles/rails32.gemfile @@ -2,8 +2,8 @@ source "http://rubygems.org" -gem "rails", "3.2.14" +gem "rails", "3.2.21" gem "mongoid" gem "sqlite3" -gemspec :path=>"../" \ No newline at end of file +gemspec :path => "../" diff --git a/gemfiles/rails40.gemfile b/gemfiles/rails40.gemfile new file mode 100644 index 0000000..ea748cf --- /dev/null +++ b/gemfiles/rails40.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "rails", "4.0.12" +gem "mongoid" +gem "sqlite3" + +gemspec :path => "../" diff --git a/gemfiles/rails4.gemfile b/gemfiles/rails41.gemfile similarity index 59% rename from gemfiles/rails4.gemfile rename to gemfiles/rails41.gemfile index bc703a4..80fd440 100644 --- a/gemfiles/rails4.gemfile +++ b/gemfiles/rails41.gemfile @@ -2,7 +2,8 @@ source "http://rubygems.org" -gem "rails", "4.0.0" +gem "rails", "4.1.8" +gem "mongoid" gem "sqlite3" -gemspec :path=>"../" \ No newline at end of file +gemspec :path => "../" diff --git a/gemfiles/rails42.gemfile b/gemfiles/rails42.gemfile new file mode 100644 index 0000000..281c058 --- /dev/null +++ b/gemfiles/rails42.gemfile @@ -0,0 +1,9 @@ +# This file was generated by Appraisal + +source "http://rubygems.org" + +gem "rails", "4.2.0beta4" +gem "mongoid" +gem "sqlite3" + +gemspec :path => "../" diff --git a/spec/config/environment.rb b/spec/config/environment.rb index eb48b2e..5871d9d 100644 --- a/spec/config/environment.rb +++ b/spec/config/environment.rb @@ -75,5 +75,5 @@ begin field :name, :type => String embedded_in :artist end -rescue LoadError # Mongoid doesn't support Rails 3.0 or 4.0 or Ruby 1.8 +rescue LoadError # Mongoid doesn't support Rails 3.0 end diff --git a/spec/config/routes.rb b/spec/config/routes.rb index de0eb32..4f22059 100644 --- a/spec/config/routes.rb +++ b/spec/config/routes.rb @@ -1,4 +1,5 @@ TestApp.routes.draw do resource :pokemon, :beer + get 'exit' => proc { exit! } get 'pry' => proc { binding.pry; [200, {}, ['']] } end diff --git a/spec/show_middleware_spec.rb b/spec/show_middleware_spec.rb index a0ab2b2..d9206ea 100644 --- a/spec/show_middleware_spec.rb +++ b/spec/show_middleware_spec.rb @@ -6,7 +6,7 @@ describe "show-middleware" do it "should print a list of middleware" do output = mock_pry('show-middleware', 'exit-all') - output.must_match %r{\Ause ActionDispatch::Static} + output.must_match %r{^use ActionDispatch::Static$} output.must_match %r{^use ActionDispatch::ShowExceptions$} output.must_match %r{^run TestApp.routes\Z} end diff --git a/spec/show_model_spec.rb b/spec/show_model_spec.rb index 4cd6826..a5d1de4 100644 --- a/spec/show_model_spec.rb +++ b/spec/show_model_spec.rb @@ -29,13 +29,14 @@ MODEL expected = <