hotdog 0.22.0 → 0.22.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a119b57eb88edbf96274e510fccff8dac8cec163
|
4
|
+
data.tar.gz: 97cb6d850508a644026ef397928f90391938f8de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b4c12bc02f80a836ab9c7635258f0fe4be78942b6f390675092500ccc10c5549075792ea7b6045e3da0a84f0274f75dd8378eade4800a1b55649e3e6d4dcc39
|
7
|
+
data.tar.gz: eccae2d625eb64c21c8d703e505c7e02457106f687c17d7cc05860908c3bd527f65045975eaa3aeb2fce0dcbd37e8aeda9a2a0227a225cdf093eb6dc47223e54
|
data/lib/hotdog/expression.rb
CHANGED
@@ -81,7 +81,7 @@ module Hotdog
|
|
81
81
|
if "/host/" == tag_name_regexp
|
82
82
|
EverythingNode.new()
|
83
83
|
else
|
84
|
-
|
84
|
+
RegexpHostOrTagNode.new(tag_name_regexp)
|
85
85
|
end
|
86
86
|
}
|
87
87
|
rule(tag_name_glob: simple(:tag_name_glob), separator: simple(:separator), tag_value_glob: simple(:tag_value_glob)) {
|
@@ -109,7 +109,7 @@ module Hotdog
|
|
109
109
|
if "host" == tag_name_glob
|
110
110
|
EverythingNode.new()
|
111
111
|
else
|
112
|
-
|
112
|
+
GlobHostOrTagNode.new(tag_name_glob)
|
113
113
|
end
|
114
114
|
}
|
115
115
|
rule(tag_name: simple(:tag_name), separator: simple(:separator), tag_value_glob: simple(:tag_value_glob)) {
|
@@ -137,7 +137,7 @@ module Hotdog
|
|
137
137
|
if "host" == tag_name
|
138
138
|
EverythingNode.new()
|
139
139
|
else
|
140
|
-
|
140
|
+
StringHostOrTagNode.new(tag_name)
|
141
141
|
end
|
142
142
|
}
|
143
143
|
rule(separator: simple(:separator), tag_value_regexp: simple(:tag_value_regexp)) {
|
@@ -830,7 +830,7 @@ module Hotdog
|
|
830
830
|
end
|
831
831
|
end
|
832
832
|
|
833
|
-
class
|
833
|
+
class StringHostOrTagNode < StringExpressionNode
|
834
834
|
def initialize(tag_name, separator=nil)
|
835
835
|
super(tag_name.to_s, nil, separator)
|
836
836
|
end
|
@@ -848,7 +848,7 @@ module Hotdog
|
|
848
848
|
end
|
849
849
|
|
850
850
|
def maybe_fallback(options={})
|
851
|
-
fallback =
|
851
|
+
fallback = GlobHostOrTagNode.new(to_glob(tag_name), separator)
|
852
852
|
query = fallback.maybe_query(options)
|
853
853
|
if query
|
854
854
|
QueryExpressionNode.new(query, fallback.condition_values(options))
|
@@ -981,7 +981,7 @@ module Hotdog
|
|
981
981
|
end
|
982
982
|
end
|
983
983
|
|
984
|
-
class
|
984
|
+
class GlobHostOrTagNode < GlobExpressionNode
|
985
985
|
def initialize(tag_name, separator=nil)
|
986
986
|
super(tag_name.to_s, nil, separator)
|
987
987
|
end
|
@@ -999,7 +999,7 @@ module Hotdog
|
|
999
999
|
end
|
1000
1000
|
|
1001
1001
|
def maybe_fallback(options={})
|
1002
|
-
fallback =
|
1002
|
+
fallback = GlobHostOrTagNode.new(to_glob(tag_name), separator)
|
1003
1003
|
query = fallback.maybe_query(options)
|
1004
1004
|
if query
|
1005
1005
|
QueryExpressionNode.new(query, fallback.condition_values(options))
|
@@ -1112,7 +1112,7 @@ module Hotdog
|
|
1112
1112
|
end
|
1113
1113
|
end
|
1114
1114
|
|
1115
|
-
class
|
1115
|
+
class RegexpHostOrTagNode < RegexpExpressionNode
|
1116
1116
|
def initialize(tag_name, separator=nil)
|
1117
1117
|
super(tag_name, separator)
|
1118
1118
|
end
|
data/lib/hotdog/version.rb
CHANGED
@@ -51,7 +51,7 @@ describe "tag glob expression" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "interprets tag glob with tag_name without separator" do
|
54
|
-
expr = Hotdog::Expression::
|
54
|
+
expr = Hotdog::Expression::GlobHostOrTagNode.new("foo*", nil)
|
55
55
|
q = [
|
56
56
|
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
|
57
57
|
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
|
@@ -51,7 +51,7 @@ describe "tag regexp expression" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "interprets tag regexp with tag_name without separator" do
|
54
|
-
expr = Hotdog::Expression::
|
54
|
+
expr = Hotdog::Expression::RegexpHostOrTagNode.new("foo", nil)
|
55
55
|
q = [
|
56
56
|
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
|
57
57
|
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
|
@@ -51,7 +51,7 @@ describe "tag expression" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "interprets tag with tag_name without separator" do
|
54
|
-
expr = Hotdog::Expression::
|
54
|
+
expr = Hotdog::Expression::StringHostOrTagNode.new("foo", nil)
|
55
55
|
q = [
|
56
56
|
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
|
57
57
|
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
|