diff --git a/.travis.yml b/.travis.yml index 8b2762c..9d19fe2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,20 @@ language: ruby -# https://github.com/travis-ci/travis-ci/issues/5239 -before_install: - - gem install bundler +before_install: gem install bundler && bundle update --bundler rvm: - - 1.9.2-p330 - - 1.9.3 - - 2.0.0 - - 2.1.0 - - 2.2.0 - - 2.2.2 - - ruby-head + - 2.3.3 + - 2.4.7 + - 2.5.6 gemfile: - - gemfiles/rails3.2.gemfile - - gemfiles/rails4.0.gemfile - - gemfiles/rails4.1.gemfile - - gemfiles/rails4.2.gemfile - gemfiles/rails5.0.gemfile + - gemfiles/rails5.2.gemfile + - gemfiles/rails6.0.gemfile matrix: exclude: - - rvm: 1.9.2-p330 - gemfile: gemfiles/rails4.0.gemfile - - rvm: 1.9.2-p330 - gemfile: gemfiles/rails4.1.gemfile - - rvm: 1.9.2-p330 - gemfile: gemfiles/rails4.2.gemfile - - rvm: 1.9.2-p330 - gemfile: gemfiles/rails5.0.gemfile - - rvm: 1.9.3 - gemfile: gemfiles/rails5.0.gemfile - - rvm: 2.0.0 - gemfile: gemfiles/rails5.0.gemfile - - rvm: 2.1.0 - gemfile: gemfiles/rails5.0.gemfile - - rvm: 2.2.0 - gemfile: gemfiles/rails5.0.gemfile - - allow_failures: - - rvm: ruby-head + - rvm: 2.3.3 + gemfile: gemfiles/rails6.0.gemfile + - rvm: 2.4.7 + gemfile: gemfiles/rails6.0.gemfile \ No newline at end of file diff --git a/Appraisals b/Appraisals index be02105..db8d6b1 100644 --- a/Appraisals +++ b/Appraisals @@ -1,35 +1,17 @@ -appraise "rails3.2" do - gem('actionpack', '~> 3.2.0') - gem('activesupport', '~> 3.2.0') - gem('railties', '~> 3.2.0') - # Rails 3.2 has test-unit as a dependency, but Ruby 2.2 removes - # it, so we need to now manually require it as a dependency - gem('test-unit', '~>3.0') -end - -appraise "rails4.0" do - gem('actionpack', '~> 4.0.0') - gem('activesupport', '~> 4.0.0') - gem('railties', '~> 4.0.0') - # Rails 4.0 has test-unit as a dependency, but Ruby 2.2 removes - # it, so we need to now manually require it as a dependency - gem('test-unit', '~>3.0') -end - -appraise "rails4.1" do - gem('actionpack', '~> 4.1.0') - gem('activesupport', '~> 4.1.0') - gem('railties', '~> 4.1.0') -end - -appraise "rails4.2" do - gem('actionpack', '~> 4.2.0') - gem('activesupport', '~> 4.2.0') - gem('railties', '~> 4.2.0') -end - appraise "rails5.0" do gem('actionpack', '~> 5.0.0') gem('activesupport', '~> 5.0.0') gem('railties', '~> 5.0.0') end + +appraise "rails5.2" do + gem('actionpack', '~> 5.2.0') + gem('activesupport', '~> 5.2.0') + gem('railties', '~> 5.2.0') +end + +appraise "rails6.0" do + gem('actionpack', '~> 5.2.0') + gem('activesupport', '~> 5.2.0') + gem('railties', '~> 5.2.0') +end diff --git a/Gemfile.lock b/Gemfile.lock index b54b1eb..b7ef549 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,73 +2,74 @@ PATH remote: . specs: versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) + actionpack (>= 5.0) + activesupport (>= 5.0) + railties (>= 5.0) tzinfo GEM remote: https://rubygems.org/ specs: - actionpack (5.1.4) - actionview (= 5.1.4) - activesupport (= 5.1.4) - rack (~> 2.0) + actionpack (5.2.4.1) + actionview (= 5.2.4.1) + activesupport (= 5.2.4.1) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.4) - activesupport (= 5.1.4) + actionview (5.2.4.1) + activesupport (= 5.2.4.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activesupport (5.1.4) + activesupport (5.2.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) appraisal (2.2.0) bundler rake thor (>= 0.14.0) - builder (3.2.3) - concurrent-ruby (1.0.5) + builder (3.2.4) + concurrent-ruby (1.1.6) coveralls (0.8.21) json (>= 1.8, < 3) simplecov (~> 0.14.1) term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crass (1.0.5) + crass (1.0.6) diff-lcs (1.3) docile (1.1.5) - erubi (1.7.0) - i18n (0.8.6) + erubi (1.9.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) json (2.1.0) - loofah (2.3.1) + loofah (2.4.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - method_source (0.9.0) - mini_portile2 (2.1.0) - minitest (5.10.3) - nokogiri (1.6.8.1) - mini_portile2 (~> 2.1.0) - rack (2.0.3) - rack-test (0.7.0) + method_source (0.9.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + rack (2.2.2) + rack-test (1.1.0) rack (>= 1.0, < 3) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.1.4) - actionpack (= 5.1.4) - activesupport (= 5.1.4) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.1) + actionpack (= 5.2.4.1) + activesupport (= 5.2.4.1) method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (12.1.0) + thor (>= 0.19.0, < 2.0) + rake (13.0.1) rspec (3.6.0) rspec-core (~> 3.6.0) rspec-expectations (~> 3.6.0) @@ -100,7 +101,7 @@ GEM thor (0.19.4) thread_safe (0.3.6) tins (1.15.0) - tzinfo (1.2.3) + tzinfo (1.2.6) thread_safe (~> 0.1) PLATFORMS @@ -115,4 +116,4 @@ DEPENDENCIES versioncake! BUNDLED WITH - 1.16.3 + 1.17.2 diff --git a/gemfiles/rails3.2.gemfile b/gemfiles/rails3.2.gemfile deleted file mode 100644 index 69d75f5..0000000 --- a/gemfiles/rails3.2.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "actionpack", "~> 3.2.0" -gem "activesupport", "~> 3.2.0" -gem "railties", "~> 3.2.0" -gem "test-unit", "~>3.0" - -gemspec path: "../" diff --git a/gemfiles/rails3.2.gemfile.lock b/gemfiles/rails3.2.gemfile.lock deleted file mode 100644 index 7e0931e..0000000 --- a/gemfiles/rails3.2.gemfile.lock +++ /dev/null @@ -1,121 +0,0 @@ -PATH - remote: .. - specs: - versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) - tzinfo - -GEM - remote: https://rubygems.org/ - specs: - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) - appraisal (0.5.2) - bundler - rake - builder (3.0.4) - colorize (0.5.8) - coveralls (0.6.7) - colorize - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - thor - diff-lcs (1.2.5) - erubis (2.7.0) - hike (1.2.2) - i18n (0.6.1) - journey (1.0.4) - json (1.8.3) - mime-types (1.23) - multi_json (1.7.3) - power_assert (0.2.4) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack - rack-test (0.6.2) - rack (>= 1.0) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.0.4) - rdoc (3.12.2) - json (~> 1.4) - rest-client (1.6.7) - mime-types (>= 1.16) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-rails (3.1.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-support (~> 3.1.0) - rspec-support (3.1.2) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - sprockets (2.2.2) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - test-unit (3.1.4) - power_assert - thor (0.18.1) - thread_safe (0.3.6) - tilt (1.4.1) - tzinfo (1.2.3) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack (~> 3.2.0) - activesupport (~> 3.2.0) - appraisal - coveralls - railties (~> 3.2.0) - rake - rspec - rspec-rails - test-unit (~> 3.0) - versioncake! - -BUNDLED WITH - 1.14.6 diff --git a/gemfiles/rails4.0.gemfile b/gemfiles/rails4.0.gemfile deleted file mode 100644 index 986743d..0000000 --- a/gemfiles/rails4.0.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "actionpack", "~> 4.0.0" -gem "activesupport", "~> 4.0.0" -gem "railties", "~> 4.0.0" -gem "test-unit", "~>3.0" - -gemspec path: "../" diff --git a/gemfiles/rails4.0.gemfile.lock b/gemfiles/rails4.0.gemfile.lock deleted file mode 100644 index b09e569..0000000 --- a/gemfiles/rails4.0.gemfile.lock +++ /dev/null @@ -1,102 +0,0 @@ -PATH - remote: .. - specs: - versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) - tzinfo - -GEM - remote: https://rubygems.org/ - specs: - actionpack (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activesupport (4.0.0) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - appraisal (0.5.2) - bundler - rake - atomic (1.1.10) - builder (3.1.4) - colorize (0.5.8) - coveralls (0.6.7) - colorize - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - thor - diff-lcs (1.2.5) - erubis (2.7.0) - i18n (0.6.4) - mime-types (1.23) - minitest (4.7.5) - multi_json (1.7.7) - power_assert (0.2.4) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - railties (4.0.0) - actionpack (= 4.0.0) - activesupport (= 4.0.0) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.1.0) - rest-client (1.6.7) - mime-types (>= 1.16) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-rails (3.1.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-support (~> 3.1.0) - rspec-support (3.1.2) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - test-unit (3.1.4) - power_assert - thor (0.18.1) - thread_safe (0.1.0) - atomic - tzinfo (0.3.37) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack (~> 4.0.0) - activesupport (~> 4.0.0) - appraisal - coveralls - railties (~> 4.0.0) - rake - rspec - rspec-rails - test-unit (~> 3.0) - versioncake! - -BUNDLED WITH - 1.14.6 diff --git a/gemfiles/rails4.1.gemfile.lock b/gemfiles/rails4.1.gemfile.lock deleted file mode 100644 index b966bed..0000000 --- a/gemfiles/rails4.1.gemfile.lock +++ /dev/null @@ -1,106 +0,0 @@ -PATH - remote: .. - specs: - versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) - tzinfo - -GEM - remote: https://rubygems.org/ - specs: - actionpack (4.1.0) - actionview (= 4.1.0) - activesupport (= 4.1.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - actionview (4.1.0) - activesupport (= 4.1.0) - builder (~> 3.1) - erubis (~> 2.7.0) - activesupport (4.1.0) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - appraisal (1.0.0) - bundler - rake - thor (>= 0.14.0) - builder (3.2.2) - coveralls (0.7.0) - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - term-ansicolor - thor - diff-lcs (1.2.5) - docile (1.1.3) - erubis (2.7.0) - i18n (0.6.9) - json (1.8.3) - mime-types (2.2) - minitest (5.3.3) - multi_json (1.9.2) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - railties (4.1.0) - actionpack (= 4.1.0) - activesupport (= 4.1.0) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.2.2) - rest-client (1.6.7) - mime-types (>= 1.16) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-rails (3.1.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-support (~> 3.1.0) - rspec-support (3.1.2) - simplecov (0.8.2) - docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) - term-ansicolor (1.3.0) - tins (~> 1.0) - thor (0.19.1) - thread_safe (0.3.3) - tins (1.1.0) - tzinfo (1.1.0) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack (~> 4.1.0) - activesupport (~> 4.1.0) - appraisal - coveralls - railties (~> 4.1.0) - rake - rspec - rspec-rails - versioncake! - -BUNDLED WITH - 1.14.6 diff --git a/gemfiles/rails4.2.gemfile.lock b/gemfiles/rails4.2.gemfile.lock deleted file mode 100644 index 732ff6e..0000000 --- a/gemfiles/rails4.2.gemfile.lock +++ /dev/null @@ -1,133 +0,0 @@ -PATH - remote: .. - specs: - versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) - tzinfo - -GEM - remote: https://rubygems.org/ - specs: - actionpack (4.2.3) - actionview (= 4.2.3) - activesupport (= 4.2.3) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.3) - activesupport (= 4.2.3) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activesupport (4.2.3) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - appraisal (2.0.2) - bundler - rake - thor (>= 0.14.0) - builder (3.2.2) - coveralls (0.8.2) - json (~> 1.8) - rest-client (>= 1.6.8, < 2) - simplecov (~> 0.10.0) - term-ansicolor (~> 1.3) - thor (~> 0.19.1) - diff-lcs (1.2.5) - docile (1.1.5) - domain_name (0.5.24) - unf (>= 0.0.5, < 1.0.0) - erubis (2.7.0) - http-cookie (1.0.2) - domain_name (~> 0.5) - i18n (0.7.0) - json (1.8.3) - loofah (2.0.2) - nokogiri (>= 1.5.9) - mime-types (2.6.1) - mini_portile (0.6.2) - minitest (5.7.0) - netrc (0.10.3) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) - rack (1.6.4) - rack-test (0.6.3) - rack (>= 1.0) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.6) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.2) - loofah (~> 2.0) - railties (4.2.3) - actionpack (= 4.2.3) - activesupport (= 4.2.3) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.4.2) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rspec (3.3.0) - rspec-core (~> 3.3.0) - rspec-expectations (~> 3.3.0) - rspec-mocks (~> 3.3.0) - rspec-core (3.3.2) - rspec-support (~> 3.3.0) - rspec-expectations (3.3.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.3.0) - rspec-mocks (3.3.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.3.0) - rspec-rails (3.3.3) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.3.0) - rspec-expectations (~> 3.3.0) - rspec-mocks (~> 3.3.0) - rspec-support (~> 3.3.0) - rspec-support (3.3.0) - simplecov (0.10.0) - docile (~> 1.1.0) - json (~> 1.8) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) - term-ansicolor (1.3.2) - tins (~> 1.0) - thor (0.19.1) - thread_safe (0.3.5) - tins (1.5.4) - tzinfo (1.2.2) - thread_safe (~> 0.1) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack (~> 4.2.0) - activesupport (~> 4.2.0) - appraisal - coveralls - railties (~> 4.2.0) - rake - rspec - rspec-rails - versioncake! - -BUNDLED WITH - 1.14.6 diff --git a/gemfiles/rails5.0.gemfile.lock b/gemfiles/rails5.0.gemfile.lock index 289cf56..e65e1aa 100644 --- a/gemfiles/rails5.0.gemfile.lock +++ b/gemfiles/rails5.0.gemfile.lock @@ -2,9 +2,9 @@ PATH remote: .. specs: versioncake (3.4.0) - actionpack (>= 3.2) - activesupport (>= 3.2) - railties (>= 3.2) + actionpack (>= 5.0) + activesupport (>= 5.0) + railties (>= 5.0) tzinfo GEM @@ -118,4 +118,4 @@ DEPENDENCIES versioncake! BUNDLED WITH - 1.14.6 + 1.17.2 diff --git a/gemfiles/rails4.1.gemfile b/gemfiles/rails5.2.gemfile similarity index 51% rename from gemfiles/rails4.1.gemfile rename to gemfiles/rails5.2.gemfile index ccf0f2b..73ca74f 100644 --- a/gemfiles/rails4.1.gemfile +++ b/gemfiles/rails5.2.gemfile @@ -2,8 +2,8 @@ source "https://rubygems.org" -gem "actionpack", "~> 4.1.0" -gem "activesupport", "~> 4.1.0" -gem "railties", "~> 4.1.0" +gem "actionpack", "~> 5.2.0" +gem "activesupport", "~> 5.2.0" +gem "railties", "~> 5.2.0" gemspec path: "../" diff --git a/gemfiles/rails5.2.gemfile.lock b/gemfiles/rails5.2.gemfile.lock new file mode 100644 index 0000000..4ec1b8c --- /dev/null +++ b/gemfiles/rails5.2.gemfile.lock @@ -0,0 +1,122 @@ +PATH + remote: .. + specs: + versioncake (3.4.0) + actionpack (>= 5.0) + activesupport (>= 5.0) + railties (>= 5.0) + tzinfo + +GEM + remote: https://rubygems.org/ + specs: + actionpack (5.2.3) + actionview (= 5.2.3) + activesupport (= 5.2.3) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.3) + activesupport (= 5.2.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activesupport (5.2.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + builder (3.2.4) + concurrent-ruby (1.1.6) + coveralls (0.8.21) + json (>= 1.8, < 3) + simplecov (~> 0.14.1) + term-ansicolor (~> 1.3) + thor (~> 0.19.4) + tins (~> 1.6) + crass (1.0.6) + diff-lcs (1.3) + docile (1.1.5) + erubi (1.9.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + json (2.2.0) + loofah (2.4.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + method_source (0.9.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.3) + actionpack (= 5.2.3) + activesupport (= 5.2.3) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (13.0.1) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-rails (3.7.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + simplecov (0.14.1) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + term-ansicolor (1.6.0) + tins (~> 1.0) + thor (0.19.4) + thread_safe (0.3.6) + tins (1.15.0) + tzinfo (1.2.6) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + actionpack (~> 5.2.0) + activesupport (~> 5.2.0) + appraisal + coveralls + railties (~> 5.2.0) + rake + rspec + rspec-rails + versioncake! + +BUNDLED WITH + 1.17.2 diff --git a/gemfiles/rails4.2.gemfile b/gemfiles/rails6.0.gemfile similarity index 51% rename from gemfiles/rails4.2.gemfile rename to gemfiles/rails6.0.gemfile index 5451756..73ca74f 100644 --- a/gemfiles/rails4.2.gemfile +++ b/gemfiles/rails6.0.gemfile @@ -2,8 +2,8 @@ source "https://rubygems.org" -gem "actionpack", "~> 4.2.0" -gem "activesupport", "~> 4.2.0" -gem "railties", "~> 4.2.0" +gem "actionpack", "~> 5.2.0" +gem "activesupport", "~> 5.2.0" +gem "railties", "~> 5.2.0" gemspec path: "../" diff --git a/gemfiles/rails6.0.gemfile.lock b/gemfiles/rails6.0.gemfile.lock new file mode 100644 index 0000000..ce7a199 --- /dev/null +++ b/gemfiles/rails6.0.gemfile.lock @@ -0,0 +1,122 @@ +PATH + remote: .. + specs: + versioncake (3.4.0) + actionpack (>= 5.0) + activesupport (>= 5.0) + railties (>= 5.0) + tzinfo + +GEM + remote: https://rubygems.org/ + specs: + actionpack (5.2.4.1) + actionview (= 5.2.4.1) + activesupport (= 5.2.4.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.1) + activesupport (= 5.2.4.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activesupport (5.2.4.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + builder (3.2.4) + concurrent-ruby (1.1.6) + coveralls (0.8.21) + json (>= 1.8, < 3) + simplecov (~> 0.14.1) + term-ansicolor (~> 1.3) + thor (~> 0.19.4) + tins (~> 1.6) + crass (1.0.6) + diff-lcs (1.3) + docile (1.1.5) + erubi (1.9.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + json (2.2.0) + loofah (2.4.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + method_source (0.9.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + rack (2.2.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.1) + actionpack (= 5.2.4.1) + activesupport (= 5.2.4.1) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (13.0.1) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-rails (3.7.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + simplecov (0.14.1) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + term-ansicolor (1.6.0) + tins (~> 1.0) + thor (0.19.4) + thread_safe (0.3.6) + tins (1.15.0) + tzinfo (1.2.6) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + actionpack (~> 5.2.0) + activesupport (~> 5.2.0) + appraisal + coveralls + railties (~> 5.2.0) + rake + rspec + rspec-rails + versioncake! + +BUNDLED WITH + 1.17.2 diff --git a/lib/versioncake/strategies/path_parameter_strategy.rb b/lib/versioncake/strategies/path_parameter_strategy.rb index 348c1a8..cb6c19e 100644 --- a/lib/versioncake/strategies/path_parameter_strategy.rb +++ b/lib/versioncake/strategies/path_parameter_strategy.rb @@ -4,7 +4,7 @@ class PathParameterStrategy < ExtractionStrategy def execute(request) version = nil request.path.split('/').find do |part| - next unless match = part.match(%r{v(?\d+)}) + next unless match = part.match(%r{\Av(?\d+)\z}) version = match[:version] break end diff --git a/lib/versioncake/view_additions.rb b/lib/versioncake/view_additions.rb index 71a9a78..29b2baa 100644 --- a/lib/versioncake/view_additions.rb +++ b/lib/versioncake/view_additions.rb @@ -6,8 +6,18 @@ ActionView::LookupContext.register_detail(:versions){ [] } ActionView::PathResolver.class_eval do - # not sure why we are doing this yet, but looks like a good idea - if ActionPack::VERSION::MAJOR >= 4 && ActionPack::VERSION::MINOR >= 1 || ActionPack::VERSION::MAJOR >= 5 + if ActionPack::VERSION::MAJOR >= 6 + ActionView::PathResolver::EXTENSIONS.replace({ + locale: ".", + formats: ".", + versions: ".", + variants: "+", + handlers: "." + }) + Kernel::silence_warnings { + ActionView::PathResolver::DEFAULT_PATTERN = ":prefix/:action{.:locale,}{.:formats,}{.:versions,}{+:variants,}{.:handlers,}" + } + elsif ActionPack::VERSION::MAJOR >= 4 && ActionPack::VERSION::MINOR >= 1 || ActionPack::VERSION::MAJOR >= 5 ActionView::PathResolver::EXTENSIONS.replace({ locale: ".", formats: ".", @@ -20,13 +30,6 @@ def initialize(pattern = nil) @pattern = pattern || ":prefix/:action{.:locale,}{.:formats,}{+:variants,}{.:versions,}{.:handlers,}" super() end - else - ActionView::PathResolver::EXTENSIONS.replace [:locale, :formats, :versions, :handlers] - - # The query builder has the @details from the lookup_context and will - # match the detail name to the string in the pattern, so we must append - # it to the default pattern - ActionView::PathResolver::DEFAULT_PATTERN.replace ":prefix/:action{.:locale,}{.:formats,}{.:versions,}{.:handlers,}" end # The default extract handler expects that the handler is the last extension and diff --git a/spec/integration/rack/middleware_regression_spec.rb b/spec/integration/rack/middleware_regression_spec.rb index dc90790..93759fe 100644 --- a/spec/integration/rack/middleware_regression_spec.rb +++ b/spec/integration/rack/middleware_regression_spec.rb @@ -27,7 +27,7 @@ it "test yml test cases" do begin - _response_status, _response_headers, response = app.request(method, '/renders', headers.merge(params: params)) + response = app.request(method, '/renders', headers.merge(params: params)) expect(response.body).to(eq(test_response), custom_message(headers, params, method, response.body, test_response)) rescue => e raise custom_message(headers, params, method, response.body, test_response) + ", but it failed with an exception '#{e.message}'" @@ -53,7 +53,7 @@ def custom_message(headers, params, method, actual_response, expected_response) context 'and the request does not contain a version' do it 'does not include a version (rails will convert nil => unversioned template)' do - _response_status, _response_headers, response = app.request('get', '/renders') + response = app.request('get', '/renders') expect(response.body).to eq 'version is ' # nil end end diff --git a/spec/integration/view/view_additions_spec.rb b/spec/integration/view/view_additions_spec.rb index 8b77e8b..b748885 100644 --- a/spec/integration/view/view_additions_spec.rb +++ b/spec/integration/view/view_additions_spec.rb @@ -33,19 +33,10 @@ it { expect(template_format).to eq 'application/json' } end - context 'when in Rails >=4.1' do - before do - unless (ActionPack::VERSION::MAJOR == 4 && ActionPack::VERSION::MINOR >= 1) || - ActionPack::VERSION::MAJOR > 5 - skip('Template variants are only available in Rails >=4.1') - end - end - - context 'when handler, format, variant and version are present' do - let(:template_extension) { 'application.json+tablet.v1.jbuilder' } - - it { expect(template_format).to eq 'application/json' } - end + context 'when handler, format, variant and version are present' do + let(:template_extension) { 'application.json+tablet.v1.jbuilder' } + + it { expect(template_format).to eq 'application/json' } end end end diff --git a/spec/unit/strategies/path_parameter_strategy_spec.rb b/spec/unit/strategies/path_parameter_strategy_spec.rb index a880371..82d39f2 100644 --- a/spec/unit/strategies/path_parameter_strategy_spec.rb +++ b/spec/unit/strategies/path_parameter_strategy_spec.rb @@ -10,6 +10,26 @@ it { is_expected.to eq 11 } end + context "a request with a substring matching /v\d+/ returns nil" do + context "as a postpended string" do + let(:request) { instance_double('Request', path: 'parameter/aav11/parameter') } + + it { is_expected.to be_nil } + end + + context "as a prepended string" do + let(:request) { instance_double('Request', path: 'parameter/v11aa/parameter') } + + it { is_expected.to be_nil } + end + + context "as an interstital string" do + let(:request) { instance_double('Request', path: 'parameter/aav11aa/parameter') } + + it { is_expected.to be_nil } + end + end + context "a request without an api_version path parameter returns nil" do let(:request) { instance_double('Request', path: 'parameter/parameter') } diff --git a/versioncake.gemspec b/versioncake.gemspec index 65ab3c3..9df7d40 100644 --- a/versioncake.gemspec +++ b/versioncake.gemspec @@ -19,9 +19,9 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 1.9.2' - s.add_dependency('actionpack', '>= 3.2') - s.add_dependency('activesupport', '>= 3.2') - s.add_dependency('railties', '>= 3.2') + s.add_dependency('actionpack', '>= 5.0') + s.add_dependency('activesupport', '>= 5.0') + s.add_dependency('railties', '>= 5.0') s.add_dependency('tzinfo') s.add_development_dependency 'appraisal'