RubyApp 0.5.74 → 0.5.75
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/lib/ruby_app/elements/mobile/documents/authentication/open_id/authentication_document.rb
CHANGED
@@ -31,21 +31,21 @@ module RubyApp
|
|
31
31
|
request = @consumer.begin(identifier)
|
32
32
|
self.process_request(request)
|
33
33
|
url = request.redirect_url(RubyApp::Request.url, RubyApp::Request.url)
|
34
|
-
RubyApp::Log.debug("OPENID
|
34
|
+
RubyApp::Log.debug("OPENID --> #{url.inspect}")
|
35
35
|
event.go(url)
|
36
36
|
else
|
37
|
-
RubyApp::Log.debug("OPENID
|
37
|
+
RubyApp::Log.debug("OPENID <-- #{RubyApp::Request.url.inspect}")
|
38
38
|
RubyApp::Request.query.each do |name, value|
|
39
|
-
RubyApp::Log.debug("OPENID
|
39
|
+
RubyApp::Log.debug("OPENID #{name}=#{value}")
|
40
40
|
end
|
41
41
|
response = @consumer.complete(RubyApp::Request.query, RubyApp::Request.url)
|
42
42
|
case response.status
|
43
43
|
when ::OpenID::Consumer::SUCCESS
|
44
44
|
RubyApp::Session.identity = self.create_identity_from_response(response)
|
45
|
-
RubyApp::Log.info("OPENID
|
45
|
+
RubyApp::Log.info("OPENID RubyApp::Session.identity.url=#{RubyApp::Session.identity.url.inspect}")
|
46
46
|
when ::OpenID::Consumer::FAILURE
|
47
|
-
RubyApp::Log.error("OPENID
|
48
|
-
RubyApp::Log.error("OPENID
|
47
|
+
RubyApp::Log.error("OPENID #{response.class}")
|
48
|
+
RubyApp::Log.error("OPENID #{response.message.inspect}")
|
49
49
|
end
|
50
50
|
RubyApp::Session.documents.pop
|
51
51
|
event.go('/')
|
data/lib/ruby_app/log.rb
CHANGED
@@ -17,7 +17,7 @@ module RubyApp
|
|
17
17
|
class Formatter < ::Logger::Formatter
|
18
18
|
|
19
19
|
def call(severity, time, application, message)
|
20
|
-
return "#{severity.ljust(5, ' ')} | #{time.strftime('%Y-%m-%d %H:%M:%S %Z')} | #{Socket.gethostname} | #{Process.pid} | #{RubyApp::Session.exists? ? RubyApp::Session.session_id : '
|
20
|
+
return "#{severity.ljust(5, ' ')} | #{time.strftime('%Y-%m-%d %H:%M:%S %Z')} | #{Socket.gethostname} | #{Process.pid} | #{RubyApp::Session.exists? ? RubyApp::Session.session_id : ' '} | #{message}\n"
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
data/lib/ruby_app/rack/route.rb
CHANGED
@@ -19,7 +19,7 @@ module RubyApp
|
|
19
19
|
|
20
20
|
route(RubyApp::Mixins::RouteMixin::GET, /\/quit/) do |method, path|
|
21
21
|
begin
|
22
|
-
RubyApp::Log.duration(RubyApp::Log::INFO, "GET
|
22
|
+
RubyApp::Log.duration(RubyApp::Log::INFO, "GET /quit") do
|
23
23
|
RubyApp::Session.quit!
|
24
24
|
unless RubyApp::Request.query['go']
|
25
25
|
RubyApp::Response['Content-Type'] = 'text/html'
|
@@ -38,7 +38,7 @@ module RubyApp
|
|
38
38
|
#RubyApp::Log.debug("#{RubyApp::Log.prefix(self, __method__)} --> #{method} #{path} #{element_id} #{format}")
|
39
39
|
begin
|
40
40
|
element = RubyApp::Element.get_element(element_id)
|
41
|
-
RubyApp::Log.duration(RubyApp::Log::INFO, "GET
|
41
|
+
RubyApp::Log.duration(RubyApp::Log::INFO, "GET #{element.class} #{format}") do
|
42
42
|
RubyApp::Response['Content-Type'] = RubyApp::Response.get_content_type(format)
|
43
43
|
RubyApp::Response.write_from_cache(element, format.to_sym)
|
44
44
|
end
|
@@ -52,7 +52,7 @@ module RubyApp
|
|
52
52
|
route(RubyApp::Mixins::RouteMixin::GET, /\.([^\.\?]+)/) do |method, path, format|
|
53
53
|
begin
|
54
54
|
document = RubyApp::Session.document
|
55
|
-
RubyApp::Log.duration(RubyApp::Log::INFO, "GET
|
55
|
+
RubyApp::Log.duration(RubyApp::Log::INFO, "GET #{document.class} #{format}") do
|
56
56
|
RubyApp::Response['Content-Type'] = RubyApp::Response.get_content_type(format)
|
57
57
|
RubyApp::Response.write_from_cache(document, format.to_sym)
|
58
58
|
end
|
@@ -69,10 +69,10 @@ module RubyApp
|
|
69
69
|
route(RubyApp::Mixins::RouteMixin::POST, /.*/) do |method, path|
|
70
70
|
begin
|
71
71
|
RubyApp::Request.POST.each do |name, value|
|
72
|
-
RubyApp::Log.debug("POST
|
72
|
+
RubyApp::Log.debug("POST #{name.to_sym.inspect}=#{value.inspect}")
|
73
73
|
end
|
74
74
|
event = RubyApp::Element::Event.from_hash(RubyApp::Request.POST)
|
75
|
-
RubyApp::Log.duration(RubyApp::Log::INFO, "EVENT
|
75
|
+
RubyApp::Log.duration(RubyApp::Log::INFO, "EVENT #{event.class}") do
|
76
76
|
RubyApp::Session.process_event!(event)
|
77
77
|
RubyApp::Response['Content-Type'] = 'application/json'
|
78
78
|
RubyApp::Response.write(Yajl::Encoder.new.encode(event.to_hash))
|
data/lib/ruby_app/session.rb
CHANGED
@@ -90,20 +90,20 @@ module RubyApp
|
|
90
90
|
begin
|
91
91
|
if event.is_a?(step._class)
|
92
92
|
@steps_index += 1
|
93
|
-
RubyApp::Log.duration(RubyApp::Log::INFO, "STEP
|
93
|
+
RubyApp::Log.duration(RubyApp::Log::INFO, "STEP Current #{step._class} #{step.file}:#{step.line}#{step.block ? nil : ' (no block)'}") do
|
94
94
|
step.block.call(event) if step.block
|
95
95
|
end
|
96
96
|
if @steps_index == @steps.length
|
97
97
|
RubyApp::Log.info('-' * 80)
|
98
|
-
RubyApp::Log.info("STEP
|
98
|
+
RubyApp::Log.info("STEP Completed #{@steps.length} steps")
|
99
99
|
RubyApp::Log.info('-' * 80)
|
100
100
|
else
|
101
101
|
step = @steps[@steps_index]
|
102
|
-
RubyApp::Log.info("STEP
|
102
|
+
RubyApp::Log.info("STEP Next #{step._class} #{step.file}:#{step.line}#{step.block ? nil : ' (no block)'}")
|
103
103
|
end
|
104
104
|
end
|
105
105
|
rescue => exception
|
106
|
-
RubyApp::Log.info("STEP
|
106
|
+
RubyApp::Log.info("STEP Exception occurred at #{step.file}:#{step.line}")
|
107
107
|
@steps_index = @steps.length
|
108
108
|
raise
|
109
109
|
end
|
@@ -161,9 +161,9 @@ module RubyApp
|
|
161
161
|
unless session
|
162
162
|
session = Kernel.eval(RubyApp::Session.configuration._class).new
|
163
163
|
session.load_script!(script_path) if script_path
|
164
|
-
RubyApp::Log.debug("SESSION
|
164
|
+
RubyApp::Log.debug("SESSION RubyApp::Session.session_id=#{session.session_id.inspect}")
|
165
165
|
RubyApp::Session.configuration.log.each do |variable|
|
166
|
-
RubyApp::Log.debug("SESSION
|
166
|
+
RubyApp::Log.debug("SESSION RubyApp::Request.environment['#{variable}']=#{RubyApp::Request.environment[variable].inspect}")
|
167
167
|
end
|
168
168
|
end
|
169
169
|
Thread.current[:_session] = session
|
@@ -180,8 +180,8 @@ module RubyApp
|
|
180
180
|
while true
|
181
181
|
RubyApp::Session.sessions.values.each do |session|
|
182
182
|
if session.expired?
|
183
|
-
RubyApp::Log.debug("SESSION
|
184
|
-
RubyApp::Log.debug("SESSION
|
183
|
+
RubyApp::Log.debug("SESSION session.session_id=#{session.session_id.inspect}")
|
184
|
+
RubyApp::Log.debug("SESSION session.quit!")
|
185
185
|
session.quit!
|
186
186
|
end
|
187
187
|
end
|
@@ -200,14 +200,14 @@ module RubyApp
|
|
200
200
|
end
|
201
201
|
end
|
202
202
|
|
203
|
-
RubyApp::Log.debug("SESSION
|
203
|
+
RubyApp::Log.debug("SESSION #{RubyApp::Log.prefix(self, __method__)}")
|
204
204
|
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
208
|
def self.stop_thread!
|
209
209
|
if @@_thread ||= nil
|
210
|
-
RubyApp::Log.debug("SESSION
|
210
|
+
RubyApp::Log.debug("SESSION #{RubyApp::Log.prefix(self, __method__)}")
|
211
211
|
@@_thread.exit
|
212
212
|
@@_thread = nil
|
213
213
|
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: 157
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 75
|
10
|
+
version: 0.5.75
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-08-
|
18
|
+
date: 2012-08-22 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|