From 3a69fc240d3920bcd4cbfea5ba3b9dee2d24efd9 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 26 Apr 2017 13:31:44 +0200 Subject: [PATCH] Support rack 2. * Prepare test environment for both rack 1 and rack 2 on Travis. * Update .travis.yml. * Add "bundle list" in script section to check rack's version from Travis log page. * Update Gemfile for rack 2 test, and add gemfiles/Gemfile.rack-1 for rack 1 test. * Keep codeclimate-test-reporter version < 1. To supress deprecated warning temporary. Later update it to latest version. * Add gems to Gemfile for Thorfile. * Specify sinatra 2.0.0.rc2 version for rack 2 test. * Delete Gemfile.lock * Fix test suite for Rack 2.x compatiblity. --- .gitignore | 5 +++-- .travis.yml | 6 ++++++ Gemfile | 15 +++++++++++---- Gemfile.lock | 49 ------------------------------------------------ Gemfile.rack-1.x | 13 +++++++++++++ 5 files changed, 33 insertions(+), 55 deletions(-) delete mode 100644 Gemfile.lock create mode 100644 Gemfile.rack-1.x diff --git a/.gitignore b/.gitignore index 67b6ac18..799aa61b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ pkg doc coverage -Gemfile.lock +/Gemfile*.lock VERSION *.rbc -.bundle +*.swp +/.bundle diff --git a/.travis.yml b/.travis.yml index f4579ec1..cd70dea6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: ruby sudo: false before_install: - which bundle || gem install bundler +script: + - bundle list + - bundle exec rake rvm: - 2.2.7 - 2.3.4 @@ -9,6 +12,9 @@ rvm: - ruby-head - jruby-9.1.8.0 - jruby-head +gemfile: + - Gemfile + - Gemfile.rack-1.x matrix: allow_failures: - rvm: ruby-head diff --git a/Gemfile b/Gemfile index b3f89394..ce6f8185 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,15 @@ source 'https://rubygems.org' -gem 'rspec' -gem "rack" -gem "sinatra" +gemspec + +# Development dependency gem 'rake' +gem 'rspec' +# To use rack 2 +gem 'sinatra', '~> 2.0.0.rc2' +# Keep version < 1 to supress deprecated warning temporary. +gem 'codeclimate-test-reporter', '< 1', :require => false -gem "codeclimate-test-reporter", group: :test, require: nil +# For Thorfile. Run "bundle exec thor help" to see the help. +gem 'thor' +gem 'git' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 3f66d895..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,49 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - codeclimate-test-reporter (0.3.0) - simplecov (>= 0.7.1, < 1.0.0) - diff-lcs (1.2.5) - docile (1.1.3) - multi_json (1.9.0) - rack (1.5.2) - rack-protection (1.5.0) - rack - rake (10.0.4) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.3) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) - simplecov (0.8.2) - docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) - sinatra (1.4.2) - rack (~> 1.5, >= 1.5.2) - rack-protection (~> 1.4) - tilt (~> 1.3, >= 1.3.4) - tilt (1.3.7) - -PLATFORMS - java - ruby - -DEPENDENCIES - codeclimate-test-reporter - rack - rake - rspec - sinatra - -BUNDLED WITH - 1.11.2 diff --git a/Gemfile.rack-1.x b/Gemfile.rack-1.x new file mode 100644 index 00000000..61c5da26 --- /dev/null +++ b/Gemfile.rack-1.x @@ -0,0 +1,13 @@ +source 'https://rubygems.org' + +gemspec + +# Runtime dependency +gem 'rack', '< 2' + +# Development dependency +gem 'rake' +gem 'rspec' +gem 'sinatra' +# Keep version < 1 to supress deprecated warning temporary. +gem 'codeclimate-test-reporter', '< 1', :require => false