opi 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opi/api.rb +6 -1
- data/lib/opi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 574af283fb9fd743e2dee26fbc63e4a75bb4819c
|
4
|
+
data.tar.gz: d188146b704c8252f20d036828a6ddb2342790a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c884ccc671827468d88ba6a6192bce7b10447d674ac9f581944c1530e208a7fb28785a5dc0bf8e7ce0c1573339bcf0d3d5f747b5014e6fee6287058c467742ba
|
7
|
+
data.tar.gz: 7dff41c84726bfbf38fca7d538ea34cd2ccdf1db693004f8f41b6ff4b29636b23df91a2c1601c1d51cd9bc4319d8b661671c6a8b9bb66c7bb9538e02bd9f602f
|
data/lib/opi/api.rb
CHANGED
@@ -57,7 +57,7 @@ module Opi
|
|
57
57
|
def initialize(options={})
|
58
58
|
puts "* Opi Version: #{Opi::VERSION} initializing".green
|
59
59
|
@logger = options[:logger] || Logger.new(STDOUT)
|
60
|
-
@logger.level = options[:debug] ? Logger::DEBUG : Logger::
|
60
|
+
@logger.level = options[:debug] ? Logger::DEBUG : Logger::INFO
|
61
61
|
end
|
62
62
|
|
63
63
|
def call(env)
|
@@ -73,6 +73,10 @@ module Opi
|
|
73
73
|
request.params.merge!(params) if params and params.is_a? Hash
|
74
74
|
request.params.merge!('splat' => params.join(',')) if params and params.is_a? Array
|
75
75
|
|
76
|
+
start_time = Time.now
|
77
|
+
logger.info " Started #{request.method} \"#{request.path}\" for #{request.ip} at #{start_time.to_s(:short)}"
|
78
|
+
logger.info " Parameters: #{request.params}"
|
79
|
+
|
76
80
|
if route
|
77
81
|
logger.debug "#{request.method} #{request.path} => route #{route.inspect}".green
|
78
82
|
context = Context.new(env, route, request, response, self.class.before_filters, self.class.after_filters)
|
@@ -86,6 +90,7 @@ module Opi
|
|
86
90
|
response.internal_server_error!(e)
|
87
91
|
end
|
88
92
|
|
93
|
+
logger.info " Completed #{response.status} in #{((Time.now - start_time)*1000).round(2)}ms"
|
89
94
|
[response.status, response.header, response.body]
|
90
95
|
end
|
91
96
|
|
data/lib/opi/version.rb
CHANGED