deputy 0.1.26 → 0.1.27
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/deputy.gemspec +1 -1
- data/lib/deputy.rb +3 -3
- data/spec/deputy_spec.rb +3 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.27
|
data/deputy.gemspec
CHANGED
data/lib/deputy.rb
CHANGED
@@ -113,9 +113,9 @@ module Deputy
|
|
113
113
|
raise e
|
114
114
|
end
|
115
115
|
|
116
|
-
def self.send_report(
|
117
|
-
raise "separate #{
|
118
|
-
get "/report
|
116
|
+
def self.send_report(group, value)
|
117
|
+
raise "separate #{group} with a ." unless group.split('.',2).size == 2
|
118
|
+
get "/report?group=#{CGI.escape group}&value=#{CGI.escape value.to_s}"
|
119
119
|
end
|
120
120
|
|
121
121
|
def self.get(path)
|
data/spec/deputy_spec.rb
CHANGED
@@ -143,7 +143,7 @@ describe Deputy do
|
|
143
143
|
$notify = 0
|
144
144
|
Deputy.stub!(:sheriff_url).and_return 'http://sheri.ff'
|
145
145
|
FakeWeb.register_uri(:get, "http://sheri.ff/plugins.rb", :body => klass('C', :code => '$notify=1'))
|
146
|
-
FakeWeb.register_uri(:get, "http://sheri.ff/report
|
146
|
+
FakeWeb.register_uri(:get, "http://sheri.ff/report?group=Deputies.finished&value=1", :body => 'OK')
|
147
147
|
Deputy.run_plugins
|
148
148
|
$notify.should == 1
|
149
149
|
end
|
@@ -152,13 +152,13 @@ describe Deputy do
|
|
152
152
|
describe :send_report do
|
153
153
|
it "sends a report" do
|
154
154
|
Deputy.stub!(:sheriff_url).and_return 'http://sheri.ff'
|
155
|
-
FakeWeb.register_uri(:get, "http://sheri.ff/report
|
155
|
+
FakeWeb.register_uri(:get, "http://sheri.ff/report?group=Xxx.yyy&value=123", :body => 'OK')
|
156
156
|
Deputy.send_report('Xxx.yyy', '123').should == 'OK'
|
157
157
|
end
|
158
158
|
|
159
159
|
it "escapes metric names" do
|
160
160
|
Deputy.stub!(:sheriff_url).and_return 'http://sheri.ff'
|
161
|
-
FakeWeb.register_uri(:get, "http://sheri.ff/report
|
161
|
+
FakeWeb.register_uri(:get, "http://sheri.ff/report?group=Xxx.yy%3Fy&value=123", :body => 'OK')
|
162
162
|
Deputy.send_report('Xxx.yy?y', '123').should == 'OK'
|
163
163
|
end
|
164
164
|
end
|