marlowe 1.0.1 → 1.0.2

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
1
  ---
2
2
  SHA1:
3
- metadata.gz: 138fa6a06399a2de3f1728a7d22c6e30c2911f27
4
- data.tar.gz: ca42fe17d9f5463c905845d99a12bec35acfd96b
3
+ metadata.gz: 1a7fdda3d50c8438774a6685320096f240248134
4
+ data.tar.gz: c15b495dd3826cf26c1ee626cc203e61a84f2576
5
5
  SHA512:
6
- metadata.gz: 40aa66da8708cecb902f47d682f73340b3e4d91421e5ec5862fb306d493b3e2440e006ff97d350373677450fc09669815ceb833c4b12e4c0ee88ec6d19f01232
7
- data.tar.gz: 25c2d9a63f75ed0de4a9d09cd8d90a5739ccf0fc7bdcddaa95b8742ca10fde6b328089d9abf2c51229576605c62743b75f2608770b8b035255d831d02fd4029c
6
+ metadata.gz: 4d902634019be7e55e40ce4078477a78dc6fd9c78867f2b1c78f562a72170ee989adc1e6d64273b5f23cc18685530007e89a88991f66a8b39947146f88e90ecd
7
+ data.tar.gz: 24a7328086863aa5b74f77e2213a3a149519613e858bce9716fa7dd4999eed30c324b44758d63ff458b4fb249335e71751d86d2becd96e322d6351944a7787b8
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # -*- ruby -*-
2
+
3
+ # NOTE: This file is present to keep Travis CI happy. Edits to it will not
4
+ # be accepted.
5
+
6
+ source 'https://rubygems.org/'
7
+ gemspec
8
+
9
+ # vim: filetype=ruby
@@ -1,3 +1,7 @@
1
+ === 1.0.2 / 2015-11-24
2
+
3
+ * Add documentation for using Marlowe with {lograge}[https://github.com/roidrage/lograge]
4
+
1
5
  === 1.0.1 / 2015-10-20
2
6
 
3
7
  * Update gemspec with homepage
@@ -1,4 +1,5 @@
1
1
  .autotest
2
+ Gemfile
2
3
  History.rdoc
3
4
  Licence.rdoc
4
5
  Manifest.txt
@@ -9,3 +10,5 @@ lib/marlowe/formatter.rb
9
10
  lib/marlowe/middleware.rb
10
11
  lib/marlowe/rails.rb
11
12
  lib/marlowe/simple_formatter.rb
13
+ test/minitest_config.rb
14
+ test/test_marlowe.rb
@@ -52,6 +52,23 @@ You can use this pattern if you've rolled your own logger/formatter:
52
52
  end
53
53
  end
54
54
 
55
+ === Lograge
56
+
57
+ As {lograge}[https://github.com/roidrage/lograge] supplies it's own formatter,
58
+ you will need to do something a little different:
59
+
60
+ # config/application.rb
61
+
62
+ class Application < Rails::Application
63
+ config.before_initialize do
64
+ ...
65
+ # use lograge for all request logs
66
+ config.lograge.enabled = true
67
+ config.lograge.custom_options = lambda do |event|
68
+ { correlation_id: RequestStore[:correlation_id] }
69
+ end
70
+ end
71
+ end
55
72
 
56
73
  == Clients
57
74
 
@@ -96,4 +113,3 @@ or
96
113
  client.before_call(Correlator.new)
97
114
 
98
115
 
99
-
data/Rakefile CHANGED
@@ -1,14 +1,61 @@
1
1
  # -*- ruby -*-
2
2
 
3
- require "rubygems"
4
- require "hoe"
3
+ require 'rubygems'
4
+ require 'hoe'
5
5
 
6
- Hoe.plugin :minitest
6
+ Hoe.plugin :doofus
7
+ Hoe.plugin :email unless ENV['CI'] or ENV['TRAVIS']
8
+ Hoe.plugin :gemspec2
7
9
  Hoe.plugin :git
10
+ Hoe.plugin :minitest
11
+ Hoe.plugin :rubygems
12
+ Hoe.plugin :travis
13
+
14
+ Hoe.spec 'marlowe' do
15
+ developer('Trevor Oke', 'toke@kineticcafe.com')
16
+ developer('Kinetic Cafe', 'dev@kineticcafe.com')
17
+
18
+ self.history_file = 'History.rdoc'
19
+ self.readme_file = 'README.rdoc'
20
+
21
+ license 'MIT'
22
+
23
+ extra_deps << ['request_store', '~> 1.2']
24
+ extra_deps << ['rack', '>= 0.9', '< 2']
25
+
26
+ extra_dev_deps << ['rack-test', '~> 0.6']
27
+ self.extra_dev_deps << ['rake', '~> 10.0']
28
+ self.extra_dev_deps << ['hoe-doofus', '~> 1.0']
29
+ self.extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
30
+ self.extra_dev_deps << ['hoe-git', '~> 1.5']
31
+ self.extra_dev_deps << ['hoe-travis', '~> 1.2']
32
+ self.extra_dev_deps << ['minitest', '~> 5.4']
33
+ self.extra_dev_deps << ['minitest-autotest', '~> 1.0']
34
+ self.extra_dev_deps << ['minitest-bisect', '~> 1.2']
35
+ self.extra_dev_deps << ['minitest-focus', '~> 1.1']
36
+ self.extra_dev_deps << ['minitest-moar', '~> 0.0']
37
+ self.extra_dev_deps << ['simplecov', '~> 0.7']
38
+ end
39
+
40
+ module Hoe::Publish
41
+ alias_method :original_make_rdoc_cmd, :make_rdoc_cmd
42
+
43
+ def make_rdoc_cmd(*extra_args) # :nodoc:
44
+ spec.extra_rdoc_files.reject! { |f| f == 'Manifest.txt' }
45
+ original_make_rdoc_cmd(*extra_args)
46
+ end
47
+ end
8
48
 
9
- Hoe.spec "marlowe" do
10
- developer("Trevor Oke", "toke@kineticcafe.com")
11
- license "MIT"
49
+ namespace :test do
50
+ task :coverage do
51
+ prelude = <<-EOS
52
+ require 'simplecov'
53
+ SimpleCov.start('test_frameworks') { command_name 'Minitest' }
54
+ gem 'minitest'
55
+ EOS
56
+ spec.test_prelude = prelude.split($/).join('; ')
57
+ Rake::Task['test'].execute
58
+ end
12
59
  end
13
60
 
14
61
  # vim: syntax=ruby
@@ -1,6 +1,6 @@
1
1
  # Marlowe, a correlation id injector.
2
2
  module Marlowe
3
- VERSION = '1.0.1' #:nodoc:
3
+ VERSION = '1.0.2' #:nodoc:
4
4
 
5
5
  require 'marlowe/middleware'
6
6
  require 'marlowe/rails' if defined? Rails::Railtie
@@ -0,0 +1,24 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+
3
+ gem 'minitest'
4
+
5
+ require 'rack/test'
6
+ require 'rack/mock'
7
+ require 'pry'
8
+ require 'minitest/autorun'
9
+ require 'minitest/pretty_diff'
10
+ require 'minitest/focus'
11
+ require 'minitest/moar'
12
+ require 'minitest/bisect'
13
+
14
+ require 'request_store'
15
+ require 'marlowe'
16
+
17
+ class RackApp
18
+ def call(env)
19
+ end
20
+
21
+ def coordination_id
22
+ RequestStore[:correlation_id]
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ require 'minitest_config'
2
+
3
+ class TestMarlowe < Minitest::Test
4
+ def setup
5
+ @app = RackApp.new
6
+ @middleware = Marlowe::Middleware.new(@app)
7
+ end
8
+
9
+ def test_no_header
10
+ @middleware.call({})
11
+ refute_empty @app.coordination_id
12
+ end
13
+
14
+ def test_with_header
15
+ @middleware.call({'HTTP_CORRELATION_ID' => 'testvalue'})
16
+ refute_empty @app.coordination_id
17
+ assert_equal 'testvalue', @app.coordination_id
18
+ end
19
+ end
metadata CHANGED
@@ -1,15 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marlowe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Oke
8
+ - Kinetic Cafe
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
12
+ date: 2015-11-25 00:00:00.000000000 Z
12
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: request_store
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.2'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.2'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rack
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0.9'
35
+ - - "<"
36
+ - !ruby/object:Gem::Version
37
+ version: '2'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0.9'
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '2'
13
48
  - !ruby/object:Gem::Dependency
14
49
  name: minitest
15
50
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +73,160 @@ dependencies:
38
73
  - - "~>"
39
74
  - !ruby/object:Gem::Version
40
75
  version: '4.0'
76
+ - !ruby/object:Gem::Dependency
77
+ name: rack-test
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.6'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.6'
90
+ - !ruby/object:Gem::Dependency
91
+ name: rake
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.0'
104
+ - !ruby/object:Gem::Dependency
105
+ name: hoe-doofus
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.0'
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.0'
118
+ - !ruby/object:Gem::Dependency
119
+ name: hoe-gemspec2
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.1'
132
+ - !ruby/object:Gem::Dependency
133
+ name: hoe-git
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.5'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.5'
146
+ - !ruby/object:Gem::Dependency
147
+ name: hoe-travis
148
+ requirement: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.2'
153
+ type: :development
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.2'
160
+ - !ruby/object:Gem::Dependency
161
+ name: minitest-autotest
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: minitest-bisect
176
+ requirement: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.2'
181
+ type: :development
182
+ prerelease: false
183
+ version_requirements: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.2'
188
+ - !ruby/object:Gem::Dependency
189
+ name: minitest-focus
190
+ requirement: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.1'
195
+ type: :development
196
+ prerelease: false
197
+ version_requirements: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.1'
202
+ - !ruby/object:Gem::Dependency
203
+ name: minitest-moar
204
+ requirement: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.0'
209
+ type: :development
210
+ prerelease: false
211
+ version_requirements: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.0'
216
+ - !ruby/object:Gem::Dependency
217
+ name: simplecov
218
+ requirement: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.7'
223
+ type: :development
224
+ prerelease: false
225
+ version_requirements: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '0.7'
41
230
  - !ruby/object:Gem::Dependency
42
231
  name: hoe
43
232
  requirement: !ruby/object:Gem::Requirement
@@ -57,6 +246,7 @@ description: "{marlowe}[https://github.com/KineticCafe/marlowe] provides a corre
57
246
  \nacross multiple services."
58
247
  email:
59
248
  - toke@kineticcafe.com
249
+ - dev@kineticcafe.com
60
250
  executables: []
61
251
  extensions: []
62
252
  extra_rdoc_files:
@@ -66,6 +256,7 @@ extra_rdoc_files:
66
256
  - README.rdoc
67
257
  files:
68
258
  - ".autotest"
259
+ - Gemfile
69
260
  - History.rdoc
70
261
  - Licence.rdoc
71
262
  - Manifest.txt
@@ -76,6 +267,8 @@ files:
76
267
  - lib/marlowe/middleware.rb
77
268
  - lib/marlowe/rails.rb
78
269
  - lib/marlowe/simple_formatter.rb
270
+ - test/minitest_config.rb
271
+ - test/test_marlowe.rb
79
272
  homepage:
80
273
  licenses:
81
274
  - MIT