gem-empty 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7f5c71134ce63c0676f82574890f682cdda5b639
4
- data.tar.gz: d2e74beb3bd6d83b4803ff779ed67f46de8e709c
2
+ SHA256:
3
+ metadata.gz: ff17e62544185dfafc24dc791ef9fc4d420441823d425d718de5ec061c809aa6
4
+ data.tar.gz: 75ad4c116d0b2778dd8b473ccf4738a0abca8aab0261398a406d105ad10e0b3a
5
5
  SHA512:
6
- metadata.gz: b0dc26037a708dfecb4ab473044e84334025ef219afb7d7308c26017757ba70146b909645cc66671c91da3af8790ff30ae3be7b3093f2f193cfb614a65da97e2
7
- data.tar.gz: a72f40a5c5e9eaaf445f0e834054d56d0929fb9923f2b2f5ebb792e86f90fcb557d3116ed340d6d3f0232511f13a1b708a79d9e73708db9dcbf72c30cd915c8d
6
+ metadata.gz: 156ad9c9c043775d06874acf28541e19caf5e4ecf9fd7ca49a752e0f80627b5b93ca6f1833e3c586d2e9768dcb9f795974aecf3501cf82a0eae0d8d5bda567ed
7
+ data.tar.gz: 2d01c1a11a816915465103ff3f2fe2deccdd83e0fcb10072e2c72d1728ce773422748ece053c78f841510d630d9bc44a3e105654e28ae18f9bfe47f8e8fab825
@@ -0,0 +1,67 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ name: ${{ matrix.ruby }}-${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ ruby:
16
+ # Due to https://github.com/actions/runner/issues/849, 'x.0' versions have to use quotes
17
+ - '2.0'
18
+ - 2.1
19
+ - 2.2
20
+ - 2.3
21
+ - 2.4
22
+ - 2.5
23
+ - 2.6
24
+ - 2.7
25
+ - '3.0'
26
+ - 3.1
27
+ - 3.2
28
+ - jruby
29
+ - truffleruby
30
+ os:
31
+ - macos
32
+ - ubuntu
33
+ - windows
34
+ exclude:
35
+ - ruby: 2.2 # Fails on setup
36
+ os: ubuntu
37
+ - ruby: 2.7 # Fails only on macos
38
+ os: macos
39
+ - ruby: 3.0 # Fails only on macos
40
+ os: macos
41
+ - ruby: 3.1 # Fails only on macos
42
+ os: macos
43
+ - ruby: 3.2 # Fails only on macos
44
+ os: macos
45
+ - ruby: jruby
46
+ os: macos
47
+ - ruby: jruby
48
+ os: windows
49
+ - ruby: truffleruby
50
+ os: macos
51
+ - ruby: truffleruby
52
+ os: windows
53
+
54
+ runs-on: ${{ matrix.os }}-latest
55
+
56
+ steps:
57
+ - uses: actions/checkout@v3
58
+
59
+ - name: Setup ruby ${{ matrix.ruby }}
60
+ uses: ruby/setup-ruby@v1
61
+ with:
62
+ ruby-version: ${{ matrix.ruby }}
63
+ bundler-cache: true
64
+
65
+ - run: bundle install
66
+
67
+ - run: bundle exec rake test
data/Gemfile CHANGED
@@ -1,16 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- #ruby=2.0.0
4
-
5
3
  gemspec
6
4
 
7
5
  group :development do
8
- # statistics only on MRI 2.0 - avoid problems on older rubies
9
- gem "redcarpet", :platforms => [:mri_20]
10
- gem "simplecov", :platforms => [:mri_20]
11
- gem "coveralls", :platforms => [:mri_20]
12
-
13
- # rubinius support
14
- gem "rubysl-mutex_m", :platforms => [:rbx]
15
- gem "rubysl-singleton", :platforms => [:rbx]
6
+ gem "simplecov", :platforms => :ruby
7
+ gem "coveralls", :platforms => :ruby
8
+ gem "os"
16
9
  end
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Gem empty
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/gem-empty.png)](http://rubygems.org/gems/gem-empty)
3
+ [![Version](https://img.shields.io/gem/v/gem-empty)](https://rubygems.org/gems/gem-empty)
4
+ [![Downloads Total](https://img.shields.io/gem/dt/gem-empty)](https://rubygems.org/gems/gem-empty)
5
+ [![Tests](https://github.com/rvm/gem-empty/workflows/tests/badge.svg)](https://github.com/rvm/gem-empty/actions?query=branch%3Amaster)
4
6
  [![Code Climate](https://codeclimate.com/github/rvm/gem-empty.png)](https://codeclimate.com/github/rvm/gem-empty)
5
- [![Coverage Status](https://coveralls.io/repos/rvm/gem-empty/badge.png?branch=master)](https://coveralls.io/r/rvm/gem-empty?branch=master)
6
- [![Build Status](https://travis-ci.org/rvm/gem-empty.png?branch=master)](https://travis-ci.org/rvm/gem-empty)
7
- [![Dependency Status](https://gemnasium.com/rvm/gem-empty.png)](https://gemnasium.com/rvm/gem-empty)
8
- [![Documentation](http://b.repl.ca/v1/yard-docs-blue.png)](http://rubydoc.info/gems/gem-empty/frames)
7
+ [![Coverage](https://coveralls.io/repos/rvm/gem-empty/badge.png?branch=master)](https://coveralls.io/r/rvm/gem-empty?branch=master)
8
+ [![Financial Contributors on Open Collective](https://opencollective.com/rvm/all/badge.svg?label=backers)](https://opencollective.com/rvm)
9
9
 
10
10
  Gem command to remove all gems from current `GEM_HOME`
11
11
 
data/gem-empty.gemspec CHANGED
@@ -6,8 +6,8 @@ require File.expand_path("../lib/gem-empty/version.rb", __FILE__)
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gem-empty"
8
8
  s.version = GemEmpty::VERSION
9
- s.authors = ["Michal Papis", "Andy Fleener"]
10
- s.email = ["mpapis@gmail.com", "anfleene@gmail.com"]
9
+ s.authors = ["Michal Papis", "Andy Fleener", "Piotr Kuczynski"]
10
+ s.email = ["mpapis@gmail.com", "anfleene@gmail.com", "piotr.kuczynski@gmail.com"]
11
11
  s.homepage = "https://github.com/rvm/gem-empty"
12
12
  s.summary = "Gem command to remove all gems from current GEM_HOME."
13
13
  s.license = "Apache 2.0"
@@ -15,5 +15,4 @@ Gem::Specification.new do |s|
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.add_development_dependency("rake")
17
17
  s.add_development_dependency("minitest")
18
- # s.add_development_dependency("smf-gem")
19
18
  end
@@ -65,14 +65,14 @@ private
65
65
  end
66
66
 
67
67
  def remove_bundler_gems
68
- FileUtils.rm_rf( File.join( gem_install_dir, 'bundler','gems' ) )
68
+ FileUtils.rm_rf(File.join(gem_install_dir, 'bundler', 'gems'))
69
69
  end
70
70
 
71
71
  def gem_dir_specs
72
72
  @gem_dir_specs ||=
73
- GemEmpty::Specification.installed_gems.select do |spec|
74
- File.exists?( File.join( gem_install_dir, 'gems', spec.full_name ) )
75
- end
73
+ GemEmpty::Specification.installed_gems.select do |spec|
74
+ File.exist?(File.join(gem_install_dir, 'gems', spec.full_name))
75
+ end
76
76
  end
77
77
 
78
78
  def gem_install_dir
@@ -2,9 +2,7 @@ module GemEmpty
2
2
  # monkey patch rubygems specification to easily find gem version
3
3
  module Specification
4
4
  def self.installed_gems
5
- if
6
- Gem::VERSION > '1.8'
7
- then
5
+ if Gem::VERSION > '1.8'
8
6
  Gem::Specification.to_a
9
7
  else
10
8
  Gem.source_index.map{|name,spec| spec}
@@ -1,3 +1,3 @@
1
1
  module GemEmpty
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -4,9 +4,11 @@ require 'rubygems/installer'
4
4
  require 'rubygems/user_interaction'
5
5
  require 'rubygems/mock_gem_ui'
6
6
 
7
- class Gem::Specification
8
- def self.remove_spec spec
9
- true # fake the removal from _all
7
+ if RUBY_VERSION < "2.3"
8
+ class Gem::Specification
9
+ def self.remove_spec spec
10
+ true # fake the removal from _all
11
+ end
10
12
  end
11
13
  end
12
14
 
@@ -18,11 +20,11 @@ describe EmptyCommand do
18
20
  end
19
21
 
20
22
  it "has some strings" do
21
- subject.arguments.class.must_equal(String)
22
- subject.usage.class.must_equal(String)
23
- subject.defaults_str.class.must_equal(String)
24
- subject.description.class.must_equal(String)
25
- subject.program_name.class.must_equal(String)
23
+ _(subject.arguments.class).must_equal(String)
24
+ _(subject.usage.class).must_equal(String)
25
+ _(subject.defaults_str.class).must_equal(String)
26
+ _(subject.description.class).must_equal(String)
27
+ _(subject.program_name.class).must_equal(String)
26
28
  end
27
29
 
28
30
  describe "gem-empty" do
@@ -33,7 +35,8 @@ describe EmptyCommand do
33
35
  file.unlink
34
36
  @ui = Gem::MockGemUi.new
35
37
  @found_minitest = Gem::Specification.find_by_name('minitest')
36
- installer = Gem::Installer.new(@found_minitest.cache_file, :version => @found_minitest.version, :install_dir => @test_path)
38
+ package = RUBY_VERSION >= "2.3" ? Gem::Package.new(@found_minitest.cache_file) : @found_minitest.cache_file
39
+ installer = Gem::Installer.new(package, :version => @found_minitest.version, :install_dir => @test_path)
37
40
  bundler_git_gems_path = File.join(@test_path,'bundler','gems')
38
41
  FileUtils.mkdir_p(bundler_git_gems_path)
39
42
  @git_gem_file = File.join(bundler_git_gems_path, 'git-test')
@@ -49,24 +52,24 @@ describe EmptyCommand do
49
52
  end
50
53
 
51
54
  it "removes gems" do
52
- File.exist?(File.join(@test_path, "gems", @found_minitest.full_name)).must_equal(true)
55
+ _(File.exist?(File.join(@test_path, "gems", @found_minitest.full_name))).must_equal(true)
53
56
  use_ui @ui do
54
57
  subject.execute(:install_dir => @test_path)
55
58
  end
56
- File.exist?(File.join(@test_path, "gems", @found_minitest.full_name)).must_equal(false)
57
- @ui.output.must_match(
59
+ _(File.exist?(File.join(@test_path, "gems", @found_minitest.full_name))).must_equal(false)
60
+ _(@ui.output).must_match(
58
61
  /Successfully uninstalled minitest-/
59
62
  )
60
- @ui.error.must_equal("")
63
+ _(@ui.error).must_equal("")
61
64
  end
62
65
 
63
66
  it "removes git gems installed via bundler" do
64
- File.exist?(@git_gem_file).must_equal(true)
67
+ _(File.exist?(@git_gem_file)).must_equal(true)
65
68
  use_ui @ui do
66
69
  subject.execute(:install_dir => @test_path)
67
70
  end
68
- File.exist?(@git_gem_file).must_equal(false)
69
- @ui.error.must_equal("")
71
+ _(File.exist?(@git_gem_file)).must_equal(false)
72
+ _(@ui.error).must_equal("")
70
73
  end
71
74
 
72
75
  it "fails gems" do
@@ -74,10 +77,10 @@ describe EmptyCommand do
74
77
  use_ui @ui do
75
78
  subject.execute(:install_dir => @test_path)
76
79
  end
77
- File.exist?(File.join(@test_path, "gems", @found_minitest.full_name)).must_equal(true)
80
+ _(File.exist?(File.join(@test_path, "gems", @found_minitest.full_name))).must_equal(true)
78
81
  File.chmod(0755, File.join(@test_path) )
79
- @ui.output.must_equal("")
80
- @ui.error.must_match(
82
+ _(@ui.output).must_equal("")
83
+ _(@ui.error).must_match(
81
84
  /ERROR: Gem::FilePermissionError: You don't have write permissions for the .* directory/
82
85
  )
83
86
  end
@@ -86,8 +89,8 @@ describe EmptyCommand do
86
89
 
87
90
  it "finds gem executables" do
88
91
  subject.stub :options, {:install_dir => Gem.dir } do
89
- subject.send(:gem_dir_specs).map{|spec| spec.name}.must_include('minitest')
92
+ _(subject.send(:gem_dir_specs).map{|spec| spec.name}).must_include('minitest')
90
93
  end
91
94
  end
92
95
 
93
- end
96
+ end
@@ -9,19 +9,18 @@ describe GemEmpty::Specification do
9
9
  end
10
10
 
11
11
  it "finds specification" do
12
- GemEmpty::Specification.find_gem_spec("gem-empty").name.must_equal("gem-empty")
12
+ _(GemEmpty::Specification.find_gem_spec("gem-empty").name).must_equal("gem-empty")
13
13
  end
14
14
 
15
15
  it "does not find imaginary gems" do
16
- GemEmpty::Specification.find_gem_spec("imaginary-gem").must_equal(nil)
16
+ _(GemEmpty::Specification.find_gem_spec("imaginary-gem")).must_be_nil
17
17
  end
18
18
 
19
19
  it "confirms specification version" do
20
- GemEmpty::Specification.gem_loaded?("gem-empty", GemEmpty::VERSION).must_equal true
20
+ _(GemEmpty::Specification.gem_loaded?("gem-empty", GemEmpty::VERSION)).must_equal true
21
21
  end
22
22
 
23
23
  it "does not confirms specification version" do
24
- GemEmpty::Specification.gem_loaded?("gem-empty", "0.0.0").wont_equal true
24
+ _(GemEmpty::Specification.gem_loaded?("gem-empty", "0.0.0")).wont_equal true
25
25
  end
26
-
27
- end
26
+ end
data/test/test_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
- if
2
- RUBY_VERSION == "2.0.0" # check Gemfile
3
- then
1
+ require "os"
2
+
3
+ # Coverage only on newer ruby to avoid problems with older versions
4
+ if RUBY_VERSION == "3.0.0" && !OS.windows? && !OS.mac?
4
5
  require "coveralls"
5
6
  require "simplecov"
6
7
 
metadata CHANGED
@@ -1,55 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-empty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Papis
8
8
  - Andy Fleener
9
+ - Piotr Kuczynski
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2015-04-28 00:00:00.000000000 Z
13
+ date: 2023-05-26 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rake
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  requirements:
18
- - - '>='
19
+ - - ">="
19
20
  - !ruby/object:Gem::Version
20
21
  version: '0'
21
22
  type: :development
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  requirements:
25
- - - '>='
26
+ - - ">="
26
27
  - !ruby/object:Gem::Version
27
28
  version: '0'
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: minitest
30
31
  requirement: !ruby/object:Gem::Requirement
31
32
  requirements:
32
- - - '>='
33
+ - - ">="
33
34
  - !ruby/object:Gem::Version
34
35
  version: '0'
35
36
  type: :development
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - '>='
40
+ - - ">="
40
41
  - !ruby/object:Gem::Version
41
42
  version: '0'
42
43
  description:
43
44
  email:
44
45
  - mpapis@gmail.com
45
46
  - anfleene@gmail.com
47
+ - piotr.kuczynski@gmail.com
46
48
  executables: []
47
49
  extensions: []
48
50
  extra_rdoc_files: []
49
51
  files:
50
- - .gitignore
51
- - .travis.yml
52
- - Changelog.md
52
+ - ".github/workflows/tests.yaml"
53
+ - ".gitignore"
53
54
  - Gemfile
54
55
  - LICENSE
55
56
  - README.md
@@ -72,17 +73,16 @@ require_paths:
72
73
  - lib
73
74
  required_ruby_version: !ruby/object:Gem::Requirement
74
75
  requirements:
75
- - - '>='
76
+ - - ">="
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  required_rubygems_version: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - '>='
81
+ - - ">="
81
82
  - !ruby/object:Gem::Version
82
83
  version: '0'
83
84
  requirements: []
84
- rubyforge_project:
85
- rubygems_version: 2.4.3
85
+ rubygems_version: 3.0.3.1
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Gem command to remove all gems from current GEM_HOME.
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1
8
- - 2.2
9
- - ruby-head
10
- - jruby
11
- - rbx
12
- notifications:
13
- irc:
14
- channels:
15
- - "irc.freenode.org#rvm-test"
16
- email:
17
- recipients:
18
- - mpapis@gmail.com
19
- on_failure: change
20
- matrix:
21
- fast_finish: true
data/Changelog.md DELETED
@@ -1,6 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.0.0
4
- date: 2013-12-20
5
-
6
- - stable release