rspeck 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/finder.rb +8 -10
- data/lib/parsor.rb +1 -1
- data/lib/runner.rb +3 -1
- metadata +1 -1
data/lib/finder.rb
CHANGED
@@ -7,19 +7,17 @@ module Spectr
|
|
7
7
|
raise 'ack[-grep] not found!'
|
8
8
|
end
|
9
9
|
|
10
|
-
def find(pattern)
|
11
|
-
|
10
|
+
def find(pattern, path)
|
11
|
+
regex = /(\W|\A)it\W.*#{pattern}/
|
12
|
+
results = `#{detect_finder} \"#{regex}\" #{path} --ruby`
|
12
13
|
|
13
|
-
results.split(/\n/).
|
14
|
-
|
15
|
-
/"(.+)"/ =~ match[2]
|
14
|
+
results.split(/\n/).map do |line|
|
15
|
+
parts = line.split(/:/).map(&:chomp).map(&:strip)
|
16
16
|
|
17
|
-
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:spec => $1 })
|
17
|
+
{ :file => parts[0],
|
18
|
+
:line => parts[1],
|
19
|
+
:spec => parts[2] }
|
21
20
|
end
|
22
21
|
end
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
data/lib/parsor.rb
CHANGED
data/lib/runner.rb
CHANGED