From 56509404281e1c68c9f6bcf6ea3fe9937c907512 Mon Sep 17 00:00:00 2001 From: Christoph Olszowka Date: Fri, 17 May 2024 14:31:29 +0200 Subject: [PATCH] Remove & ignore accidentally committed Gemfile.lock, update CI ruby version matrix, fix new rubucop offenses --- .github/workflows/ruby.yml | 14 +- .gitignore | 2 + Gemfile | 19 ++- Gemfile.lock | 196 ------------------------ bundler-toolbox.gemspec | 19 +-- lib/bundler/toolbox/cli.rb | 2 +- lib/bundler/toolbox/plugins/rubygems.rb | 2 +- spec/bundler/toolbox/cli_spec.rb | 10 +- spec/bundler/toolbox_spec.rb | 2 +- 9 files changed, 35 insertions(+), 231 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index cbc9847..0402e8b 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -12,7 +12,8 @@ jobs: fail-fast: false matrix: ruby: - - '2.7' + - '3.3' + - '3.2' steps: - uses: actions/checkout@v2 @@ -43,10 +44,8 @@ jobs: fail-fast: false matrix: ruby: - - '3.0' - - '2.7' - - '2.6' - - '2.5' + - '3.3' + - '3.2' - jruby steps: @@ -83,9 +82,8 @@ jobs: fail-fast: false matrix: ruby: - - '2.7' - - '2.6' - - '2.5' + - '3.3' + - '3.2' steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index b04a8c8..6355904 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,7 @@ /spec/reports/ /tmp/ +Gemfile.lock + # rspec failure tracking .rspec_status diff --git a/Gemfile b/Gemfile index b607de4..41c72e7 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,21 @@ source "https://rubygems.org" gemspec gem "rake", "~> 12.0" -gem "rspec", "~> 3.0" + +gem "rubocop" +gem "rubocop-performance" +gem "rubocop-rake" +gem "rubocop-rspec" + +gem "aruba" +gem "cucumber" + +gem "guard-bundler" +gem "guard-cucumber" +gem "guard-rspec" +gem "guard-rubocop" + +gem "pry" + +gem "rspec", ">= 3.9" +gem "simplecov", ">= 0.18.5" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 8f04530..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,196 +0,0 @@ -PATH - remote: . - specs: - bundler-toolbox (0.1.0) - dry-cli (~> 0.6.0) - rubytoolbox-api (>= 0.2.0) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (6.1.3.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - aruba (1.1.0) - childprocess (>= 2.0, < 5.0) - contracts (~> 0.16.0) - cucumber (>= 2.4, < 7.0) - rspec-expectations (~> 3.4) - thor (~> 1.0) - ast (2.4.2) - builder (3.2.4) - childprocess (4.0.0) - coderay (1.1.3) - concurrent-ruby (1.1.8) - contracts (0.16.1) - cucumber (6.1.0) - builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 9.0, >= 9.0.1) - cucumber-create-meta (~> 4.0, >= 4.0.0) - cucumber-cucumber-expressions (~> 12.1, >= 12.1.1) - cucumber-gherkin (~> 18.1, >= 18.1.0) - cucumber-html-formatter (~> 13.0, >= 13.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-wire (~> 5.0, >= 5.0.1) - diff-lcs (~> 1.4, >= 1.4.4) - mime-types (~> 3.3, >= 3.3.1) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-core (9.0.1) - cucumber-gherkin (~> 18.1, >= 18.1.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-tag-expressions (~> 3.0, >= 3.0.1) - cucumber-create-meta (4.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-cucumber-expressions (12.1.1) - cucumber-gherkin (18.1.1) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-html-formatter (13.0.0) - cucumber-messages (~> 15.0, >= 15.0.0) - cucumber-messages (15.0.0) - protobuf-cucumber (~> 3.10, >= 3.10.8) - cucumber-tag-expressions (3.0.1) - cucumber-wire (5.0.1) - cucumber-core (~> 9.0, >= 9.0.1) - cucumber-cucumber-expressions (~> 12.1, >= 12.1.1) - cucumber-messages (~> 15.0, >= 15.0.0) - diff-lcs (1.4.4) - docile (1.3.5) - dry-cli (0.6.0) - concurrent-ruby (~> 1.0) - ffi (1.15.3) - formatador (0.3.0) - guard (2.18.0) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.13.0) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-bundler (3.0.0) - bundler (>= 2.1, < 3) - guard (~> 2.2) - guard-compat (~> 1.1) - guard-compat (1.2.1) - guard-cucumber (3.0.0) - cucumber (>= 3.1) - nenv (>= 0.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) - guard-rubocop (1.5.0) - guard (~> 2.0) - rubocop (< 2.0) - i18n (1.8.10) - concurrent-ruby (~> 1.0) - listen (3.7.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.2.8) - method_source (1.0.0) - middleware (0.1.0) - mime-types (3.3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) - minitest (5.14.4) - multi_test (0.1.2) - nenv (0.3.0) - notiffany (0.1.3) - nenv (~> 0.1) - shellany (~> 0.0) - parallel (1.21.0) - parser (3.0.2.0) - ast (~> 2.4.1) - protobuf-cucumber (3.10.8) - activesupport (>= 3.2) - middleware - thor - thread_safe - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) - rainbow (3.0.0) - rake (12.3.3) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) - regexp_parser (2.1.1) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.2) - rubocop (1.22.0) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.12.0) - parser (>= 3.0.1.1) - rubocop-performance (1.11.5) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rake (0.6.0) - rubocop (~> 1.0) - rubocop-rspec (2.5.0) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) - rubytoolbox-api (0.2.0) - shellany (0.0.1) - simplecov (0.21.2) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) - simplecov_json_formatter (0.1.2) - sys-uname (1.2.2) - ffi (~> 1.1) - thor (1.1.0) - thread_safe (0.3.6) - tzinfo (2.0.4) - concurrent-ruby (~> 1.0) - unicode-display_width (2.1.0) - zeitwerk (2.4.2) - -PLATFORMS - ruby - -DEPENDENCIES - aruba - bundler-toolbox! - cucumber - guard-bundler - guard-cucumber - guard-rspec - guard-rubocop - pry - rake (~> 12.0) - rspec (~> 3.0) - rubocop - rubocop-performance - rubocop-rake - rubocop-rspec - simplecov (>= 0.18.5) - -BUNDLED WITH - 2.1.4 diff --git a/bundler-toolbox.gemspec b/bundler-toolbox.gemspec index e61468e..e79432a 100644 --- a/bundler-toolbox.gemspec +++ b/bundler-toolbox.gemspec @@ -30,22 +30,5 @@ Gem::Specification.new do |spec| spec.add_dependency "dry-cli", "~> 0.6.0" spec.add_dependency "rubytoolbox-api", ">= 0.2.0" - - spec.add_development_dependency "rubocop" - spec.add_development_dependency "rubocop-performance" - spec.add_development_dependency "rubocop-rake" - spec.add_development_dependency "rubocop-rspec" - - spec.add_development_dependency "aruba" - spec.add_development_dependency "cucumber" - - spec.add_development_dependency "guard-bundler" - spec.add_development_dependency "guard-cucumber" - spec.add_development_dependency "guard-rspec" - spec.add_development_dependency "guard-rubocop" - - spec.add_development_dependency "pry" - - spec.add_development_dependency "rspec", ">= 3.9" - spec.add_development_dependency "simplecov", ">= 0.18.5" + spec.metadata["rubygems_mfa_required"] = "true" end diff --git a/lib/bundler/toolbox/cli.rb b/lib/bundler/toolbox/cli.rb index d635e2b..ecea8d3 100644 --- a/lib/bundler/toolbox/cli.rb +++ b/lib/bundler/toolbox/cli.rb @@ -23,7 +23,7 @@ def with_environment(new_environment) raise ArgumentError, "Unknown environment #{new_environment}! Known: #{KNOWN_ENVIRONMENTS.inspect}" end - old_environment = ENV["BUNDLER_TOOLBOX_ENVIRONMENT"] + old_environment = ENV.fetch("BUNDLER_TOOLBOX_ENVIRONMENT", nil) ENV["BUNDLER_TOOLBOX_ENVIRONMENT"] = new_environment begin diff --git a/lib/bundler/toolbox/plugins/rubygems.rb b/lib/bundler/toolbox/plugins/rubygems.rb index fcb049d..2ebaf48 100644 --- a/lib/bundler/toolbox/plugins/rubygems.rb +++ b/lib/bundler/toolbox/plugins/rubygems.rb @@ -4,7 +4,7 @@ class Gem::Commands::ToolboxCommand < Gem::Command def initialize - super "toolbox", "Hello World" + super("toolbox", "Hello World") end def execute diff --git a/spec/bundler/toolbox/cli_spec.rb b/spec/bundler/toolbox/cli_spec.rb index 26970e6..09bd668 100644 --- a/spec/bundler/toolbox/cli_spec.rb +++ b/spec/bundler/toolbox/cli_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Bundler::Toolbox::CLI do around do |example| - original = ENV["BUNDLER_TOOLBOX_ENVIRONMENT"] + original = ENV.fetch("BUNDLER_TOOLBOX_ENVIRONMENT", nil) begin example.run ensure @@ -21,7 +21,7 @@ def invoke(*args) it "returns #{environment} when BUNDLER_TOOLBOX_ENVIRONMENT is #{environment}" do ENV["BUNDLER_TOOLBOX_ENVIRONMENT"] = environment - expect(described_class.execution_environment).to be == environment + expect(described_class.execution_environment).to eq environment end end @@ -29,7 +29,7 @@ def invoke(*args) it "returns 'unknown' when BUNDLER_TOOLBOX_ENVIRONMENT is #{environment.inspect}" do ENV["BUNDLER_TOOLBOX_ENVIRONMENT"] = environment.to_s - expect(described_class.execution_environment).to be == "unknown" + expect(described_class.execution_environment).to eq "unknown" end end end @@ -49,7 +49,7 @@ def invoke(*args) block_env = described_class.execution_environment end - expect(block_env).to be == chosen_env + expect(block_env).to eq chosen_env end it "changes environment back to the previous after block has run" do @@ -57,7 +57,7 @@ def invoke(*args) described_class.with_environment("rubygems") { "do nothing" } - expect(described_class.execution_environment).to be == "bundler" + expect(described_class.execution_environment).to eq "bundler" end end diff --git a/spec/bundler/toolbox_spec.rb b/spec/bundler/toolbox_spec.rb index d081844..3f1bb24 100644 --- a/spec/bundler/toolbox_spec.rb +++ b/spec/bundler/toolbox_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Bundler::Toolbox do it "has a version number" do - expect(Bundler::Toolbox::VERSION).not_to be nil + expect(Bundler::Toolbox::VERSION).not_to be_nil end describe Bundler::Toolbox::FixtureAdapter do