gem-grep 0.5.1 → 0.6.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
2
  SHA1:
3
- metadata.gz: f0cb2059ac91a5b40ee8503ccfb84e82012bd4ec
4
- data.tar.gz: 14be2c5362ffc985fa8afbd0835546f1b546bf4d
3
+ metadata.gz: 171cbf2118f105c6aa76eeea5c5903b887380ef7
4
+ data.tar.gz: 898bb303c267f382a28151b284da2b6faf93890e
5
5
  SHA512:
6
- metadata.gz: 910516f975e50c040504cfb5513446ac14b7bcace4197d015df8578089945ff37c61be7d741b9f19652ccb5766222dbee7882f484efb187f3d0c677e5af3b0d1
7
- data.tar.gz: 0f158d178827f093925a52c721930eba8c93ce292df56e14aa96f7f2af5189e10cadb7d588bfa66a00955846f204781a1d8a6ee2721df58b6897adf043975a94
6
+ metadata.gz: f7e5f847dbf7ab2e0f0e1ffbbe29693af1c1eb17a51499e82258f6712c476cac129551d1ae1d0e02019bbfd2c0ba630e45150a92c6df06f434fed9a4226318f9
7
+ data.tar.gz: e54c624bd5bed53dd7dda4d6b64eb28380a5861f65066a72ba27eaef582c837b87c5451f86972c0bee81e3783fc4e770365da6ff9cf4332c45e4a786d5337758
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGES
2
2
 
3
+ ## gem-grep 0.6.0 -- 2013-11-26
4
+
5
+ * Accept `$GEM_GREP` for the grep command. Recommend [ag][].
6
+ * Also pass -n (--line-number) to the grep command.
7
+
8
+ [ag]: https://github.com/ggreer/the_silver_searcher
9
+
3
10
  ## gem-grep 0.5.1 -- 2013-11-22
4
11
 
5
12
  * Showed the grep command.
data/README.md CHANGED
@@ -19,7 +19,7 @@ Also checkout [gem-eit][].
19
19
 
20
20
  * Tested with MRI (official CRuby) 1.9.3, 2.0.0, Rubinius and JRuby.
21
21
  * [gem-path](https://github.com/godfat/gem-path)
22
- * grep from shell
22
+ * `grep` from shell, or set `GEM_GREP` to `ag` or whatever command you want.
23
23
 
24
24
  ## INSTALLATION:
25
25
 
@@ -27,36 +27,42 @@ Also checkout [gem-eit][].
27
27
 
28
28
  ## SYNOPSIS:
29
29
 
30
- Use `--` to pass arguments to `grep`, such as `--color`, `-E`, or `-A`.
30
+ Please set either `$GEM_GREP` to the command you want to search sources.
31
+ By default it would pick `grep` if nothing is set. However we recommend
32
+ [ag][] if you have it installed.
33
+
34
+ Use `--` to pass arguments to `$GEM_GREP`, such as `--color`, `-E`, or `-A`.
35
+
36
+ [ag]: https://github.com/ggreer/the_silver_searcher
31
37
 
32
38
  ### grep gem
33
39
 
34
40
  gem grep rib -- 'def test'
35
- # grep 'def test' -R ~/.gem/ruby/2.0.0/gems/rib-1.0.0
41
+ # grep 'def test' -nR ~/.gem/ruby/2.0.0/gems/rib-1.0.0
36
42
 
37
43
  gem grep rib -- -E 'def \w{4}\b' -A 3 --color
38
- # grep -E 'def \w{4}\b' -A 3 --color -R ~/.gem/ruby/2.0.0/gems/rib-1.0.0
44
+ # grep -E 'def \w{4}\b' -A 3 --color -nR ~/.gem/ruby/2.0.0/gems/rib-1.0.0
39
45
 
40
46
  ### grep gem with specific version
41
47
 
42
48
  gem grep rib '<1' -- 'def test'
43
- # grep 'def test' -R ~/.gem/ruby/2.0.0/gems/rib-0.9.9
49
+ # grep 'def test' -nR ~/.gem/ruby/2.0.0/gems/rib-0.9.9
44
50
 
45
51
  gem grep rib '~>0.8.2' -- 'def test'
46
- # grep 'def test' -R ~/.gem/ruby/2.0.0/gems/rib-0.8.9
52
+ # grep 'def test' -nR ~/.gem/ruby/2.0.0/gems/rib-0.8.9
47
53
 
48
54
  gem grep rib 0.1.0 -- 'def test'
49
- # grep 'def test' -R ~/.gem/ruby/2.0.0/gems/rib-0.1.0
55
+ # grep 'def test' -nR ~/.gem/ruby/2.0.0/gems/rib-0.1.0
50
56
 
51
57
  ### grep gem from a require path
52
58
 
53
59
  gem grep rib/config -- 'def test'
54
- # grep 'def test' -R ~/.gem/ruby/2.0.0/gems/rib-1.0.0
60
+ # grep 'def test' -nR ~/.gem/ruby/2.0.0/gems/rib-1.0.0
55
61
 
56
62
  ### grep a file from a require path
57
63
 
58
64
  gem grep timeout -- class
59
- # grep class -R /usr/lib/ruby/2.0.0/timeout.rb
65
+ # grep class -nR /usr/lib/ruby/2.0.0/timeout.rb
60
66
 
61
67
  ## CONTRIBUTORS:
62
68
 
data/Rakefile CHANGED
@@ -8,6 +8,6 @@ end
8
8
 
9
9
  Gemgem.init(dir) do |s|
10
10
  s.name = 'gem-grep'
11
- s.version = '0.5.1'
11
+ s.version = '0.6.0'
12
12
  s.add_runtime_dependency('gem-path')
13
13
  end
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: gem-grep 0.5.1 ruby lib
2
+ # stub: gem-grep 0.6.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gem-grep"
6
- s.version = "0.5.1"
6
+ s.version = "0.6.0"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Lin Jen-Shin (godfat)"]
10
- s.date = "2013-11-22"
10
+ s.date = "2013-11-27"
11
11
  s.description = "grep the gem for a given name or grep the file for a given require path.\n\nAlso checkout [gem-eit][].\n\n[gem-eit]: https://github.com/godfat/gem-eit"
12
12
  s.email = ["godfat (XD) godfat.org"]
13
13
  s.files = [
@@ -26,7 +26,7 @@ class Gem::Commands::GrepCommand < Gem::Command
26
26
  alert_error('No pattern specified')
27
27
  terminate_interaction(1)
28
28
  else
29
- exec('grep', *options[:build_args], '-R', ui.outs.string.strip)
29
+ exec(grep, *options[:build_args], '-nR', ui.outs.string.strip)
30
30
  end
31
31
  end
32
32
 
@@ -34,4 +34,8 @@ class Gem::Commands::GrepCommand < Gem::Command
34
34
  say(args.join(' '))
35
35
  super
36
36
  end
37
+
38
+ def grep
39
+ ENV['GEM_GREP'] || 'grep'
40
+ end
37
41
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-grep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-22 00:00:00.000000000 Z
11
+ date: 2013-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem-path
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '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
26
  version: '0'
27
27
  description: |-
@@ -36,9 +36,9 @@ executables: []
36
36
  extensions: []
37
37
  extra_rdoc_files: []
38
38
  files:
39
- - .gitignore
40
- - .gitmodules
41
- - .travis.yml
39
+ - ".gitignore"
40
+ - ".gitmodules"
41
+ - ".travis.yml"
42
42
  - CHANGES.md
43
43
  - LICENSE
44
44
  - README.md
@@ -58,12 +58,12 @@ require_paths:
58
58
  - lib
59
59
  required_ruby_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []