lookout-rack-utils 3.0.1 → 3.0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: db72693578924f13da2177083a08a610d8e75424
4
- data.tar.gz: 7acd4d977633e0fb36ce04a2d5815dee6f22cc9f
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjU0ZmVkMThlN2IxNThhZjY4YzNjMTc2NmI2ZWJlM2ZjODMzNWQxYg==
5
+ data.tar.gz: !binary |-
6
+ Y2JkNmUzZjY5Y2Q5MTRhMmYyOWM2ZjdjNTRiOGM0ZGI1MDk3ZmY1Yw==
5
7
  SHA512:
6
- metadata.gz: c8f5c305114d993fd14642e12e5e3a4f190e7dc2f19e71c7df81d41ab0fd42d140d062696388dab51129d6c688edb2bde5e9fe860ae49022cabeee0f666dc836
7
- data.tar.gz: 795c648c9798c0e146d5a99567918e9183a82358ecbe2c416a17e9d5802f9e0e9efbb302b055f0cb89e22ba8cef825902b399a75c7590bdda129111360fc8957
8
+ metadata.gz: !binary |-
9
+ NTcwODkzN2ZkOGI4YTg0NDIxZTM3MjQzOGNkNjI0OGEyMjc4ODJmMjFiNWFi
10
+ NGQzY2FkN2M0OWJmNDNmZGQ3MDgwYjJhMTlhY2M5YmY5MzAzOTlhYTY2YTYz
11
+ NTg1ZDQwMzFjOTMyNzQ3N2VhNTIyNzg0MTBmYWJiMDBlMjAyMDY=
12
+ data.tar.gz: !binary |-
13
+ MDdkOTczM2VmNjBiNWU2MGM4ZTNhYWRhMzgyMmY5N2RmYzFiZjk0MGIzODRm
14
+ N2QzNTBmMzA3MmVlMTljMDAzNzYyMDdmYmFkN2NhY2JjNzNjNjlkYjJhZWQx
15
+ MjU5MGZkNzQ3MjhhYWIyYmQ0Mjg2OTRiZWU3YWIxYWVkM2Q1OTM=
data/.travis.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - jruby
4
- ruby-2.1.2
5
- script: bundle exec rake
3
+ - jruby
4
+ - 2.1
5
+ - 1.9.3
6
+ deploy:
7
+ provider: rubygems
8
+ api_key:
9
+ secure: NFwSWoM9SqI1oshwmmf/4HB+0+tKL/r4mS4NIhfLqC55V7IhJ97wLqKj0LiyGFtgEpW+mMEv246mO8YH9KggQzHQbqDjUHjyU3CwBaHbV3xRuXwCfPGs6hw1xFg80bTKmi1S0yRy2VzoJml4UYxr8SpYVoCbauAMdXSJGRAu7p8=
@@ -2,6 +2,8 @@ require 'singleton'
2
2
  require 'configatron'
3
3
  require 'statsd'
4
4
 
5
+ require 'lookout/rack/utils'
6
+
5
7
  module Lookout::Rack::Utils
6
8
  # Statsd proxy. This class initializes the Statsd client and
7
9
  # delegates all stats related calls to it.
@@ -5,7 +5,7 @@ require 'lookout/rack/utils/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "lookout-rack-utils"
8
- spec.version = Lookout::Rack::Utils::VERSION
8
+ spec.version = [Lookout::Rack::Utils::VERSION, ENV['TRAVIS_BUILD_NUMBER'] || 'dev'].join('.')
9
9
  spec.authors = ["Ian Smith"]
10
10
  spec.email = ["ian.smith@lookout.com"]
11
11
  spec.description = %q{A collection of rack utils.}
data/spec/log_spec.rb CHANGED
@@ -5,6 +5,7 @@ require 'configatron'
5
5
 
6
6
  describe Lookout::Rack::Utils::Log do
7
7
  subject(:log) { described_class.instance }
8
+ subject(:log_message) { 'foo' }
8
9
 
9
10
  before :all do
10
11
  configatron.logging.enabled = true
@@ -18,78 +19,50 @@ describe Lookout::Rack::Utils::Log do
18
19
 
19
20
  it 'should not log a graphite stat' do
20
21
  Lookout::Rack::Utils::Graphite.should_not_receive(:increment).with('log.debug')
21
- log.debug 'foo'
22
+ log.debug log_message
22
23
  end
23
24
  end
24
25
 
25
26
  it 'should log a graphite stat' do
26
27
  Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.debug')
27
- log.debug 'foo'
28
+ log.debug log_message
28
29
  end
29
30
  end
30
31
 
31
- describe '.debug' do
32
- it 'should log a graphite stat' do
33
- Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.debug')
34
- log.debug 'foo'
35
- end
36
- end
37
-
38
- describe '.info' do
39
- it 'should log a graphite stat' do
40
- Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.info')
41
- log.info 'foo'
42
- end
43
- end
44
-
45
- describe '.warn' do
46
- it 'should log a graphite stat' do
47
- Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.warn')
48
- log.warn 'foo'
49
- end
50
- end
51
-
52
- describe '.error' do
53
- it 'should log a graphite stat' do
54
- Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.error')
55
- log.error 'foo'
56
- end
57
- end
32
+ [:debug, :info, :warn, :error, :fatal].each do |method|
33
+ describe ".#{method}" do
34
+ it 'should log a graphite stat' do
35
+ Lookout::Rack::Utils::Graphite.should_receive(:increment).with("log.#{method}")
58
36
 
59
- describe '.fatal' do
60
- it 'should log a graphite stat' do
61
- Lookout::Rack::Utils::Graphite.should_receive(:increment).with('log.fatal')
62
- log.fatal 'foo'
63
- end
64
- end
37
+ log.instance_variable_get(:@logger).should_receive(method).with(log_message).and_call_original
65
38
 
66
- describe '.debug?' do
67
- it 'returns true when level is debug' do
68
- expect(log.debug?).to eq(true)
69
- end
70
- end
39
+ processed = false
40
+ b = Proc.new { processed = true }
71
41
 
72
- describe '.info?' do
73
- it 'returns true when level is info' do
74
- expect(log.info?).to eq(true)
75
- end
76
- end
42
+ log.send(method, log_message, &b)
43
+ expect(processed).to be(true)
44
+ end
77
45
 
78
- describe '.warn?' do
79
- it 'returns true when level is warn' do
80
- expect(log.warn?).to eq(true)
81
- end
82
- end
46
+ it 'should invoke the internal logger object with a given block' do
47
+ log.instance_variable_get(:@logger).should_receive(method).with(log_message).and_call_original
48
+ processed = false
49
+ b = Proc.new { processed = true }
50
+ log.send(method, log_message, &b)
51
+ expect(processed).to be(true)
52
+ end
83
53
 
84
- describe '.error?' do
85
- it 'returns true when level is error' do
86
- expect(log.error?).to eq(true)
54
+ it 'should invoke the internal logger object w/o a given block' do
55
+ log.instance_variable_get(:@logger).should_receive(method).with(log_message).and_call_original
56
+ log.send(method, log_message)
57
+ end
87
58
  end
88
59
  end
89
60
 
90
- describe '.fatal?' do
91
- it 'returns true when level is fatal' do
92
- expect(log.fatal?).to eq(true)
61
+ [:debug?, :info?, :warn?, :error?, :fatal?].each do |method|
62
+ describe ".#{method}" do
63
+ it 'returns true when level is debug' do
64
+ expect(log.send(method)).to eq(true)
65
+ end
93
66
  end
94
67
  end
95
68
  end
@@ -106,8 +79,8 @@ describe Lookout::Rack::Utils::Log::LookoutFormatter do
106
79
  let(:basedir) { "/home/rspec/#{project_name}" }
107
80
  let(:tracer) do
108
81
  [
109
- "#{basedir}/log.rb:63:in `warn'",
110
- "#{basedir}/spec/log_spec.rb:9:in `block (2 levels) in <top (required)>'"
82
+ "#{basedir}/log.rb:63:in `warn'",
83
+ "#{basedir}/spec/log_spec.rb:9:in `block (2 levels) in <top (required)>'"
111
84
  ]
112
85
  end
113
86
 
metadata CHANGED
@@ -1,195 +1,195 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-rack-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Smith
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: bundler
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ~>
17
18
  - !ruby/object:Gem::Version
18
19
  version: '1.3'
19
- name: bundler
20
- prerelease: false
21
20
  type: :development
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: rake
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - '>='
31
+ - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: rake
34
- prerelease: false
35
34
  type: :development
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
+ name: rspec
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - ~>
45
46
  - !ruby/object:Gem::Version
46
47
  version: '2.0'
47
- name: rspec
48
- prerelease: false
49
48
  type: :development
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
+ name: rspec-its
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
- - - '>='
59
+ - - ! '>='
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
- name: rspec-its
62
- prerelease: false
63
62
  type: :development
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
+ name: rack-test
70
71
  requirement: !ruby/object:Gem::Requirement
71
72
  requirements:
72
- - - '>='
73
+ - - ! '>='
73
74
  - !ruby/object:Gem::Version
74
75
  version: '0'
75
- name: rack-test
76
- prerelease: false
77
76
  type: :development
77
+ prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
+ name: sinatra
84
85
  requirement: !ruby/object:Gem::Requirement
85
86
  requirements:
86
- - - '>='
87
+ - - ! '>='
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
- name: sinatra
90
- prerelease: false
91
90
  type: :development
91
+ prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
+ name: timecop
98
99
  requirement: !ruby/object:Gem::Requirement
99
100
  requirements:
100
- - - '>='
101
+ - - ! '>='
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
- name: timecop
104
- prerelease: false
105
104
  type: :development
105
+ prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
+ name: i18n
112
113
  requirement: !ruby/object:Gem::Requirement
113
114
  requirements:
114
- - - '>='
115
+ - - ! '>='
115
116
  - !ruby/object:Gem::Version
116
117
  version: '0'
117
- name: i18n
118
- prerelease: false
119
118
  type: :runtime
119
+ prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
+ name: rack
126
127
  requirement: !ruby/object:Gem::Requirement
127
128
  requirements:
128
129
  - - ~>
129
130
  - !ruby/object:Gem::Version
130
131
  version: 1.5.0
131
- name: rack
132
- prerelease: false
133
132
  type: :runtime
133
+ prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.5.0
139
139
  - !ruby/object:Gem::Dependency
140
+ name: rack-graphite
140
141
  requirement: !ruby/object:Gem::Requirement
141
142
  requirements:
142
143
  - - ~>
143
144
  - !ruby/object:Gem::Version
144
145
  version: '1.1'
145
- name: rack-graphite
146
- prerelease: false
147
146
  type: :runtime
147
+ prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.1'
153
153
  - !ruby/object:Gem::Dependency
154
+ name: configatron
154
155
  requirement: !ruby/object:Gem::Requirement
155
156
  requirements:
156
157
  - - ~>
157
158
  - !ruby/object:Gem::Version
158
159
  version: '2.13'
159
- name: configatron
160
- prerelease: false
161
160
  type: :runtime
161
+ prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: '2.13'
167
167
  - !ruby/object:Gem::Dependency
168
+ name: log4r
168
169
  requirement: !ruby/object:Gem::Requirement
169
170
  requirements:
170
- - - '>='
171
+ - - ! '>='
171
172
  - !ruby/object:Gem::Version
172
173
  version: '0'
173
- name: log4r
174
- prerelease: false
175
174
  type: :runtime
175
+ prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ! '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
+ name: lookout-statsd
182
183
  requirement: !ruby/object:Gem::Requirement
183
184
  requirements:
184
- - - '>='
185
+ - - ! '>='
185
186
  - !ruby/object:Gem::Version
186
187
  version: '0.7'
187
- name: lookout-statsd
188
- prerelease: false
189
188
  type: :runtime
189
+ prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - '>='
192
+ - - ! '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.7'
195
195
  description: A collection of rack utils.
@@ -224,24 +224,24 @@ homepage: ''
224
224
  licenses:
225
225
  - MIT
226
226
  metadata: {}
227
- post_install_message:
227
+ post_install_message:
228
228
  rdoc_options: []
229
229
  require_paths:
230
230
  - lib
231
231
  required_ruby_version: !ruby/object:Gem::Requirement
232
232
  requirements:
233
- - - '>='
233
+ - - ! '>='
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  requirements:
238
- - - '>='
238
+ - - ! '>='
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
241
  requirements: []
242
- rubyforge_project:
242
+ rubyforge_project:
243
243
  rubygems_version: 2.4.5
244
- signing_key:
244
+ signing_key:
245
245
  specification_version: 4
246
246
  summary: ''
247
247
  test_files: