mamiya 0.0.1.alpha5 → 0.0.1.alpha6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2781a38f674237c266a6bfd3dc7631c319d01a1
4
- data.tar.gz: 6a6f56108eb2e3bee73e0cfc7372ee7f335e3862
3
+ metadata.gz: d0f7a6c651243bbb6688a23b99f6a227b9f43100
4
+ data.tar.gz: db21e18cb16baad91bb16fef86b5c764d8f395b4
5
5
  SHA512:
6
- metadata.gz: 50ec070e1b96998ae3f3418fdce0495d8987be9369a93f3bce3bd1c303089d20cbea523442b7a284e4cee071f1d307e6ae32662674752680212520bac4371a32
7
- data.tar.gz: 76e450334e725a817532dbb8c851b1468e31fb0eafac92088b4e536cfe28f6cdc92a80ece0e4e08f50f3950f70f36a5d6f18b4c390b0462d2b4186d1a27cf718
6
+ metadata.gz: 228af2b0c3e35452f515868590cde85131b79818a0b0e2c174a23e89adad56cd9ae03d3fb30aef16fbb0656dbfd581ad4b4113bc00c3dcca2d656605f8c95236
7
+ data.tar.gz: 7eb0f6684de2155783e43ed516217fc5743ebdb01b708e0dc30e32e01fad6f777ae82c49a72f086ad5c29d1501190741f77d97947519fc660830e1eb3b483e72
@@ -33,8 +33,13 @@ module Mamiya
33
33
  rescue Exception => e
34
34
  logger.fatal "#{e.class}: #{e.message}"
35
35
 
36
+ use_fatal = config(:no_error) && config[:show_backtrace_in_fatal]
36
37
  e.backtrace.map{ |_| _.prepend("\t") }.each do |line|
37
- logger.debug line
38
+ if use_fatal
39
+ logger.fatal line
40
+ else
41
+ logger.debug line
42
+ end
38
43
  end
39
44
  end
40
45
  end
@@ -210,18 +215,9 @@ module Mamiya
210
215
  at_exit { File.unlink(pidfile) if File.exist?(pidfile) }
211
216
  end
212
217
 
213
- reload_queue = Queue.new
214
- reload_thread = Thread.new do
215
- while reload_queue.pop
216
- logger.info "Reopening"
217
- logger.reopen
218
- logger.info "Log reopened"
219
- end
220
- end
221
- reload_thread.abort_on_exception = true
222
-
223
218
  trap(:HUP) do
224
- reload_queue << true
219
+ $stderr.puts "hi"
220
+ logger.reopen
225
221
  end
226
222
  end
227
223
 
@@ -141,6 +141,7 @@ module Mamiya
141
141
  sync = io.sync
142
142
  io.reopen(io.path, 'a')
143
143
  io.sync = sync
144
+ io.puts("Log reopened")
144
145
  end
145
146
  end
146
147
 
@@ -1,3 +1,3 @@
1
1
  module Mamiya
2
- VERSION = "0.0.1.alpha5"
2
+ VERSION = "0.0.1.alpha6"
3
3
  end
@@ -56,7 +56,7 @@ describe Mamiya::Logger do
56
56
 
57
57
  describe "#reopen" do
58
58
  it "reopens file IOs" do
59
- io = double('io', path: 'foo', tty?: false, write: 0, sync: true)
59
+ io = double('io', path: 'foo', tty?: false, write: 0, sync: true, puts: nil)
60
60
  expect(io).to receive(:reopen).with('foo', 'a')
61
61
  expect(io).to receive(:sync=).with(true)
62
62
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mamiya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha5
4
+ version: 0.0.1.alpha6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Fukumori (sora_h)