From 7f15d0197833686ac77c2f12b54b00c930726b8c Mon Sep 17 00:00:00 2001 From: Luke Hill <20105237+luke-hill@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:40:58 +0000 Subject: [PATCH] V3/doc updates (#582) * Update contributing.md * update readme.md * Use later versions of rspec/rake * Tidy up rakefile * Fix typo in changelog * Rails 6.1 is the latest 6.x so permit latest cucumber * Update license year that was massively outdated * Update link to old legacy geckodriver --- Appraisals | 1 - CHANGELOG.md | 2 +- CONTRIBUTING.md | 15 +++------------ LICENSE | 2 +- README.md | 17 ++++++----------- Rakefile | 17 +++++++---------- bin/install_geckodriver.sh | 2 +- cucumber-rails.gemspec | 4 ++-- dev_tasks/cucumber.rake | 5 ----- dev_tasks/rspec.rake | 5 ----- gemfiles/rails_6_1.gemfile | 1 - 11 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 dev_tasks/cucumber.rake delete mode 100644 dev_tasks/rspec.rake diff --git a/Appraisals b/Appraisals index 694db412..1c0773df 100644 --- a/Appraisals +++ b/Appraisals @@ -24,7 +24,6 @@ end appraise 'rails_6_1' do gem 'activerecord' gem 'capybara', '< 3.38' - gem 'cucumber', '< 10' gem 'psych', '< 4' gem 'railties', '~> 6.1.3' gem 'sqlite3', '~> 1.4' diff --git a/CHANGELOG.md b/CHANGELOG.md index 66936f7c..9a0463ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This file is intended to be modified using the [`changelog`](github.com/cucumber ## [Unreleased] ### Changed - Add support for Rails 7.1 [#575](https://github.com/cucumber/cucumber-rails/pull/575) -- Added new rubocop sub-gems (rails / rake) and updated versions to 2.6 ruby-conformance [#581](https://github.com/cucumber/cucumber-rails/pull/581) +- Added new rubocop sub-gems (rails / rake) and updated repo to be rubocop 2.6 conformant [#581](https://github.com/cucumber/cucumber-rails/pull/581) ### Fixed - Some of the rails 5.2 tests were installing lots of old conflicting gems ([luke-hill]) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0245ef93..cfdd982f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,22 +40,13 @@ This document is a guide for those maintaining Cucumber-Rails, and others who wo To remove and rebuild the different gemfiles (for example, to update a rails version or its dependencies), use the following: - [bundle exec] appraisal update + [bundle exec] rake gemfiles:reinstall If you've changed versions of the dependencies, you may find it helpful to forcefully clean each appraisal's gem lock file in `gemfiles/`. You can do this using: - [bundle exec] rake clean + [bundle exec] rake gemfiles:clean ## Release Process -* Make sure `CHANGELOG.md` is updated with the upcoming version number, and has entries for all fixes. -* No need to add a new version header at this point - this should be done when a new release is made, later. -* Make sure you have up-to-date and clean copy of `cucumber/cucumber.github.com.git` at the same level as cucumber repo. - -Now release it - - bundle update - bundle exec rake - git commit -m "Release X.Y.Z" - rake release +We now use polyglot-release. Consult [RELEASING.md](./RELEASING.md) for more info diff --git a/LICENSE b/LICENSE index 2e45658c..376cf4b0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2008-2020 Aslak Hellesøy and the Cucumber Team. +Copyright (c) 2008-2024 Aslak Hellesøy and the Cucumber Team. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index a297fd34..29ad4612 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,6 @@ Finally, bootstrap your Rails app, for example: ## Running Cucumber -With Rake: - - rake cucumber - -Without Rake: - [bundle exec] cucumber ## Configuration options @@ -52,7 +46,8 @@ before and after your scenarios. You can disable this behaviour like so: Cucumber::Rails::Database.autorun_database_cleaner = false ``` -By default, cucumber-rails will auto mix-in the helpers from `Rack::Test` into your default Cucumber World instance. You can prevent this behaviour like so: +By default, cucumber-rails will auto mix-in the helpers from `Rack::Test` into your default Cucumber World instance. +You can prevent this behaviour like so: ```ruby # features/support/env.rb ENV['CR_REMOVE_RACK_TEST_HELPERS'] = 'true' @@ -71,7 +66,7 @@ Cucumber feature. Let's say you think you have found a bug in the cucumber:insta Fork this project, clone it to your workstation and check out a branch with a descriptive name: git clone git@github.com:you/cucumber-rails.git - git checkout -b bugfix/generator-fails-on-ruby-31 + git checkout -b bugfix/generator-fails-on-bundle-exec Start by making sure you can run the existing features. Now, create a feature that demonstrates what's wrong. See the existing features for examples. When you have a failing feature that @@ -83,7 +78,7 @@ feature) before you send the pull request. ### Setting up your environment -Make sure you have a supported ruby installed, cd into your cucumber-rails repository and: +Make sure you have a supported ruby installed, cd into your `cucumber-rails` repository and run gem install bundler bundle install @@ -116,8 +111,8 @@ To support the multiple-gemfile testing, when adding a new dependency the follow 1. If it's a runtime dependency of the gem, add it to the gemspec 2. If it's a primary development dependency, add it to the gemspec -3. If it's a dependency of a generated rails app in a test, add it to [the helper] that modifies the `Gemfile` +3. If it's a dependency of a generated rails app in a test, add it to [the helper method] that modifies the `Gemfile` For example, rspec is a primary development dependency, so it lives in the gemspec. -[the helper]: https://github.com/cucumber/cucumber-rails/blob/5e37c530560ae1c1a79521c38a54bae0be94242b/features/step_definitions/cucumber_rails_steps.rb#L15 +[the helper method]: https://github.com/cucumber/cucumber-rails/blob/main/features/support/cucumber_rails_helper.rb#L19 diff --git a/Rakefile b/Rakefile index 9d9f6a76..b85c88ec 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,16 @@ # frozen_string_literal: true -CUCUMBER_RAILS_VERSION = - Gem::Specification.load("#{File.dirname(__FILE__)}/cucumber-rails.gemspec").version.version -require 'rubygems' require 'appraisal' -require 'rake/clean' require 'pathname' +require 'cucumber/rake/task' +require 'rspec/core/rake_task' -$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib") -Dir["#{File.dirname(__FILE__)}/dev_tasks/*.rake"].sort.each { |ext| load ext } +Cucumber::Rake::Task.new +RSpec::Core::RakeTask.new -CLEAN.include('doc', 'tmp') +$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib") task default: :test - task test: %i[spec cucumber] namespace :test do @@ -35,7 +32,7 @@ end namespace :gemfiles do desc 'Re-install dependencies for all gemfiles' - task :install do + task :reinstall do system 'bundle exec appraisal update' end @@ -45,5 +42,5 @@ namespace :gemfiles do end desc 'Remove all generated gemfiles and re-install dependencies' - task rebuild: %i[clean install] + task rebuild: %i[clean reinstall] end diff --git a/bin/install_geckodriver.sh b/bin/install_geckodriver.sh index 0ded834a..4f153a11 100755 --- a/bin/install_geckodriver.sh +++ b/bin/install_geckodriver.sh @@ -8,7 +8,7 @@ curl --silent \ --fail \ --retry 3 \ --output /tmp/geckodriver_linux64.tar.gz \ - https://github.com/mozilla/geckodriver/releases/download/v0.27.0/geckodriver-v0.27.0-linux64.tar.gz + https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz sudo tar -C /usr/local/bin -xvzf /tmp/geckodriver_linux64.tar.gz geckodriver diff --git a/cucumber-rails.gemspec b/cucumber-rails.gemspec index a10bd7c7..a142fa52 100644 --- a/cucumber-rails.gemspec +++ b/cucumber-rails.gemspec @@ -34,8 +34,8 @@ Gem::Specification.new do |s| s.add_development_dependency('aruba', '>= 1.1.2', '< 3') s.add_development_dependency('database_cleaner', '>= 1.8', '< 3.0') s.add_development_dependency('rails', '>= 5.2', '< 8') - s.add_development_dependency('rake', '>= 12.0') - s.add_development_dependency('rspec', '~> 3.6') + s.add_development_dependency('rake', '>= 13.0') + s.add_development_dependency('rspec', '~> 3.12') s.add_development_dependency('rubocop', '~> 1.45.0') s.add_development_dependency('rubocop-packaging', '~> 0.5.2') s.add_development_dependency('rubocop-performance', '~> 1.17.1') diff --git a/dev_tasks/cucumber.rake b/dev_tasks/cucumber.rake deleted file mode 100644 index d937deb0..00000000 --- a/dev_tasks/cucumber.rake +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -require 'cucumber/rake/task' - -Cucumber::Rake::Task.new diff --git a/dev_tasks/rspec.rake b/dev_tasks/rspec.rake deleted file mode 100644 index 0e5b843d..00000000 --- a/dev_tasks/rspec.rake +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index ef23c41d..2f5a0b11 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -4,7 +4,6 @@ source "https://rubygems.org" gem "activerecord" gem "capybara", "< 3.38" -gem "cucumber", "< 10" gem "psych", "< 4" gem "railties", "~> 6.1.3" gem "sqlite3", "~> 1.4"