logging_library 1.3.0 → 2.0.0

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
  SHA256:
3
- metadata.gz: e3cd0d59c85aef389748fadbeb9177a21d6c70b2253c108296d7594f544b2d3e
4
- data.tar.gz: 8207d988ebe5845473d9c1bfded67fb1234e32c1473af1ab62b05294e382132b
3
+ metadata.gz: f9e3cead1793fc295e4316b2017e100a2bba7ef329c6e8e8803f5047e1c0b5e7
4
+ data.tar.gz: 90b938df0b87e185bc5c92b105cdf265dd30e609e9b0f8bdc7b4ad61ad2ec2b3
5
5
  SHA512:
6
- metadata.gz: 1f36d5f6aa5825a984da554389e7552f21eedc43c06d7bec64d9de6296433322d9382b666aac1369bdb5dde8022fa7d8a1abb2b650c38cec59f1a7079073afdd
7
- data.tar.gz: 179c7018a4f584523841b5bc25862901859d78aed3525f47473c7cb2c04c693662629299b82ff571452158faf5701a1db54eaac5b7e83c9b5be790aad548486a
6
+ metadata.gz: f59b5611b0df45897ebd7e3280f0b7fc001307ab02d9bd4e7df3eb9ed40fa7a6e001e9e7d138104982c9bc4bec6d83105197aab551f332cbeb73accbd7b85602
7
+ data.tar.gz: 70c8c6b29693400943a85670208317496473c6175c017e4b2446951d44ea01f4cf8f4fc77ec7d15c529ff3bff433568a89e3c2e5f0642193c7fba003b7ef5a46
@@ -1,7 +1,8 @@
1
1
  AllCops:
2
- TargetRubyVersion: 1.9
3
2
  DisplayCopNames: true
4
3
  DisplayStyleGuide: true
4
+ Exclude:
5
+ - bin/**/*
5
6
 
6
7
  Lint/EndAlignment:
7
8
  EnforcedStyleAlignWith: variable
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-03-17 11:15:17 +0200 using RuboCop version 0.46.0.
3
+ # on 2018-04-06 11:11:17 +0300 using RuboCop version 0.54.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -12,6 +12,13 @@ Lint/HandleExceptions:
12
12
  - 'Rakefile'
13
13
 
14
14
  # Offense count: 1
15
- # Configuration parameters: CountComments.
15
+ # Configuration parameters: CountComments, ExcludedMethods.
16
16
  Metrics/BlockLength:
17
- Max: 86
17
+ Max: 90
18
+
19
+ # Offense count: 6
20
+ # Configuration parameters: EnforcedStyle.
21
+ # SupportedStyles: annotated, template, unannotated
22
+ Style/FormatStringToken:
23
+ Exclude:
24
+ - 'lib/logging_library/custom_formatter.rb'
@@ -0,0 +1 @@
1
+ 2.3
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in ecraft-logging_library.gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
 
3
5
  begin
@@ -14,4 +16,7 @@ begin
14
16
  rescue LoadError
15
17
  end
16
18
 
17
- task default: :spec
19
+ require 'rubocop/rake_task'
20
+ RuboCop::RakeTask.new
21
+
22
+ task default: %i[rubocop spec]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logging_library'
2
4
 
3
5
  module Ecraft
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logging_library/custom_formatter'
2
4
  require 'logging_library/logger_factory'
3
5
  require 'logging_library/logger'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
  require 'rainbow'
3
5
 
@@ -6,7 +8,7 @@ module LoggingLibrary
6
8
  # Handles log formatting. Not intended to be used from user code.
7
9
  #
8
10
  class CustomFormatter < ::Logger::Formatter
9
- DATE_PATTERN = '%Y-%m-%d %H:%M:%S.%L'.freeze
11
+ DATE_PATTERN = '%Y-%m-%d %H:%M:%S.%L'
10
12
 
11
13
  LogMessage = Struct.new(:severity, :time, :logger_name, :message) do
12
14
  def to_formatted_string
@@ -1,10 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'forwardable'
2
4
  require 'mixlib/log'
3
5
 
4
6
  module LoggingLibrary
5
7
  #
6
- # Responsible for printing out log messages. Not intended to be used directly from user code; use the Loggable mixin
7
- # (preferred) or LoggerFactory (secondary choice) to create a logger.
8
+ # Responsible for printing out log messages. Not intended to be used
9
+ # directly from user code; use the Loggable mixin (preferred) or
10
+ # LoggerFactory (secondary choice) to create a logger.
8
11
  #
9
12
  class Logger
10
13
  include Mixlib::Log
@@ -13,7 +16,7 @@ module LoggingLibrary
13
16
  def_delegator :logger, :progname, :name
14
17
 
15
18
  def initialize(name)
16
- init(LoggingLibrary::output_device)
19
+ init(LoggingLibrary.output_device)
17
20
 
18
21
  logger.level = :info
19
22
  logger.progname = name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module LoggingLibrary
2
4
  #
3
5
  # Module responsible for instantiating logger objects.
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module LoggingLibrary
2
4
  module Mixins
3
5
  #
4
- # Mixin for adding a lazily-instantiated `logger` attribute to your class, with reasonable defaults based on the class name.
6
+ # Mixin for adding a lazily-instantiated `logger` attribute to your
7
+ # class, with reasonable defaults based on the class name.
5
8
  #
6
9
  module Loggable
7
10
  def logger
@@ -20,8 +23,10 @@ module LoggingLibrary
20
23
  end
21
24
 
22
25
  def _short_class_name(full_name)
23
- # ClassThatIncludesLoggable vs Ecraft::LoggingLibrary::ClassThatIncludesLoggable. The latter feels overly detailed;
24
- # there are hopefully not that many classes with the same name in an application...
26
+ # ClassThatIncludesLoggable vs
27
+ # Ecraft::LoggingLibrary::ClassThatIncludesLoggable. The latter feels
28
+ # overly detailed; there are hopefully not that many classes with the
29
+ # same name in an application...
25
30
  full_name.split('::').last
26
31
  end
27
32
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module LoggingLibrary
2
- VERSION = '1.3.0'.freeze
4
+ VERSION = '2.0.0'
3
5
  end
@@ -1,6 +1,7 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
- lib = File.expand_path('../lib', __FILE__)
4
+ lib = File.expand_path('lib', __dir__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
  require 'logging_library/version'
6
7
 
@@ -21,6 +22,7 @@ Gem::Specification.new do |spec|
21
22
  spec.bindir = 'exe'
22
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
24
  spec.require_paths = ['lib']
25
+ spec.required_ruby_version = '>= 2.3.0'
24
26
 
25
27
  spec.add_runtime_dependency 'mixlib-log', '~> 1.7'
26
28
  spec.add_runtime_dependency 'rainbow', '>= 2.2'
@@ -28,6 +30,6 @@ Gem::Specification.new do |spec|
28
30
  spec.add_development_dependency 'bundler', '~> 1.13'
29
31
  spec.add_development_dependency 'rake', '~> 12.3'
30
32
  spec.add_development_dependency 'rspec', '~> 3.5'
31
- spec.add_development_dependency 'rubocop', '~> 0.50', '< 0.51'
33
+ spec.add_development_dependency 'rubocop', '~> 0.54'
32
34
  spec.add_development_dependency 'yard', '~> 0.9'
33
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logging_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tre Kronor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -86,20 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.50'
90
- - - "<"
91
- - !ruby/object:Gem::Version
92
- version: '0.51'
89
+ version: '0.54'
93
90
  type: :development
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
96
93
  requirements:
97
94
  - - "~>"
98
95
  - !ruby/object:Gem::Version
99
- version: '0.50'
100
- - - "<"
101
- - !ruby/object:Gem::Version
102
- version: '0.51'
96
+ version: '0.54'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: yard
105
99
  requirement: !ruby/object:Gem::Requirement
@@ -125,6 +119,7 @@ files:
125
119
  - ".rspec"
126
120
  - ".rubocop.yml"
127
121
  - ".rubocop_todo.yml"
122
+ - ".ruby-version"
128
123
  - ".travis.yml"
129
124
  - ".yardopts"
130
125
  - CODE_OF_CONDUCT.md
@@ -155,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
150
  requirements:
156
151
  - - ">="
157
152
  - !ruby/object:Gem::Version
158
- version: '0'
153
+ version: 2.3.0
159
154
  required_rubygems_version: !ruby/object:Gem::Requirement
160
155
  requirements:
161
156
  - - ">="