gem-grep 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/Rakefile +1 -1
- data/gem-grep.gemspec +2 -2
- data/lib/rubygems/commands/grep_command.rb +19 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0e202343d2656a46a51114ee7309babaf0df4e1
|
4
|
+
data.tar.gz: 89640c71f9e8219ad7733b01c3ae44812bd745fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7734f187e32b6ace6ba7b2ebe4faa6211f54e0f0a095addf5ec3a21f6c1958d2860798015058eac411122467ab0b937fd6069cf6a2617aa6d91e50fefdcf1449
|
7
|
+
data.tar.gz: 10de66d403f932a5917ad03754aa9dcd113bac681c1ef1108e624938a509fad5e3e4240850c516e571eae0dd6e95f6c0eeb752efa6cb992c97022609ac62871a
|
data/CHANGES.md
CHANGED
data/Rakefile
CHANGED
data/gem-grep.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: gem-grep 0.6.
|
2
|
+
# stub: gem-grep 0.6.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "gem-grep"
|
6
|
-
s.version = "0.6.
|
6
|
+
s.version = "0.6.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
@@ -17,25 +17,33 @@ class Gem::Commands::GrepCommand < Gem::Command
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def execute
|
20
|
-
ui = CapturedUI.new
|
21
|
-
Gem::DefaultUserInteraction.use_ui(ui) do
|
22
|
-
Gem::GemRunner.new.run(['path'] + options[:args])
|
23
|
-
end
|
24
|
-
|
25
20
|
if options[:build_args].empty?
|
26
21
|
alert_error('No pattern specified')
|
27
22
|
terminate_interaction(1)
|
28
|
-
else
|
29
|
-
exec(grep, *options[:build_args], '-nR', ui.outs.string.strip)
|
30
23
|
end
|
24
|
+
|
25
|
+
exec(*grep_command(options[:args], options[:build_args]))
|
31
26
|
end
|
32
27
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
28
|
+
def grep_command path_args, grep_args
|
29
|
+
[grep_name, *grep_args, '-nR', capture_path(*path_args)]
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def capture_path *path_args
|
34
|
+
ui = CapturedUI.new
|
35
|
+
Gem::DefaultUserInteraction.use_ui(ui) do
|
36
|
+
Gem::GemRunner.new.run(['path', *path_args])
|
37
|
+
end
|
38
|
+
ui.outs.string.strip
|
36
39
|
end
|
37
40
|
|
38
|
-
def
|
41
|
+
def grep_name
|
39
42
|
ENV['GEM_GREP'] || 'grep'
|
40
43
|
end
|
44
|
+
|
45
|
+
def exec *args
|
46
|
+
say(args.join(' '))
|
47
|
+
super
|
48
|
+
end
|
41
49
|
end
|