RubyApp 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.2.2)
4
+ RubyApp (0.2.3)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -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)
@@ -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
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar