e20_ops_middleware 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/e20/ops/middleware/transaction_id_middleware.rb +3 -3
- data/spec/ops/middleware/transaction_id_middleware_spec.rb +1 -1
- data/spec/ops/revision_spec.rb +1 -0
- metadata +7 -8
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -9,13 +9,11 @@ GEM
|
|
9
9
|
git (>= 1.2.5)
|
10
10
|
rubyforge (>= 2.0.0)
|
11
11
|
json_pure (1.4.3)
|
12
|
-
macaddr (1.0.0)
|
13
12
|
rake (0.8.7)
|
14
13
|
rspec (1.3.0)
|
15
14
|
rubyforge (2.0.4)
|
16
15
|
json_pure (>= 1.1.7)
|
17
|
-
|
18
|
-
macaddr (~> 1.0)
|
16
|
+
uuidtools (2.1.1)
|
19
17
|
|
20
18
|
PLATFORMS
|
21
19
|
ruby
|
@@ -26,4 +24,4 @@ DEPENDENCIES
|
|
26
24
|
json_pure (= 1.4.3)
|
27
25
|
rake (~> 0.8.7)
|
28
26
|
rspec (~> 1.3.0)
|
29
|
-
|
27
|
+
uuidtools
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ Jeweler::Tasks.new do |gem|
|
|
11
11
|
gem.homepage = "http://github.com/efficiency20/ops_middleware"
|
12
12
|
gem.description = "Adds middleware for debugging purposes"
|
13
13
|
gem.authors = ["Efficiency 2.0"]
|
14
|
-
gem.add_dependency "
|
14
|
+
gem.add_dependency "uuidtools", "~> 2.1"
|
15
15
|
gem.add_development_dependency "rspec", "~> 1.3.0"
|
16
16
|
end
|
17
17
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0
|
1
|
+
2.1.0
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "uuidtools"
|
2
2
|
require "logger"
|
3
3
|
|
4
4
|
module E20
|
@@ -8,12 +8,12 @@ module E20
|
|
8
8
|
|
9
9
|
def initialize(app, options = {})
|
10
10
|
@app = app
|
11
|
-
@uuid_generator = options[:uuid_generator] || UUID.
|
11
|
+
@uuid_generator = options[:uuid_generator] || UUIDTools::UUID.method(:random_create)
|
12
12
|
@logger = options[:logger] || Logger.new(STDOUT)
|
13
13
|
end
|
14
14
|
|
15
15
|
def call(env)
|
16
|
-
uuid = @uuid_generator.
|
16
|
+
uuid = @uuid_generator.call.to_s
|
17
17
|
@logger.info "[#{self.class.name}] Transaction ID: #{uuid}"
|
18
18
|
|
19
19
|
status, headers, body = @app.call(env)
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe E20::Ops::Middleware::TransactionIdMiddleware do
|
4
4
|
let(:app) { Proc.new { |env| [200, {}, "OK!"] } }
|
5
|
-
let(:uuid) { stub(:
|
5
|
+
let(:uuid) { stub(:call => "abc123") }
|
6
6
|
let(:logger) { Logger.new(StringIO.new) }
|
7
7
|
|
8
8
|
it "is initialized with an app" do
|
data/spec/ops/revision_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e20_ops_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
- 0
|
9
8
|
- 1
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 2.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Efficiency 2.0
|
@@ -15,24 +15,23 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-28 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|
23
23
|
type: :runtime
|
24
|
-
name:
|
24
|
+
name: uuidtools
|
25
25
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 1
|
31
31
|
segments:
|
32
32
|
- 2
|
33
33
|
- 1
|
34
|
-
|
35
|
-
version: 2.1.0
|
34
|
+
version: "2.1"
|
36
35
|
requirement: *id001
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
37
|
prerelease: false
|