ffast 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/fast.rb +6 -2
- data/lib/fast/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c664b4d8bafbac99cd9814bcdf77e730184c6e9a38a01ab52d21369bc9c52f8d
|
4
|
+
data.tar.gz: 3f761262fc7db1a9ab856fcdab4bfe1580187d882f253f03cd82138b745a43d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 742d1f586ede35f47ecdcd27013d9e2082641a7809edc6ea43e1538954a805d9d8aadd2f3c6772161bcad2df6223ba2920a71d745a067e3a6ca91c8ef220c2f4
|
7
|
+
data.tar.gz: 7cb8e4d954d2ecea9e8a5d3f6f94a7b08ecaed80df1b6ee72bcb8e2b0ca58ce1fd20a84166f884fe8d38f4c692ae1da129ec3276a46d3f6a820efde903e830fd
|
data/.travis.yml
CHANGED
data/lib/fast.rb
CHANGED
@@ -99,7 +99,8 @@ module Fast
|
|
99
99
|
# @return [Array<Astrolabe::Node>] that matches the pattern
|
100
100
|
def search_file(pattern, file)
|
101
101
|
node = ast_from_file(file)
|
102
|
-
return []
|
102
|
+
return [] unless node
|
103
|
+
|
103
104
|
search pattern, node
|
104
105
|
end
|
105
106
|
|
@@ -132,7 +133,10 @@ module Fast
|
|
132
133
|
# in the pattern to make it work.
|
133
134
|
# @return [Array<Object>] captured from the pattern matched in the file
|
134
135
|
def capture_file(pattern, file)
|
135
|
-
|
136
|
+
node = ast_from_file(file)
|
137
|
+
return [] unless node
|
138
|
+
|
139
|
+
capture pattern, node
|
136
140
|
end
|
137
141
|
|
138
142
|
# Search recursively into a node and its children.
|
data/lib/fast/version.rb
CHANGED