diff --git a/.travis.yml b/.travis.yml index f1c96e2..b57094f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,3 @@ matrix: - rvm: jruby-9.2.7.0 fast_finish: true - -# whitelist -branches: - only: - - master diff --git a/Gemfile b/Gemfile index 388d2e6..3b4162a 100644 --- a/Gemfile +++ b/Gemfile @@ -7,12 +7,12 @@ gemspec if ENV['CUCUMBER_RUBY_CORE'] gem 'cucumber-core', path: ENV['CUCUMBER_RUBY_CORE'] elsif !ENV['CUCUMBER_USE_RELEASED_GEMS'] - gem 'cucumber-core', github: 'cucumber/cucumber-ruby-core' + gem 'cucumber-core', github: 'cucumber/cucumber-ruby-core', branch: 'gherkin-7' end if ENV['CUCUMBER_RUBY'] gem 'cucumber', path: ENV['CUCUMBER_RUBY'] elsif !ENV['CUCUMBER_USE_RELEASED_GEMS'] - gem 'cucumber', github: 'cucumber/cucumber-ruby' + gem 'cucumber', github: 'cucumber/cucumber-ruby', branch: 'gherkin-7' end diff --git a/cucumber-wire.gemspec b/cucumber-wire.gemspec index dcbe5c7..2304a81 100644 --- a/cucumber-wire.gemspec +++ b/cucumber-wire.gemspec @@ -13,13 +13,13 @@ Gem::Specification.new do |s| s.license = 'MIT' s.required_ruby_version = '>= 2.3' - s.add_dependency 'cucumber-core', '~> 4.0' - s.add_dependency 'cucumber-expressions', '~> 7.0' + s.add_dependency 'cucumber-core', '~> 5.0', '>= 5.0.0' + s.add_dependency 'cucumber-expressions', '~> 8.0', '>= 8.0.0' - s.add_development_dependency 'cucumber', '~> 4.0' - s.add_development_dependency 'rake', '~> 12.0' - s.add_development_dependency 'rspec', '~> 3.5' - s.add_development_dependency 'aruba', '~> 0.14' + s.add_development_dependency 'cucumber', '~> 3.1', '>= 3.1.2' + s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3' + s.add_development_dependency 'rspec', '~> 3.8', '>= 3.8.0' + s.add_development_dependency 'aruba', '~> 0.14', '>= 0.14.11' s.rubygems_version = '>= 1.6.1' s.test_files = Dir[ diff --git a/scripts/update-gemspec b/scripts/update-gemspec new file mode 100755 index 0000000..8e61321 --- /dev/null +++ b/scripts/update-gemspec @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# Updates the *.gemspec in the current directory to use the latest releases of gems +# +set -uf -o pipefail +IFS=$'\n' + +gemspec=$(find . -type f -maxdepth 1 -name "*.gemspec") +add_dependency_lines=$(cat ${gemspec} | grep "s.add_[a-z_]*dependency '[^']*'") +if [ $? -ne 0 ]; then + # No add_dependency_lines found - nothing to do + exit 0 +fi + +set -e + +gems=$(echo "${add_dependency_lines}" | tr -s ' ' | cut -d ' ' -f3 | cut -d"'" -f 2) +while read -r gem; do + echo "upgrading ${gem}" + if [ "${gem}" = "bundler" ]; then + cat "${gemspec}" | sed "s/\(s.add_[a-z_]*dependency\) '${gem}'.*/\1 '${gem}', '~> 1.16', '>= 1.16.2'/" > ${gemspec}.tmp + else + gem_line=$(gem list "${gem}" --remote --all --no-prerelease | grep "^${gem}\s") + latest_patch_version=$(echo "${gem_line}" | cut -d'(' -f2 | cut -d',' -f1 | cut -d' ' -f1) + latest_minor_version=$(echo "${latest_patch_version}" | cut -d. -f1,2) + cat "${gemspec}" | sed "s/\(s.add_[a-z_]*dependency\) '${gem}'.*/\1 '${gem}', '~> ${latest_minor_version}', '>= ${latest_patch_version}'/" > ${gemspec}.tmp + fi + mv ${gemspec}.tmp ${gemspec} +done <<< "${gems}"