deputy 0.1.55 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/deputy.gemspec +1 -1
- data/lib/deputy.rb +5 -1
- data/spec/deputy_spec.rb +7 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.56
|
data/deputy.gemspec
CHANGED
data/lib/deputy.rb
CHANGED
@@ -5,7 +5,11 @@ require "socket"
|
|
5
5
|
|
6
6
|
def eval_and_fetch_constants(x)
|
7
7
|
old = Module.constants.map{|c| c.to_s}
|
8
|
-
|
8
|
+
begin
|
9
|
+
eval(x)
|
10
|
+
rescue Exception => e
|
11
|
+
raise e unless Deputy.config['silent_on_errors']
|
12
|
+
end
|
9
13
|
new = (Module.constants.map{|c| c.to_s} - old)
|
10
14
|
new = new.select{|c| c.to_s =~ /^TEMP/ } # do not fetch required libs, just user-defined
|
11
15
|
new.map{|c| const_get(c) }
|
data/spec/deputy_spec.rb
CHANGED
@@ -237,11 +237,17 @@ describe Deputy do
|
|
237
237
|
FakeWeb.register_uri(:get, "http://sheri.ff/notify?group=Xxx.yy%3Fy&value=123&hostname=general&forced_host=true", :body => 'OK')
|
238
238
|
Deputy.send_report('Xxx.yy?y', '123', {:host => 'general'}).should == 'OK'
|
239
239
|
end
|
240
|
-
|
240
|
+
|
241
241
|
it "does nothing, if disabled" do
|
242
242
|
Deputy.stub!(:config).and_return "disabled" => true
|
243
243
|
Deputy.send_report('Xxx.yy?y', '123', {:host => 'general'}).should == nil
|
244
244
|
end
|
245
|
+
|
246
|
+
it "does not reraise if silent_on_errors configured" do
|
247
|
+
Deputy.config['silent_on_errors'] = true
|
248
|
+
FakeWeb.register_uri(:get, "http://sheri.ff/notify?group=Xxx.yy%3Fy&value=123&hostname=general&forced_host=true", :body => 'ERROR', :status => ["500", "Internal Server Error"])
|
249
|
+
Deputy.send_report('Xxx.yy?y', '123', {:host => 'general'}).should == nil
|
250
|
+
end
|
245
251
|
end
|
246
252
|
|
247
253
|
describe :extract_auth_from_url! do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deputy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 107
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 56
|
10
|
+
version: 0.1.56
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|