RubyApp 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/ruby_app/log.rb +1 -1
- data/lib/ruby_app/rack/request.rb +3 -0
- data/lib/ruby_app/request.rb +3 -0
- data/lib/ruby_app/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/ruby_app/log.rb
CHANGED
@@ -16,7 +16,7 @@ module RubyApp
|
|
16
16
|
class Formatter < ::Logger::Formatter
|
17
17
|
|
18
18
|
def call(severity, time, application, message)
|
19
|
-
return "#{severity} | #{time.strftime('%Y-%m-%d %H:%M:%S %Z')} | #{RubyApp::Session.exists? ? RubyApp::Session.session_id : '-'} | #{RubyApp::Session.exists? && RubyApp::Session.identity ? RubyApp::Session.identity.url : '-'} | #{message}\n"
|
19
|
+
return "#{severity} | #{time.strftime('%Y-%m-%d %H:%M:%S %Z')} | #{RubyApp::Request.exists? ? RubyApp::Request.environment['REMOTE_ADDR'] : '-'} | #{RubyApp::Request.exists? ? RubyApp::Request.environment['SERVER_NAME'] : '-'} | #{RubyApp::Request.exists? ? RubyApp::Request.environment['SERVER_PORT'] : '-'} | #{RubyApp::Session.exists? ? RubyApp::Session.session_id : '-'} | #{RubyApp::Session.exists? && RubyApp::Session.identity ? RubyApp::Session.identity.url : '-'} | #{message}\n"
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -12,6 +12,9 @@ module RubyApp
|
|
12
12
|
def call(environment)
|
13
13
|
RubyApp::Request.create!(environment)
|
14
14
|
begin
|
15
|
+
#environment.each do |name, value|
|
16
|
+
# RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} environment[#{name.inspect}]=#{value.inspect}")
|
17
|
+
#end
|
15
18
|
#RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} RubyApp::Request.request_method=#{RubyApp::Request.request_method.inspect}")
|
16
19
|
#RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} RubyApp::Request.path=#{RubyApp::Request.path.inspect}")
|
17
20
|
return @application.call(environment)
|
data/lib/ruby_app/request.rb
CHANGED
@@ -9,6 +9,8 @@ module RubyApp
|
|
9
9
|
class Request < ::Rack::Request
|
10
10
|
extend RubyApp::Mixins::DelegateMixin
|
11
11
|
|
12
|
+
attr_reader :environment
|
13
|
+
|
12
14
|
def language
|
13
15
|
self.fullpath =~ /^\/([^\/\?]+)/
|
14
16
|
return $1
|
@@ -57,6 +59,7 @@ module RubyApp
|
|
57
59
|
|
58
60
|
def initialize(environment)
|
59
61
|
super(environment)
|
62
|
+
@environment = environment
|
60
63
|
end
|
61
64
|
|
62
65
|
end
|
data/lib/ruby_app/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RubyApp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|