From c24956f1bfcbf4e810c7de2e96bab59593d8e2aa Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Fri, 26 May 2023 23:44:38 +0200 Subject: [PATCH 1/6] Replace deprecated File.exists with File.exist --- .github/workflows/tests.yaml | 3 +++ lib/gem-empty/command.rb | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b192d65..43e5e24 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -24,6 +24,9 @@ jobs: - 2.7 - '3.0' - 3.1 + - 3.2 + - 3.3 + - head - jruby - truffleruby os: diff --git a/lib/gem-empty/command.rb b/lib/gem-empty/command.rb index c91da53..0d1ef8e 100644 --- a/lib/gem-empty/command.rb +++ b/lib/gem-empty/command.rb @@ -65,14 +65,14 @@ def remove_rubygems_gems end def remove_bundler_gems - FileUtils.rm_rf( File.join( gem_install_dir, 'bundler','gems' ) ) + FileUtils.rm_rf(File.join(gem_install_dir, 'bundler', 'gems')) end def gem_dir_specs @gem_dir_specs ||= - GemEmpty::Specification.installed_gems.select do |spec| - File.exists?( File.join( gem_install_dir, 'gems', spec.full_name ) ) - end + GemEmpty::Specification.installed_gems.select do |spec| + File.exist?(File.join(gem_install_dir, 'gems', spec.full_name)) + end end def gem_install_dir From 56caf533c87114fc69952f60004ff68442e76b06 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Fri, 26 May 2023 23:58:57 +0200 Subject: [PATCH 2/6] Add comment --- test/gem-empty/command_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/gem-empty/command_test.rb b/test/gem-empty/command_test.rb index c4984f6..a750572 100644 --- a/test/gem-empty/command_test.rb +++ b/test/gem-empty/command_test.rb @@ -4,6 +4,7 @@ require 'rubygems/user_interaction' require 'rubygems/mock_gem_ui' +# This is needed by Ruby < 2.3 class Gem::Specification def self.remove_spec spec true # fake the removal from _all From 318d93cd969f2f44b8492b5b1934dd954c1e7093 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Sat, 27 May 2023 00:00:01 +0200 Subject: [PATCH 3/6] Lets see if this is fixing anything --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 43e5e24..f9b2752 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -57,7 +57,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup ruby ${{ matrix.ruby }} - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby-pkgs@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true From 97ae3339efca077a34c61403755c270ac485fb15 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Sat, 27 May 2023 00:06:15 +0200 Subject: [PATCH 4/6] Keep only 3.2 for now and ignore 3.3 --- .github/workflows/tests.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f9b2752..1770a49 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,8 +25,6 @@ jobs: - '3.0' - 3.1 - 3.2 - - 3.3 - - head - jruby - truffleruby os: From dd8837a0b1b0debcb7d7ca1c1ad2983b41642e33 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Sat, 27 May 2023 00:09:30 +0200 Subject: [PATCH 5/6] Compatibility --- .github/workflows/tests.yaml | 2 ++ test/gem-empty/command_test.rb | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1770a49..f9b2752 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,8 @@ jobs: - '3.0' - 3.1 - 3.2 + - 3.3 + - head - jruby - truffleruby os: diff --git a/test/gem-empty/command_test.rb b/test/gem-empty/command_test.rb index a750572..2943a18 100644 --- a/test/gem-empty/command_test.rb +++ b/test/gem-empty/command_test.rb @@ -5,9 +5,11 @@ require 'rubygems/mock_gem_ui' # This is needed by Ruby < 2.3 -class Gem::Specification - def self.remove_spec spec - true # fake the removal from _all +if RUBY_VERSION < "2.4" + class Gem::Specification + def self.remove_spec spec + true # fake the removal from _all + end end end From 45d70e4c20ab4bdf5c2bafbe412ab54e973f94c5 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Sat, 27 May 2023 00:13:19 +0200 Subject: [PATCH 6/6] Compatibility --- .github/workflows/tests.yaml | 2 -- test/gem-empty/command_test.rb | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f9b2752..1770a49 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,8 +25,6 @@ jobs: - '3.0' - 3.1 - 3.2 - - 3.3 - - head - jruby - truffleruby os: diff --git a/test/gem-empty/command_test.rb b/test/gem-empty/command_test.rb index 2943a18..3519064 100644 --- a/test/gem-empty/command_test.rb +++ b/test/gem-empty/command_test.rb @@ -4,8 +4,7 @@ require 'rubygems/user_interaction' require 'rubygems/mock_gem_ui' -# This is needed by Ruby < 2.3 -if RUBY_VERSION < "2.4" +if RUBY_VERSION < "2.3" class Gem::Specification def self.remove_spec spec true # fake the removal from _all