piece 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/piece/pieces.rb +8 -8
- data/lib/piece/version.rb +1 -1
- 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: 289a5f8c1c137ad1391abf6d9087ef97a4ae67f7
|
4
|
+
data.tar.gz: 405dedb61e347a8f317b72235b34b4fc80f3e18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2501af98f9d4e3a29ae02cd6dee95df081d2705311a48e8e9b524e406399260d80936422813c9b118161ec3a8ce70cd6469e100b330b9b3a21d8fd757233bcc
|
7
|
+
data.tar.gz: 05d2ec120b5289e5886e6824770b0062b78903549fd9283b42ce114eeeea60180a99d750772cfea3660936a32590586b6e60ba0aece8746480de4e1492e5bb78
|
data/lib/piece/pieces.rb
CHANGED
@@ -35,13 +35,13 @@ module Piece
|
|
35
35
|
raise "Unknown operator: #{group.op}"
|
36
36
|
end
|
37
37
|
when ExpressionParser::Id
|
38
|
-
|
39
|
-
|
40
|
-
if @data.has_key?(group)
|
41
|
-
get(@data[group], keys)
|
38
|
+
if @data.has_key?(group.val)
|
39
|
+
get(@data[group.val], keys)
|
42
40
|
else
|
43
|
-
|
41
|
+
get(group, keys)
|
44
42
|
end
|
43
|
+
else
|
44
|
+
raise "Unknown type: #{group.inspect}"
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -54,12 +54,12 @@ module Piece
|
|
54
54
|
get(data.first, keys) || get(data[1..-1], keys)
|
55
55
|
when NilClass
|
56
56
|
nil
|
57
|
-
when ExpressionParser::Exp
|
58
|
-
apply(data, keys)
|
59
57
|
when ExpressionParser::Id
|
60
58
|
match?(data.val, keys.first) ? '*' : nil
|
59
|
+
when String
|
60
|
+
apply(ExpressionParser.new.parse(data), keys)
|
61
61
|
else
|
62
|
-
|
62
|
+
raise "Unknown type: #{group.inspect}"
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
data/lib/piece/version.rb
CHANGED