tee_logger 3.0.1 → 3.0.2

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: 7a6bbfeaad4ce3cc439f815a4d72468ea056dd47
4
- data.tar.gz: 9a559bcaa02d344745ba5ec2d0f3f2fc397dde92
3
+ metadata.gz: 3c79949078c49a4d284fbc91a1d9f95096ca7d84
4
+ data.tar.gz: 353081f242f08a788ce77aeffec40b6eddb6c5b9
5
5
  SHA512:
6
- metadata.gz: d8e217bda8ad154e33bb6e819e1b563c1b0d15026be829651b2b8c66bd13d3d50ada1581c50e8bf4629df76b606df4ebe59347bd161ca23090ee6082403cca17
7
- data.tar.gz: 64a1db311741ce7907741c68fa7016fc8391c864fdfb295f5c70b7f73a586ff29d4707e012040323e6e0a9bfd2e2263196c3ed486f4d48901c598ee5a7cbf3a3
6
+ metadata.gz: 56e5b76c2bc1b6eff02d16997c04f19b38b15db1cc0675e80ce82162703224603d6de63ade285d587c9477d4e93791661c13d9219657479aad57bf55fb17c55a
7
+ data.tar.gz: 2ac56759895edff78e7f274cbe5126986dc5f8b14a22c777bca51e22c1c7d7acace9432ae8a5e083369dd8233c0f162802e2cec5fa1e6da2a08eee7b00dc427f
@@ -1,3 +1,7 @@
1
+ # v3.0.2
2
+ - refactoring
3
+ - CONSTANTS move to ./lib/constants.rb
4
+
1
5
  # v3.0.1
2
6
  - refactoring for [issue #9](https://github.com/k-ta-yamada/tee_logger/issues/9)
3
7
 
@@ -1,14 +1,10 @@
1
- require 'tee_logger/utils'
2
1
  require 'tee_logger/version'
2
+ require 'tee_logger/constants'
3
+ require 'tee_logger/utils'
3
4
  require 'logger'
4
5
 
5
6
  # namespace
6
7
  module TeeLogger
7
- # no param of filename, set this filename
8
- DEFAULT_FILE = './tee_logger.log'
9
- # Implements targets
10
- LOGGING_METHODS = [:debug, :info, :warn, :error, :fatal].freeze
11
-
12
8
  # shortcut for TeeLogger::TeeLogger.new
13
9
  # @see TeeLogger
14
10
  def self.new(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576)
@@ -0,0 +1,18 @@
1
+ # namespace
2
+ module TeeLogger
3
+ # no param of filename, set this filename
4
+ DEFAULT_FILE = './tee_logger.log'
5
+ # Implements targets
6
+ LOGGING_METHODS = [:debug, :info, :warn, :error, :fatal]
7
+ # defined logdev names
8
+ LOGDEV_NAMES = [:console, :logfile]
9
+ # defined paired of logdev name
10
+ LOGDEV_REVERSE = { console: :logfile, logfile: :console }
11
+
12
+ # using private method #parse_to_hash
13
+ ParsedOption = Struct.new(:logdev_name, :indent_level)
14
+ # LOGDEV_NAMES not incuded error
15
+ class IncorrectNameError < StandardError; end
16
+ # option's class is not allow
17
+ class IncorrectOptionError < StandardError; end
18
+ end
@@ -2,18 +2,7 @@
2
2
  module TeeLogger
3
3
  # util
4
4
  module Utils
5
- # LOGDEV_NAMES not incuded error
6
- class IncorrectNameError < StandardError; end
7
- #
8
- class IncorrectOptionError < StandardError; end
9
- # using private method #parse_to_hash
10
- ParsedOption = Struct.new(:logdev_name, :indent_level)
11
- # defined log devices names
12
- LOGDEV_NAMES = [:console, :logfile]
13
- # defined reverse names
14
- LOGDEV_REVERSE = { console: :logfile, logfile: :console }
15
-
16
- private
5
+ module_function
17
6
 
18
7
  def extract_options(options)
19
8
  options.each_with_object(ParsedOption.new(nil, 0)) do |val, obj|
@@ -1,5 +1,5 @@
1
1
  # namespace
2
2
  module TeeLogger
3
3
  # version number
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tee_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-ta-yamada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -181,6 +181,7 @@ files:
181
181
  - README.md
182
182
  - Rakefile
183
183
  - lib/tee_logger.rb
184
+ - lib/tee_logger/constants.rb
184
185
  - lib/tee_logger/utils.rb
185
186
  - lib/tee_logger/version.rb
186
187
  - tee_logger.gemspec