lograge 0.1.0 → 0.1.1
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/lib/lograge/log_subscriber.rb +1 -1
- data/lib/lograge/version.rb +1 -1
- data/spec/lograge_logsubscriber_spec.rb +7 -7
- metadata +2 -2
@@ -30,7 +30,7 @@ module Lograge
|
|
30
30
|
# a single quote
|
31
31
|
data[key] = "'#{data[key]}'" if key == :error
|
32
32
|
# Ensure that we always have exactly two decimals
|
33
|
-
data[key] = "%.2f" % data[key] if data[key].is_a?
|
33
|
+
data[key] = "%.2f" % data[key] if data[key].is_a? Float
|
34
34
|
|
35
35
|
message << "#{key}=#{data[key]}"
|
36
36
|
message
|
data/lib/lograge/version.rb
CHANGED
@@ -47,12 +47,12 @@ describe Lograge::RequestLogSubscriber do
|
|
47
47
|
|
48
48
|
it "should start the log line with the HTTP method" do
|
49
49
|
subscriber.process_action(event)
|
50
|
-
log_output.string.starts_with?('method=GET').should == true
|
50
|
+
log_output.string.starts_with?('method=GET ').should == true
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should include the status code" do
|
54
54
|
subscriber.process_action(event)
|
55
|
-
log_output.string.should include('status=200')
|
55
|
+
log_output.string.should include('status=200 ')
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should include the controller and action" do
|
@@ -62,12 +62,12 @@ describe Lograge::RequestLogSubscriber do
|
|
62
62
|
|
63
63
|
it "should include the duration" do
|
64
64
|
subscriber.process_action(event)
|
65
|
-
log_output.string.should =~ /duration=[\.0-9]{4,4}/
|
65
|
+
log_output.string.should =~ /duration=[\.0-9]{4,4} /
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should include the view rendering time" do
|
69
69
|
subscriber.process_action(event)
|
70
|
-
log_output.string.should =~ /view=0.01/
|
70
|
+
log_output.string.should =~ /view=0.01 /
|
71
71
|
end
|
72
72
|
|
73
73
|
it "should include the database rendering time" do
|
@@ -79,15 +79,15 @@ describe Lograge::RequestLogSubscriber do
|
|
79
79
|
event.payload[:status] = nil
|
80
80
|
event.payload[:exception] = ['AbstractController::ActionNotFound', 'Route not found']
|
81
81
|
subscriber.process_action(event)
|
82
|
-
log_output.string.should =~ /status=500/
|
83
|
-
log_output.string.should =~ /error='AbstractController::ActionNotFound:Route not found'/
|
82
|
+
log_output.string.should =~ /status=500 /
|
83
|
+
log_output.string.should =~ /error='AbstractController::ActionNotFound:Route not found' /
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should return an unknown status when no status or exception is found" do
|
87
87
|
event.payload[:status] = nil
|
88
88
|
event.payload[:exception] = nil
|
89
89
|
subscriber.process_action(event)
|
90
|
-
log_output.string.should =~ /status=0/
|
90
|
+
log_output.string.should =~ /status=0 /
|
91
91
|
end
|
92
92
|
|
93
93
|
describe "with a redirect" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lograge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|