bundler-grep 0.2.0 → 0.4.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: 653879f7a3b60e0305f666c60f2b127a59bbff1f
4
- data.tar.gz: 9b120ecad0dd094cf1172800c71ee3cdf9587580
2
+ SHA256:
3
+ metadata.gz: a1122f094605cc30c80c22759f435d056e6b05e8b69d3814fa3db3c3f1abd672
4
+ data.tar.gz: 77e55a2e88e87dad17b444132b027faa6d871fd4525fa1f508c7ca64855217db
5
5
  SHA512:
6
- metadata.gz: 0c503b4b99b75e851687fad0f1713dc3dc3b65c1f9931d4baeacf40c16302bc62519bb60e6b7edcdc39fcfb7e09c7bdfd289a4d225cd4f457ddc3e333f1d5a80
7
- data.tar.gz: e5ddf5d51c1ed1e19e74d2be1d809e34f1251d7ed033c1b544a62687005a31e2139fd354b629bd1291456e98604aeaa53f05aa9d7663392f0b5cec6054ea67a6
6
+ metadata.gz: 8494cbda0c6b5fe3f3aec658dda5dab009de83c4fee9fe5b151bbd03f22b278005085a2034890f7a628dee24df809936a631098c5f4991e6796bedc5e288eb47
7
+ data.tar.gz: b7adfc68f5b8015bb258fe938a833540c6b25e025ca81f0d295e027c5438db0e3e5c84eb7772fcaa7c25ca70ad740960d537ce21e161d4ca2b5483e81b5e2b40
data/README.md CHANGED
@@ -45,7 +45,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
45
45
 
46
46
  ## Contributing
47
47
 
48
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bundler-grep. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
48
+ Bug reports and pull requests are welcome on GitHub at https://github.com/takkanm/bundler-grep. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
49
 
50
50
 
51
51
  ## License
data/bundler-grep.gemspec CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency "bundler", "~> 1.13"
24
+ spec.add_dependency "bundler", "~> 2.0"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
2
  module Grep
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
data/lib/bundler/grep.rb CHANGED
@@ -10,6 +10,9 @@ module Bundler
10
10
 
11
11
  class Command
12
12
  def initialize(argv)
13
+ @gems = []
14
+ @ignore_gems = []
15
+
13
16
  parse_argument!(argv)
14
17
  end
15
18
 
@@ -24,6 +27,9 @@ module Bundler
24
27
  opt.on('-g name1[,name2..]', '--gems name1[,name2..]', 'select target gems') do |gems|
25
28
  @gems = gems.split(',')
26
29
  end
30
+ opt.on('--ingore-gems name1[,name2..]', 'ignore grep gems') do |gems|
31
+ @ignore_gems = gems.split(',')
32
+ end
27
33
  opt.version = Bundler::Grep::VERSION
28
34
 
29
35
  opt.parse!(argv)
@@ -39,13 +45,23 @@ module Bundler
39
45
  end
40
46
 
41
47
  def selected_gem_paths
42
- if @gems
43
- Bundler.load.specs.find_all {|spec|
44
- @gems.include?(spec.name)
45
- }.map(&:full_gem_path)
46
- else
47
- Bundler.load.specs.map(&:full_gem_path)
48
- end
48
+ selected_gem_specs.map(&:full_gem_path)
49
+ end
50
+
51
+ def selected_gem_specs
52
+ return Bundler.load.specs if @gems.empty? && @ignore_gems.empty?
53
+
54
+ Bundler.load.specs.find_all {|spec|
55
+ collected_gem?(spec.name) && not_ignored_gem?(spec.name)
56
+ }
57
+ end
58
+
59
+ def collected_gem?(gem_name)
60
+ @gems.empty? || @gems.include?(gem_name)
61
+ end
62
+
63
+ def not_ignored_gem?(gem_name)
64
+ @ignore_gems.empty? || !@ignore_gems.include?(gem_name)
49
65
  end
50
66
  end
51
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - takkanm
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -62,7 +62,7 @@ homepage: https://github.com/takkanm/bundler-grep
62
62
  licenses:
63
63
  - MIT
64
64
  metadata: {}
65
- post_install_message:
65
+ post_install_message:
66
66
  rdoc_options: []
67
67
  require_paths:
68
68
  - lib
@@ -77,10 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubyforge_project:
81
- rubygems_version: 2.5.1
82
- signing_key:
80
+ rubygems_version: 3.5.3
81
+ signing_key:
83
82
  specification_version: 4
84
83
  summary: bundle grep subcommand
85
84
  test_files: []
86
- has_rdoc: