Skip to content

Commit

Permalink
Merge pull request #22 from cucumber/gherkin-7
Browse files Browse the repository at this point in the history
Upgrade to gherkin 7
  • Loading branch information
luke-hill authored Aug 16, 2019
2 parents 278ee8a + ac18322 commit 0ddfefc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ matrix:
- rvm: jruby-9.2.7.0

fast_finish: true

# whitelist
branches:
only:
- master
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

12 changes: 6 additions & 6 deletions cucumber-wire.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down
29 changes: 29 additions & 0 deletions scripts/update-gemspec
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 0ddfefc

Please sign in to comment.