gren 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/bin/gren +1 -1
- data/bin/mkgrendb +1 -1
- data/lib/common/grenfiletest.rb +1 -1
- data/lib/findgrep/findgrep.rb +2 -2
- data/lib/gren.rb +1 -1
- data/lib/gren/cli.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/bin/gren
CHANGED
data/bin/mkgrendb
CHANGED
data/lib/common/grenfiletest.rb
CHANGED
data/lib/findgrep/findgrep.rb
CHANGED
@@ -11,7 +11,7 @@ require 'groonga'
|
|
11
11
|
|
12
12
|
module FindGrep
|
13
13
|
class FindGrep
|
14
|
-
Option = Struct.new(:
|
14
|
+
Option = Struct.new(:keywordsNot,
|
15
15
|
:keywordsOr,
|
16
16
|
:directory,
|
17
17
|
:depth,
|
@@ -45,7 +45,7 @@ module FindGrep
|
|
45
45
|
@patterns = patterns
|
46
46
|
@option = option
|
47
47
|
@patternRegexps = strs2regs(patterns, @option.ignoreCase)
|
48
|
-
@subRegexps = strs2regs(option.
|
48
|
+
@subRegexps = strs2regs(option.keywordsNot, @option.ignoreCase)
|
49
49
|
@orRegexps = strs2regs(option.keywordsOr, @option.ignoreCase)
|
50
50
|
@filePatterns = (!@option.dbFile) ? strs2regs(option.filePatterns) : []
|
51
51
|
@ignoreFiles = strs2regs(option.ignoreFiles)
|
data/lib/gren.rb
CHANGED
data/lib/gren/cli.rb
CHANGED
@@ -10,7 +10,7 @@ module Gren
|
|
10
10
|
|
11
11
|
# オプション解析
|
12
12
|
opt = OptionParser.new("#{File.basename($0)} [option] pattern")
|
13
|
-
opt.on('--
|
13
|
+
opt.on('--not PATTERN', 'Keyword is not included.') {|v| option.keywordsNot << v}
|
14
14
|
opt.on('--or PATTERN', 'Either of keyword is contained.') {|v| option.keywordsOr << v}
|
15
15
|
opt.on('-d DIR', '--directory DIR', 'Start directory. (deafult:".")') {|v| option.directory = v}
|
16
16
|
opt.on('--depth DEPTH', 'Limit search depth. ') {|v| option.depth = v.to_i}
|