RubyApp 0.6.27 → 0.6.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,8 +19,8 @@ map '/ruby_app/resources' do
19
19
  run Rack::File.new(File.join(RubyApp::ROOT, %w[resources]))
20
20
  end
21
21
 
22
- map '/google_button.ico' do
23
- run Rack::File.new(File.join(RubyApp::ROOT, %w[resources google_button.ico]))
22
+ map '/favicon.ico' do
23
+ run Rack::File.new(File.join(RubyApp::ROOT, %w[resources favicon.ico]))
24
24
  end
25
25
 
26
26
  map '/' do
data/lib/ruby_app/log.rb CHANGED
@@ -64,16 +64,23 @@ module RubyApp
64
64
  path = String.interpolate { RubyApp::Log.configuration.path }
65
65
  FileUtils.mkdir_p(File.dirname(path))
66
66
  @@_log = RubyApp::Log.new(path)
67
+ RubyApp::Log.debug("LOG #{RubyApp::Log.prefix(self, __method__)}")
67
68
  end
68
69
  end
69
70
 
70
71
  def self.close!
71
72
  if @@_log ||= nil
73
+ RubyApp::Log.debug("LOG #{RubyApp::Log.prefix(self, __method__)}")
72
74
  @@_log.close
73
75
  @@_log = nil
74
76
  end
75
77
  end
76
78
 
79
+ def self.reopen!
80
+ RubyApp::Log.close!
81
+ RubyApp::Log.open!
82
+ end
83
+
77
84
  private
78
85
 
79
86
  def initialize(path)
@@ -11,6 +11,23 @@ module RubyApp
11
11
  RubyApp::Log.open!
12
12
  RubyApp::Application.create!
13
13
  RubyApp::Session.start_thread!
14
+
15
+ Signal.trap('HUP') do
16
+ begin
17
+ RubyApp::Log.reopen!
18
+ rescue => exception
19
+ RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
20
+ end
21
+ end
22
+
23
+ Signal.trap('EXIT') do
24
+ begin
25
+ RubyApp::Session.stop_thread!
26
+ rescue => exception
27
+ RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
28
+ end
29
+ end
30
+
14
31
  end
15
32
 
16
33
  def call(environment)
@@ -192,14 +192,6 @@ module RubyApp
192
192
  end
193
193
  end
194
194
 
195
- at_exit do
196
- begin
197
- RubyApp::Session.stop_thread!
198
- rescue => exception
199
- RubyApp::Log.exception(RubyApp::Log::ERROR, exception)
200
- end
201
- end
202
-
203
195
  RubyApp::Log.debug("SESSION #{RubyApp::Log.prefix(self, __method__)}")
204
196
 
205
197
  end
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.6.27"
2
+ VERSION = "0.6.28"
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: 49
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 27
10
- version: 0.6.27
9
+ - 28
10
+ version: 0.6.28
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-10-07 00:00:00 Z
18
+ date: 2012-10-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement