lenjador 2.2.2 → 2.3.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: 26f40334235faaeecd2b8f1e960641c98d7926be963cb485d57b5db7476abd9d
4
- data.tar.gz: 9417049506b81464afd16c050a72c0c9af8e4078c5b361aededb74c2fca2c117
3
+ metadata.gz: 8fe741ce777af0426bec161a4c4bdddc3a6272c058289ba3d915dcb751fefeea
4
+ data.tar.gz: b68b01d171d613e15d789275e1f6b8666e6a480b2fecd5d23488f53d4f5e4c3a
5
5
  SHA512:
6
- metadata.gz: 1005262582ae1ec5bc03445af4346f6011a5e32c553cdd86469dbcf9d380d8114a995f53649bd398d09674e145e023821e6717b70914f04bf5f96b5ec5429b00
7
- data.tar.gz: ed3a7f3f6afc47cc7e431217c1c103bd290d3a9bd51f2e8bc0a94e5fd8fa6cf8d6de538a89a4eb1834d5c938987aa0fbe2be23530b7e48761936a6e6e60c5a85
6
+ metadata.gz: 73e65b430535a9f751746029beb9a7007b93694808543f079ff9732ff2a473824283ad31c6b86310bbd6dc1756de887b4a0575118813c1247afa04f6da950a48
7
+ data.tar.gz: a4c2975ac2a4445fcf763eb76eaaa1b7bef46ed8d3e22606d63c2b2d9fb49de74de7c8e5d53607df35667632b1e3446a74ef46934785bfc8dc66e058f49fd1ac
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lenjador (2.2.2)
4
+ lenjador (2.3.0)
5
5
  lru_redux
6
6
  oj (~> 3.6)
7
7
 
data/lenjador.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = 'lenjador'
8
- gem.version = '2.2.2'
8
+ gem.version = '2.3.0'
9
9
  gem.authors = ['Salemove']
10
10
  gem.email = ['support@salemove.com']
11
11
  gem.description = "It's lenjadoric"
data/lib/lenjador.rb CHANGED
@@ -28,6 +28,11 @@ class Lenjador
28
28
  @preprocessors = preprocessors
29
29
  end
30
30
 
31
+ def add(severity, *args, &block)
32
+ level = SEV_LABEL.index(severity.to_s)
33
+ log(level, *args, &block)
34
+ end
35
+
31
36
  def debug(*args, &block)
32
37
  log(Severity::DEBUG, *args, &block)
33
38
  end
@@ -37,6 +37,20 @@ describe Lenjador do
37
37
  end
38
38
  end
39
39
 
40
+ describe '#add' do
41
+ let(:adapter) { double }
42
+ let(:lenjador) { described_class.new(adapter, Lenjador::Severity::INFO, []) }
43
+
44
+ it 'logs with severity' do
45
+ expect(adapter).to receive(:log).with(described_class::Severity::INFO, message: 'info-msg').ordered
46
+ expect(adapter).to receive(:log).with(described_class::Severity::WARN, message: 'warn-msg').ordered
47
+
48
+ lenjador.add('debug', 'debug-msg')
49
+ lenjador.add('info', 'info-msg')
50
+ lenjador.add('warn', 'warn-msg')
51
+ end
52
+ end
53
+
40
54
  context 'when preprocessor defined' do
41
55
  let(:lenjador) { described_class.new(adapter, level, [preprocessor]) }
42
56
  let(:adapter) { double }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lenjador
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salemove
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lru_redux