lookout-rack-utils 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 6366dda584cb48d5eef7c2e9abc6bfeb1e932fc1
4
- data.tar.gz: fb3d7e2240ecc8f1bea64741c06a4abaa17e2131
5
- SHA512:
6
- metadata.gz: 11f169441f381f726c248cfa1e251aaf9b5dd77fdc7c7467d0eec8978ad14d0a4f3af154b7cad246db40efd2c477cdc29444684bb1b011fd72c55e6ae717ce1f
7
- data.tar.gz: dad64c23723a0863390c8057ac2dce9b1fe5adf1f136f98c014334fea045781d5f529729d0eab58695331604f772a57a56ff921f33e061c5ee3cf44e76ccc83c
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9f3b2a5e50ce9ca1c8cb0c42e9f16a31fd4ea582
4
+ data.tar.gz: b695c5ae71b3f5f8c304f332a2d3966e441cc468
5
+ SHA512:
6
+ metadata.gz: a3ae0140b825564a74064630a2c2893d184c693e6a4faf8c2eebf6854316f0384153b963989f3474bcf4cc02efbe591c7fe5f9eb363f331b22fd08c447143e82
7
+ data.tar.gz: 459f824235b9998564cccfd1ff75f80ae14bd6194d2d290da53f4327316a58552757f1b23c4c7fd27213003e6219ac1cd840639434084c4eea2fda83fe0bd20b
data/README.md CHANGED
@@ -76,9 +76,9 @@ path; the result can then be used, or just returned immediately to the browser.
76
76
  include Lookout::Rack::Utils::Subroute
77
77
 
78
78
  # Return the status of a request to /api/public/v1/original_route and throw
79
- # away the response body
79
+ # away the headers and response body
80
80
  get '/status' do
81
- sub_status, sub_data = subroute!('/api/public/v1/original_route')
81
+ sub_status, sub_headers, sub_data = subroute!('/api/public/v1/original_route')
82
82
 
83
83
  halt sub_status
84
84
  end
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'log4r'
3
3
  require 'singleton'
4
- require 'rack/requestash/log4r'
5
4
  require 'time'
6
5
  require 'configatron'
7
6
 
@@ -84,10 +83,6 @@ module Lookout::Rack::Utils
84
83
  :trunc => false})
85
84
  @logger.trace = true
86
85
  @outputter.formatter = LookoutFormatter
87
-
88
- if ENV['RACK_ENV'] == 'production'
89
- @outputter.formatter = Rack::Requestash::Log4r::Formatter
90
- end
91
86
  @logger.outputters = @outputter
92
87
  end
93
88
 
@@ -1,7 +1,7 @@
1
1
  module Lookout
2
2
  module Rack
3
3
  module Utils
4
- VERSION = "2.0.0"
4
+ VERSION = "3.0.0"
5
5
  end
6
6
  end
7
7
  end
@@ -20,17 +20,17 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency "rspec", "~> 2.0"
24
+ spec.add_development_dependency "rspec-its"
24
25
  spec.add_development_dependency "rack-test"
25
26
  spec.add_development_dependency "sinatra"
26
27
  spec.add_development_dependency "timecop"
27
28
 
28
29
  spec.add_runtime_dependency "i18n"
29
30
 
30
- spec.add_dependency "rack", '>= 1.5.0'
31
+ spec.add_dependency "rack", '~> 1.5.0'
31
32
  spec.add_dependency "rack-graphite", '~> 1.1'
32
- spec.add_dependency "rack-requestash"
33
33
  spec.add_dependency "configatron", '~> 2.13'
34
34
  spec.add_dependency "log4r"
35
- spec.add_dependency "lookout-statsd", '>= 0.7.0'
35
+ spec.add_dependency "lookout-statsd", '>= 0.7'
36
36
  end
@@ -3,6 +3,7 @@ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib/')
3
3
  require 'lookout/rack/utils'
4
4
 
5
5
  require 'rspec'
6
+ require 'rspec/its'
6
7
 
7
8
  require 'rack/test'
8
9
 
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'json'
2
3
 
3
4
  describe Lookout::Rack::Utils::Subroute, :type => :route do
4
5
  describe '#subroute' do
@@ -84,7 +85,7 @@ describe Lookout::Rack::Utils::Subroute, :type => :route do
84
85
  its(:status) { should be 201 }
85
86
 
86
87
  it 'should return expected output' do
87
- expect(JSON.parse(subrouted.body)['deleted']).to be_true
88
+ expect(JSON.parse(subrouted.body)['deleted']).to be true
88
89
  end
89
90
  end
90
91
 
@@ -120,17 +121,17 @@ describe Lookout::Rack::Utils::Subroute, :type => :route do
120
121
  subject { SubrouteTestHelper.new.succeeded?(status) }
121
122
  context 'with status 200' do
122
123
  let(:status) { 200 }
123
- it { should be_true }
124
+ it { should be true }
124
125
  end
125
126
 
126
127
  context 'with status 299' do
127
128
  let(:status) { 299 }
128
- it { should be_true }
129
+ it { should be true }
129
130
  end
130
131
 
131
132
  context 'with a non-20x status' do
132
133
  let(:status) { 300 }
133
- it { should be_false }
134
+ it { should be false }
134
135
  end
135
136
  end
136
137
 
@@ -138,17 +139,17 @@ describe Lookout::Rack::Utils::Subroute, :type => :route do
138
139
  subject { SubrouteTestHelper.new.failed?(status) }
139
140
  context 'with status 200' do
140
141
  let(:status) { 200 }
141
- it { should be_false }
142
+ it { should be false }
142
143
  end
143
144
 
144
145
  context 'with status 299' do
145
146
  let(:status) { 299 }
146
- it { should be_false }
147
+ it { should be false }
147
148
  end
148
149
 
149
150
  context 'with a non-20x status' do
150
151
  let(:status) { 300 }
151
- it { should be_true }
152
+ it { should be true }
152
153
  end
153
154
  end
154
155
  end
metadata CHANGED
@@ -1,143 +1,204 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: lookout-rack-utils
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Ian Smith
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2014-12-09 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: &id001 !ruby/object:Gem::Requirement
17
- requirements:
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
18
16
  - - ~>
19
- - !ruby/object:Gem::Version
20
- version: "1.3"
21
- type: :development
17
+ - !ruby/object:Gem::Version
18
+ version: '1.3'
19
+ name: bundler
22
20
  prerelease: false
23
- version_requirements: *id001
24
- - !ruby/object:Gem::Dependency
25
- name: rake
26
- requirement: &id002 !ruby/object:Gem::Requirement
27
- requirements:
28
- - &id003
29
- - ">="
30
- - !ruby/object:Gem::Version
31
- version: "0"
32
21
  type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ name: rake
33
34
  prerelease: false
34
- version_requirements: *id002
35
- - !ruby/object:Gem::Dependency
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
36
47
  name: rspec
37
- requirement: &id004 !ruby/object:Gem::Requirement
38
- requirements:
39
- - *id003
48
+ prerelease: false
40
49
  type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ name: rspec-its
41
62
  prerelease: false
42
- version_requirements: *id004
43
- - !ruby/object:Gem::Dependency
44
- name: rack-test
45
- requirement: &id005 !ruby/object:Gem::Requirement
46
- requirements:
47
- - *id003
48
63
  type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ name: rack-test
49
76
  prerelease: false
50
- version_requirements: *id005
51
- - !ruby/object:Gem::Dependency
52
- name: sinatra
53
- requirement: &id006 !ruby/object:Gem::Requirement
54
- requirements:
55
- - *id003
56
77
  type: :development
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ name: sinatra
57
90
  prerelease: false
58
- version_requirements: *id006
59
- - !ruby/object:Gem::Dependency
60
- name: timecop
61
- requirement: &id007 !ruby/object:Gem::Requirement
62
- requirements:
63
- - *id003
64
91
  type: :development
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ name: timecop
65
104
  prerelease: false
66
- version_requirements: *id007
67
- - !ruby/object:Gem::Dependency
105
+ type: :development
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
68
117
  name: i18n
69
- requirement: &id008 !ruby/object:Gem::Requirement
70
- requirements:
71
- - *id003
72
- type: :runtime
73
118
  prerelease: false
74
- version_requirements: *id008
75
- - !ruby/object:Gem::Dependency
76
- name: rack
77
- requirement: &id009 !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: 1.5.0
82
119
  type: :runtime
83
- prerelease: false
84
- version_requirements: *id009
85
- - !ruby/object:Gem::Dependency
86
- name: rack-graphite
87
- requirement: &id010 !ruby/object:Gem::Requirement
88
- requirements:
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
89
128
  - - ~>
90
- - !ruby/object:Gem::Version
91
- version: "1.1"
92
- type: :runtime
129
+ - !ruby/object:Gem::Version
130
+ version: 1.5.0
131
+ name: rack
93
132
  prerelease: false
94
- version_requirements: *id010
95
- - !ruby/object:Gem::Dependency
96
- name: rack-requestash
97
- requirement: &id011 !ruby/object:Gem::Requirement
98
- requirements:
99
- - *id003
100
133
  type: :runtime
101
- prerelease: false
102
- version_requirements: *id011
103
- - !ruby/object:Gem::Dependency
104
- name: configatron
105
- requirement: &id012 !ruby/object:Gem::Requirement
106
- requirements:
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
107
136
  - - ~>
108
- - !ruby/object:Gem::Version
109
- version: "2.13"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.5.0
139
+ - !ruby/object:Gem::Dependency
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ~>
143
+ - !ruby/object:Gem::Version
144
+ version: '1.1'
145
+ name: rack-graphite
146
+ prerelease: false
110
147
  type: :runtime
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '1.1'
153
+ - !ruby/object:Gem::Dependency
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ~>
157
+ - !ruby/object:Gem::Version
158
+ version: '2.13'
159
+ name: configatron
111
160
  prerelease: false
112
- version_requirements: *id012
113
- - !ruby/object:Gem::Dependency
114
- name: log4r
115
- requirement: &id013 !ruby/object:Gem::Requirement
116
- requirements:
117
- - *id003
118
161
  type: :runtime
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: '2.13'
167
+ - !ruby/object:Gem::Dependency
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ name: log4r
119
174
  prerelease: false
120
- version_requirements: *id013
121
- - !ruby/object:Gem::Dependency
122
- name: lookout-statsd
123
- requirement: &id014 !ruby/object:Gem::Requirement
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- version: 0.7.0
128
175
  type: :runtime
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0.7'
187
+ name: lookout-statsd
129
188
  prerelease: false
130
- version_requirements: *id014
189
+ type: :runtime
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0.7'
131
195
  description: A collection of rack utils.
132
- email:
196
+ email:
133
197
  - ian.smith@lookout.com
134
198
  executables: []
135
-
136
199
  extensions: []
137
-
138
200
  extra_rdoc_files: []
139
-
140
- files:
201
+ files:
141
202
  - .gitignore
142
203
  - Gemfile
143
204
  - LICENSE.txt
@@ -158,30 +219,31 @@ files:
158
219
  - spec/subroute_spec.rb
159
220
  - spec/support/routehelpers.rb
160
221
  - spec/support/subroutehelpers.rb
161
- homepage: ""
162
- licenses:
222
+ homepage: ''
223
+ licenses:
163
224
  - MIT
164
225
  metadata: {}
165
-
166
- post_install_message:
226
+ post_install_message:
167
227
  rdoc_options: []
168
-
169
- require_paths:
228
+ require_paths:
170
229
  - lib
171
- required_ruby_version: !ruby/object:Gem::Requirement
172
- requirements:
173
- - *id003
174
- required_rubygems_version: !ruby/object:Gem::Requirement
175
- requirements:
176
- - *id003
230
+ required_ruby_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - '>='
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ required_rubygems_version: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - '>='
238
+ - !ruby/object:Gem::Version
239
+ version: '0'
177
240
  requirements: []
178
-
179
- rubyforge_project:
180
- rubygems_version: 2.4.1
181
- signing_key:
241
+ rubyforge_project:
242
+ rubygems_version: 2.4.5
243
+ signing_key:
182
244
  specification_version: 4
183
- summary: ""
184
- test_files:
245
+ summary: ''
246
+ test_files:
185
247
  - spec/graphite_spec.rb
186
248
  - spec/i18n_spec.rb
187
249
  - spec/log_spec.rb