bundler-grep 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/bundler/grep.rb +23 -7
- data/lib/bundler/grep/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05312917e52c1f845a7d1e4346fa856ffd709418
|
4
|
+
data.tar.gz: 3a083ab387dc350a013b93afb9da8978ee7899d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1818b8bfb70cb18eff9a5ca88b0a57aee02d605ccec0f0c6e0e5380f34b5ecc3ae09e27b61feae5d085fe747af548a5e6534c39c2db66eb6c68c27c8c87600a9
|
7
|
+
data.tar.gz: cd7bdf85b523d845273d2b4d7bdf84fd721b3c4e47b5d3614e8520c7b0e0cfa6f7aaee2d9c88d3a79fd898377b90d78731feb5a4336fce961edb9c8f31b81cf0
|
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/
|
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/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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
+
collecte_gem?(spec.name) && not_ignored_gem?(spec.name)
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
def collecte_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
|
data/lib/bundler/grep/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- takkanm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|