crashdesk 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/crashdesk/configuration.rb +3 -1
- data/lib/crashdesk/reporters/logger.rb +1 -1
- data/lib/crashdesk/reporters/screen.rb +1 -1
- data/lib/crashdesk/reporters/stderr.rb +1 -1
- data/lib/crashdesk/reporters/test.rb +2 -1
- data/lib/crashdesk/version.rb +1 -1
- data/lib/crashdesk.rb +1 -0
- data/spec/configuration_spec.rb +4 -4
- data/spec/report_manager_spec.rb +3 -7
- metadata +1 -1
@@ -19,12 +19,13 @@ module Crashdesk
|
|
19
19
|
# Crashdesk.configure do |config|
|
20
20
|
# config.app_key = 'YOUR APP KEY HERE'
|
21
21
|
# config.project_root = ::Rails.root
|
22
|
-
# config.environment_name = ::Rails.env
|
23
22
|
# config.logger = ::Rails.logger
|
24
23
|
# end
|
25
24
|
#
|
26
25
|
attr_accessor :environment_name, :project_root
|
27
26
|
|
27
|
+
attr_accessor :reporters
|
28
|
+
|
28
29
|
def initialize
|
29
30
|
@host = 'beta.crashde.sk'
|
30
31
|
end
|
@@ -45,6 +46,7 @@ module Crashdesk
|
|
45
46
|
def reporters
|
46
47
|
reporters = [:remote]
|
47
48
|
reporters << :logger if logger
|
49
|
+
reporters
|
48
50
|
end
|
49
51
|
|
50
52
|
private
|
data/lib/crashdesk/version.rb
CHANGED
data/lib/crashdesk.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -8,13 +8,13 @@ describe Crashdesk::Configuration do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "point to crashdes.sk host" do
|
11
|
-
@config[:host].should == 'crashde.sk'
|
12
|
-
@config.host.should == 'crashde.sk'
|
11
|
+
@config[:host].should == 'beta.crashde.sk'
|
12
|
+
@config.host.should == 'beta.crashde.sk'
|
13
13
|
end
|
14
14
|
|
15
15
|
it "port is 80" do
|
16
|
-
@config[:port].should ==
|
17
|
-
@config.port.should ==
|
16
|
+
@config[:port].should == 9292
|
17
|
+
@config.port.should == 9292
|
18
18
|
end
|
19
19
|
|
20
20
|
it "protocol is HTTP" do
|
data/spec/report_manager_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'crashdesk/reporters/test'
|
2
3
|
|
3
4
|
describe Crashdesk::ReportManager do
|
4
5
|
|
@@ -9,11 +10,6 @@ describe Crashdesk::ReportManager do
|
|
9
10
|
{:name => 1, :string => 2}
|
10
11
|
end
|
11
12
|
end
|
12
|
-
class ::Crashdesk::Reporters::Echo
|
13
|
-
def run(crashlog)
|
14
|
-
crashlog.to_hash
|
15
|
-
end
|
16
|
-
end
|
17
13
|
end
|
18
14
|
|
19
15
|
before do
|
@@ -28,13 +24,13 @@ describe Crashdesk::ReportManager do
|
|
28
24
|
end
|
29
25
|
|
30
26
|
it "and with Foo logger should return echo and also with logger call PP" do
|
31
|
-
@report_manager = Crashdesk::ReportManager.new([:logger, :
|
27
|
+
@report_manager = Crashdesk::ReportManager.new([:logger, :test])
|
32
28
|
PP.should_receive(:pp).with(name: 1, string: 2)
|
33
29
|
@report_manager.process(@crashlog).should eq([nil, {name:1,string:2}])
|
34
30
|
end
|
35
31
|
|
36
32
|
it "must accept also constants as argument" do
|
37
|
-
@report_manager = Crashdesk::ReportManager.new([:logger, ::Crashdesk::Reporters::
|
33
|
+
@report_manager = Crashdesk::ReportManager.new([:logger, ::Crashdesk::Reporters::Test.new])
|
38
34
|
PP.should_receive(:pp).with(name: 1, string: 2)
|
39
35
|
@report_manager.process(@crashlog).should eq([nil, {name:1,string:2}])
|
40
36
|
end
|