yell 2.2.0 → 2.2.1

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: 59a2ae83c97bc78309f37e66af22d46d374c468b
4
- data.tar.gz: 85bcce8202f4460472dab37ad325f31c1217e19c
3
+ metadata.gz: 6b8ae544ad2e89e1b19b599d71469fae18f3e2d9
4
+ data.tar.gz: 36160510eee038ee2723b55a79584ae29fa060e2
5
5
  SHA512:
6
- metadata.gz: 617fbc94646ed5af6afee6c4be76d1ed0628664cf747e3dd070f137a5338271ca9302795f6a270c11f4c77ab4bd780b78d4b79b820e8e303d11a0886ba8d24d3
7
- data.tar.gz: 4c66343d5d7b3cd723231c773c2c359a74e5a4804e68a2bd8ab2f031a9b54937dccd00b1a1561f82f963578bb89da90db1bd1647d4ddecf5545d2535791c6c70
6
+ metadata.gz: 5a17231a928486307cc73d56847f997c419b6a49e59ad024d75f2a3de3019628f4de9ba662573f9ec790c1e0865a1897c88938970e6d2aa6d93c97334ad302fd
7
+ data.tar.gz: 48eb8f9b23a36a8e5d38bb8b17bac20d76ade1c7c0d8bd359b58347c74d60aa7ea2fbcfa23d1110e42602c29bcc1bd33f19c68351b6c46afb6e5967d6d99ed4e
data/Gemfile CHANGED
@@ -1,22 +1,24 @@
1
- source "http://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'http://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in yell.gemspec
4
6
  gemspec
5
7
 
6
8
  group :development, :test do
7
- gem "rake"
9
+ gem 'rake'
8
10
 
9
11
  gem 'rspec-core', '~> 3'
10
12
  gem 'rspec-expectations'
11
- gem 'rspec-mocks'
12
13
  gem 'rspec-its'
14
+ gem 'rspec-mocks'
13
15
 
14
- gem 'timecop'
15
16
  gem 'byebug', platform: :mri
17
+ gem 'timecop'
16
18
 
17
19
  gem 'activesupport', '~> 5'
18
20
 
19
- gem 'simplecov', require: false
20
21
  gem 'coveralls', require: false
22
+ gem 'rubocop', require: false
23
+ gem 'simplecov', require: false
21
24
  end
22
-
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2014 Rudolf Schmidt
1
+ Copyright (c) 2011-current Rudolf Schmidt
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -219,5 +219,5 @@ You can find further examples and additional adapters in the [wiki](https://gith
219
219
  or have a look into the examples folder.
220
220
 
221
221
 
222
- Copyright © 2011-2015 Rudolf Schmidt, released under the MIT license
222
+ Copyright © 2011-current Rudolf Schmidt, released under the MIT license
223
223
 
@@ -1,4 +1,4 @@
1
1
  module Yell #:nodoc:
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
4
4
 
@@ -1,32 +1,28 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'yell/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "yell"
8
- spec.version = Yell::VERSION
9
- spec.authors = ["Rudolf Schmidt"]
10
- spec.license = 'MIT'
8
+ spec.name = 'yell'
9
+ spec.version = Yell::VERSION
10
+ spec.authors = ['Rudolf Schmidt']
11
+ spec.license = 'MIT'
11
12
 
12
- spec.homepage = "http://rudionrailspec.github.com/yell"
13
- spec.summary = %q{Yell - Your Extensible Logging Library}
14
- spec.description = %q{Yell - Your Extensible Logging Library. Define multiple adapters, various log level combinations or message formatting options like you've never done before}
15
- if spec.respond_to?(:metadata)
16
- # metadata keys must be strings, not symbols
17
- spec.metadata = {
18
- 'github_repo' => 'https://github.com/rudionrails/yell',
19
- 'bug_tracker_uri' => 'https://github.com/rudionrails/yell/issues',
20
- 'documentation_uri' => 'http://rudionrailspec.github.com/yell',
21
- 'homepage_uri' => 'http://rudionrailspec.github.com/yell',
22
- 'source_code_uri' => 'https://github.com/rudionrails/yell',
23
- 'wiki_uri' => 'http://rudionrailspec.github.com/yell'
24
- }
25
- end
13
+ spec.summary = 'Yell - Your Extensible Logging Library'
14
+ spec.description = "Yell - Your Extensible Logging Library. Define multiple adapters, various log level combinations or message formatting options like you've never done before"
15
+ spec.homepage = 'https://github.com/rudionrails/yell'
26
16
 
27
- spec.files = `git ls-files -z`.split("\x0")
28
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
30
- spec.require_paths = ["lib"]
31
- end
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = 'https://github.com/rudionrails/yell'
32
19
 
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = 'exe'
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ['lib']
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yell
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rudolf Schmidt
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-19 00:00:00.000000000 Z
11
+ date: 2020-01-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Yell - Your Extensible Logging Library. Define multiple adapters, various
14
14
  log level combinations or message formatting options like you've never done before
@@ -59,39 +59,13 @@ files:
59
59
  - lib/yell/repository.rb
60
60
  - lib/yell/silencer.rb
61
61
  - lib/yell/version.rb
62
- - spec/compatibility/activesupport_logger_spec.rb
63
- - spec/compatibility/formatter_spec.rb
64
- - spec/compatibility/level_spec.rb
65
- - spec/fixtures/yell.yml
66
- - spec/spec_helper.rb
67
- - spec/threaded/yell_spec.rb
68
- - spec/yell/adapters/base_spec.rb
69
- - spec/yell/adapters/datefile_spec.rb
70
- - spec/yell/adapters/file_spec.rb
71
- - spec/yell/adapters/io_spec.rb
72
- - spec/yell/adapters/streams_spec.rb
73
- - spec/yell/adapters_spec.rb
74
- - spec/yell/configuration_spec.rb
75
- - spec/yell/dsl_spec.rb
76
- - spec/yell/event_spec.rb
77
- - spec/yell/formatter_spec.rb
78
- - spec/yell/level_spec.rb
79
- - spec/yell/loggable_spec.rb
80
- - spec/yell/logger_spec.rb
81
- - spec/yell/repository_spec.rb
82
- - spec/yell/silencer_spec.rb
83
- - spec/yell_spec.rb
84
62
  - yell.gemspec
85
- homepage: http://rudionrailspec.github.com/yell
63
+ homepage: https://github.com/rudionrails/yell
86
64
  licenses:
87
65
  - MIT
88
66
  metadata:
89
- github_repo: https://github.com/rudionrails/yell
90
- bug_tracker_uri: https://github.com/rudionrails/yell/issues
91
- documentation_uri: http://rudionrailspec.github.com/yell
92
- homepage_uri: http://rudionrailspec.github.com/yell
67
+ homepage_uri: https://github.com/rudionrails/yell
93
68
  source_code_uri: https://github.com/rudionrails/yell
94
- wiki_uri: http://rudionrailspec.github.com/yell
95
69
  post_install_message:
96
70
  rdoc_options: []
97
71
  require_paths:
@@ -112,26 +86,4 @@ rubygems_version: 2.6.11
112
86
  signing_key:
113
87
  specification_version: 4
114
88
  summary: Yell - Your Extensible Logging Library
115
- test_files:
116
- - spec/compatibility/activesupport_logger_spec.rb
117
- - spec/compatibility/formatter_spec.rb
118
- - spec/compatibility/level_spec.rb
119
- - spec/fixtures/yell.yml
120
- - spec/spec_helper.rb
121
- - spec/threaded/yell_spec.rb
122
- - spec/yell/adapters/base_spec.rb
123
- - spec/yell/adapters/datefile_spec.rb
124
- - spec/yell/adapters/file_spec.rb
125
- - spec/yell/adapters/io_spec.rb
126
- - spec/yell/adapters/streams_spec.rb
127
- - spec/yell/adapters_spec.rb
128
- - spec/yell/configuration_spec.rb
129
- - spec/yell/dsl_spec.rb
130
- - spec/yell/event_spec.rb
131
- - spec/yell/formatter_spec.rb
132
- - spec/yell/level_spec.rb
133
- - spec/yell/loggable_spec.rb
134
- - spec/yell/logger_spec.rb
135
- - spec/yell/repository_spec.rb
136
- - spec/yell/silencer_spec.rb
137
- - spec/yell_spec.rb
89
+ test_files: []
@@ -1,36 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
-
4
- begin
5
- require 'active_support'
6
- rescue LoadError
7
- end
8
-
9
- # make a setup just like in railties ~> 4.0.0
10
- #
11
- # We simulate the case when Rails 4 starts up its server
12
- # and wants to append the log output.
13
- describe "Compatibility to ActiveSupport::Logger",
14
- :pending => (!defined?(ActiveSupport) || ActiveSupport::VERSION::MAJOR < 4) do
15
-
16
- let!(:yell) { Yell.new($stdout, :format => "%m") }
17
-
18
- let!(:logger) do
19
- console = ActiveSupport::Logger.new($stdout)
20
- console.formatter = yell.formatter
21
- console.level = yell.level
22
-
23
- yell.extend(ActiveSupport::Logger.broadcast(console))
24
-
25
- console
26
- end
27
-
28
- it "should behave correctly" do
29
- expect($stdout).to receive(:syswrite).with("Hello World\n") # yell
30
- expect($stdout).to receive(:write).with("Hello World\n") # logger
31
-
32
- yell.info "Hello World"
33
- end
34
-
35
- end
36
-
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
- require 'logger'
3
-
4
- describe "backwards compatible formatter" do
5
- let(:time) { Time.now }
6
- let(:formatter) { Yell::Formatter.new(Yell::DefaultFormat) }
7
- let(:logger) { Logger.new($stdout) }
8
-
9
- before do
10
- Timecop.freeze(time)
11
- logger.formatter = formatter
12
- end
13
-
14
- it "should format out the message correctly" do
15
- expect($stdout).to(
16
- receive(:write).with("#{time.iso8601} [ INFO] #{$$} : Hello World!\n")
17
- )
18
-
19
- logger.info "Hello World!"
20
- end
21
- end
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
- require 'logger'
3
-
4
- describe "backwards compatible level" do
5
- let(:logger) { Logger.new($stdout) }
6
-
7
- before do
8
- logger.level = level
9
- end
10
-
11
- context "with a Yell::Level instance" do
12
- let(:level) { Yell::Level.new(:error) }
13
-
14
- it "should format out the level correctly" do
15
- expect(logger.level).to eq(level.to_i)
16
- end
17
- end
18
-
19
- context "with a symbol", :pending => (RUBY_VERSION < "2.3") do
20
- let(:level) { :error }
21
-
22
- it "should format out the level correctly" do
23
- expect(logger.level).to eq(3)
24
- end
25
- end
26
-
27
- context "with an integer" do
28
- let(:level) { 2 }
29
-
30
- it "should format out the level correctly" do
31
- expect(logger.level).to eq(2)
32
- end
33
- end
34
-
35
-
36
- end
@@ -1,7 +0,0 @@
1
- test:
2
- :level: info
3
-
4
- :adapters:
5
- - :stdout
6
- - :stderr:
7
- :level: "gte.error"
@@ -1,56 +0,0 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
3
-
4
- ENV['YELL_ENV'] = 'test'
5
-
6
- require 'rspec/core'
7
- require 'rspec/expectations'
8
- require 'rspec/mocks'
9
- require 'rspec/its'
10
- require 'timecop'
11
-
12
- begin
13
- require 'byebug'
14
- rescue LoadError
15
- # do nothing
16
- end
17
-
18
- begin
19
- require 'coveralls'
20
- require 'simplecov'
21
-
22
- STDERR.puts "Running coverage..."
23
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
24
- SimpleCov::Formatter::HTMLFormatter,
25
- Coveralls::SimpleCov::Formatter
26
- ]
27
-
28
- SimpleCov.start do
29
- add_filter 'spec'
30
- end
31
- rescue LoadError
32
- # do nothing
33
- end
34
-
35
- require 'yell'
36
-
37
- RSpec.configure do |config|
38
- config.before :each do
39
- Yell::Repository.loggers.clear
40
-
41
- Dir[ fixture_path + "/*.log" ].each { |f| File.delete f }
42
- end
43
-
44
- config.after :each do
45
- Timecop.return # release time after each test
46
- end
47
-
48
-
49
- private
50
-
51
- def fixture_path
52
- File.expand_path( "fixtures", File.dirname(__FILE__) )
53
- end
54
-
55
- end
56
-
@@ -1,101 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "running Yell multi-threaded" do
4
- let( :threads ) { 100 }
5
- let( :range ) { (1..threads) }
6
-
7
- let( :filename ) { fixture_path + '/threaded.log' }
8
- let( :lines ) { `wc -l #{filename}`.to_i }
9
-
10
- context "one instance" do
11
- before do
12
- logger = Yell.new filename
13
-
14
- range.map do |count|
15
- Thread.new { 10.times { logger.info count } }
16
- end.each(&:join)
17
-
18
- sleep 0.5
19
- end
20
-
21
- it "should write all messages" do
22
- expect(lines).to eq(10*threads)
23
- end
24
- end
25
-
26
- # context "one instance per thread" do
27
- # before do
28
- # range.map do |count|
29
- # Thread.new do
30
- # logger = Yell.new( filename )
31
-
32
- # 10.times { logger.info count }
33
- # end
34
- # end.each(&:join)
35
-
36
- # sleep 0.5
37
- # end
38
-
39
- # it "should write all messages" do
40
- # lines.should == 10*threads
41
- # end
42
- # end
43
-
44
- context "one instance in the repository" do
45
- before do
46
- Yell[ 'threaded' ] = Yell.new( filename )
47
- end
48
-
49
- it "should write all messages" do
50
- range.map do |count|
51
- Thread.new { 10.times { Yell['threaded'].info count } }
52
- end.each(&:join)
53
-
54
- expect(lines).to eq(10*threads)
55
- end
56
- end
57
-
58
- context "multiple datefile instances" do
59
- let( :threadlist ) { [] }
60
- let( :date ) { Time.now }
61
-
62
- before do
63
- Timecop.freeze( date - 86400 )
64
-
65
- range.each do |count|
66
- threadlist << Thread.new do
67
- logger = Yell.new :datefile, :filename => filename, :keep => 2
68
- loop { logger.info :info; sleep 0.1 }
69
- end
70
- end
71
-
72
- sleep 0.3 # sleep to get some messages into the file
73
- end
74
-
75
- after do
76
- threadlist.each(&:kill)
77
- end
78
-
79
- it "should safely rollover" do
80
- # now cycle the days
81
- 7.times do |count|
82
- Timecop.freeze( date + 86400*count )
83
- sleep 0.3
84
-
85
- files = Dir[ fixture_path + '/*.*.log' ]
86
- expect(files.size).to eq(2)
87
-
88
- # files.last.should match( datefile_pattern_for(Time.now) ) # today
89
- # files.first.should match( datefile_pattern_for(Time.now-86400) ) # yesterday
90
- end
91
- end
92
- end
93
-
94
- private
95
-
96
- def datefile_pattern_for( time )
97
- time.strftime(Yell::Adapters::Datefile::DefaultDatePattern)
98
- end
99
-
100
- end
101
-