easy_app_helper 4.2.2 → 4.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy_app_helper/logger/initializer.rb +18 -8
- data/lib/easy_app_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eec0965d2481f26200028412a45d62e7a67f7777
|
4
|
+
data.tar.gz: 3eca04154c9b5714fb04fab33613bc4270c4b92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5600747d5e0f5b7d1254d3504479dfc426e2e8d6315910b7c694bbaa6f69e7290c9060afe19e4d6bc5016b4fa54a42c332f5ba9e0ebb1343820414e562ae74
|
7
|
+
data.tar.gz: a6d6c174722d8dbbe1cf350b2f91de55598f1fd37fba657e3896650ef4a82bb72bc25d144f1293d6cdc78eba6a7d55f30c5172bfdfa2367103e451863e6d57f6
|
@@ -6,9 +6,9 @@ module EasyAppHelper
|
|
6
6
|
def self.init_command_line_options
|
7
7
|
EasyAppHelper.config.add_command_line_section('Debug and logging options') do |slop|
|
8
8
|
slop.on :debug, 'Run in debug mode.', argument: false
|
9
|
-
slop.on 'debug-on-err', 'Run in debug mode with output to stderr.', argument: false
|
10
|
-
slop.on 'log-level', "Log level from 0 to 5, default #{::Logger::Severity::WARN}.", argument: true, as: Integer
|
11
|
-
slop.on 'log-file', 'File to log to.', argument: true, as: String
|
9
|
+
slop.on :'debug-on-err', 'Run in debug mode with output to stderr.', argument: false
|
10
|
+
slop.on :'log-level', "Log level from 0 to 5, default #{::Logger::Severity::WARN}.", argument: true, as: Integer
|
11
|
+
slop.on :'log-file', 'File to log to.', argument: true, as: String
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -22,12 +22,22 @@ module EasyAppHelper
|
|
22
22
|
log_device = File::NULL
|
23
23
|
if EasyAppHelper.config[:debug]
|
24
24
|
log_device = if EasyAppHelper.config[:'log-file']
|
25
|
-
if File.
|
26
|
-
EasyAppHelper.config[:'log-file']
|
25
|
+
if File.exists? EasyAppHelper.config[:'log-file']
|
26
|
+
if File.writable? EasyAppHelper.config[:'log-file']
|
27
|
+
EasyAppHelper.config[:'log-file']
|
28
|
+
else
|
29
|
+
STDERR.puts "WARNING: Log file '#{EasyAppHelper.config[:'log-file']}' is not writable. Switching to STDERR..."
|
30
|
+
EasyAppHelper.config[:'log-file'] = nil
|
31
|
+
STDERR
|
32
|
+
end
|
27
33
|
else
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
if File.writable? File.dirname(EasyAppHelper.config[:'log-file'])
|
35
|
+
EasyAppHelper.config[:'log-file']
|
36
|
+
else
|
37
|
+
STDERR.puts "WARNING: Cannot write log file in '#{File.dirname EasyAppHelper.config[:'log-file']}'. Switching to STDERR..."
|
38
|
+
EasyAppHelper.config[:'log-file'] = nil
|
39
|
+
STDERR
|
40
|
+
end
|
31
41
|
end
|
32
42
|
elsif EasyAppHelper.config[:'debug-on-err']
|
33
43
|
STDERR
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_app_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L.Briais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|