corn 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corn.rb +8 -2
- data/lib/corn/rack/slow_request_profiler.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5d92ee0a0f18b9aa77fdd26158cb0b71838c29d
|
4
|
+
data.tar.gz: 50e879185147300932322f7629e78ba30b761e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29bdfde32e0f98fae6084fa3f5c1ff0c4e4c93f0d753c8c3cf9bac23462b7bef57b63745488132e92a30fcb7f05faa4b85bef3be57a75d994460987416158ef5
|
7
|
+
data.tar.gz: 85a69c7c7662acca5a9357dff1f9f563f0526728f6f3ccec5d51a99baca7472e9679a90a84559bddbcdba6529d672bfcc8c0afdde0c45baf26dab897a41dd0ef
|
data/lib/corn.rb
CHANGED
@@ -24,8 +24,8 @@ module Corn
|
|
24
24
|
#
|
25
25
|
config({
|
26
26
|
:logger => Logger.new(STDOUT),
|
27
|
-
:client_id => ENV['CORN_CLIENT_ID'],
|
28
|
-
:host => ENV['CORN_HOST'],
|
27
|
+
:client_id => lambda { ENV['CORN_CLIENT_ID'] },
|
28
|
+
:host => lambda { ENV['CORN_HOST'] },
|
29
29
|
:ssl_verify_peer => false,
|
30
30
|
:ssl_ca_file => nil,
|
31
31
|
:ssl_ca_path => nil,
|
@@ -40,6 +40,12 @@ module Corn
|
|
40
40
|
|
41
41
|
module_function
|
42
42
|
def configured?
|
43
|
+
if host.nil? || host.empty?
|
44
|
+
Corn.logger.info("Corn host not found")
|
45
|
+
end
|
46
|
+
if client_id.nil? || client_id.empty?
|
47
|
+
Corn.logger.info("Corn client id not found")
|
48
|
+
end
|
43
49
|
!!(host && client_id)
|
44
50
|
end
|
45
51
|
|
@@ -41,7 +41,12 @@ module Corn
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def initialize(app)
|
44
|
-
@app = Corn.configured?
|
44
|
+
@app = if Corn.configured?
|
45
|
+
Corn.logger.info("Corn configuration found, initializing Corn rack middleware")
|
46
|
+
ProfilingApp.new(app)
|
47
|
+
else
|
48
|
+
app
|
49
|
+
end
|
45
50
|
end
|
46
51
|
|
47
52
|
def call(env)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xiao Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sampling_prof
|