deputy 0.1.25 → 0.1.26
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 +2 -4
- data/spec/deputy_spec.rb +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.26
|
data/deputy.gemspec
CHANGED
data/lib/deputy.rb
CHANGED
@@ -114,10 +114,8 @@ module Deputy
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def self.send_report(metric, value)
|
117
|
-
|
118
|
-
|
119
|
-
metric = metric.map{|m| m.gsub(/[^-_a-zA-Z]/, '_') } * '.'
|
120
|
-
get "/report/#{metric}?value=#{CGI.escape value.to_s}"
|
117
|
+
raise "separate #{metric} with a ." unless metric.split('.',2).size == 2
|
118
|
+
get "/report/#{CGI.escape metric}?value=#{CGI.escape value.to_s}"
|
121
119
|
end
|
122
120
|
|
123
121
|
def self.get(path)
|
data/spec/deputy_spec.rb
CHANGED
@@ -158,8 +158,8 @@ describe Deputy do
|
|
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/
|
162
|
-
Deputy.send_report('
|
161
|
+
FakeWeb.register_uri(:get, "http://sheri.ff/report/Xxx.yy%3Fy?value=123", :body => 'OK')
|
162
|
+
Deputy.send_report('Xxx.yy?y', '123').should == 'OK'
|
163
163
|
end
|
164
164
|
end
|
165
165
|
end
|