slack_log_device 2.1.1 → 2.1.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: e489a5ee3f73f7e9e12d6ec7b7c0fd0c4013b768
4
- data.tar.gz: e209bf2e8df911376b3b0624dfeb75986b25970e
3
+ metadata.gz: feb18f4dd60aea4737970379437c978db6e095af
4
+ data.tar.gz: 25a301a2cefb6dd06848f7dc61b2690ae4737e30
5
5
  SHA512:
6
- metadata.gz: f3ca47f4d8f1d983e0750e4314d7e9cfcf4930fce71d93edaa6c0f5bd5535ad2eacc0eed2476cb3536a1dc00dc902ee720bfa63801e44b8e7783e913634379db
7
- data.tar.gz: d24fce09e62726004440dca80ff5dd6ce9be076a0118864f1e813c5f89f337ce8628ffeb6cea0d6fec45e14d0999169987814ce3a621ed97ca06a88881c69906
6
+ metadata.gz: bec1c9a67055026237bb21214d70b6bdea7986a095d40d9d4f1c77af636543cba943f481e60832418f5936a5f6b6847c823205a5d33ae4abbbc04d8c35e76a97
7
+ data.tar.gz: 8f04f820add55f2b4567355280d8542f37c554149602f9fb15171b5e28582bf91c53e7b6278aedcdf4ca95b793b748736ff5719b79261a46cee5d2e5cef6a391
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/hash'
2
+ require 'active_support/core_ext/integer'
2
3
  require 'active_support/core_ext/string'
3
4
  require 'httparty'
4
5
  require 'logger'
@@ -15,7 +16,7 @@ class SlackLogDevice
15
16
  self.auto_flush = options[:auto_flush]
16
17
  self.channel = options[:channel]
17
18
  self.flush_delay = options.key?(:flush_delay) ? options[:flush_delay] : 1
18
- self.max_buffer_size = options.key?(:max_buffer_size) ? options[:max_buffer_size] : 8192
19
+ self.max_buffer_size = options.key?(:max_buffer_size) ? options[:max_buffer_size] : 1024 * 128
19
20
  self.timeout = options.key?(:timeout) ? options[:timeout] : 5
20
21
  self.username = options[:username]
21
22
  self.webhook_url = options[:webhook_url]
@@ -52,7 +53,7 @@ class SlackLogDevice
52
53
  data['username'] = username if username.present?
53
54
  begin
54
55
  HTTParty.post(webhook_url, body: data.to_json, headers: { 'Content-Type': 'application/json' }, timeout: timeout)
55
- rescue => e
56
+ rescue Exception => e
56
57
  STDERR.puts(e)
57
58
  end
58
59
  nil
@@ -247,8 +247,8 @@ describe SlackLogDevice do
247
247
 
248
248
  describe '#max_buffer_size' do
249
249
 
250
- it 'is 8192 by default' do
251
- expect(device.max_buffer_size).to eq(8192)
250
+ it 'is 128 kilobytes by default' do
251
+ expect(device.max_buffer_size).to eq(1024 * 128)
252
252
  end
253
253
 
254
254
  it 'can be specified' do
@@ -296,7 +296,7 @@ describe SlackLogDevice do
296
296
  it 'can be set' do
297
297
  expect {
298
298
  device.max_buffer_size = 1024
299
- }.to change { device.max_buffer_size }.from(8192).to(1024)
299
+ }.to change { device.max_buffer_size }.from(1024 * 128).to(1024)
300
300
  end
301
301
 
302
302
  end
@@ -512,6 +512,16 @@ describe SlackLogDevice do
512
512
  expect(logdev).to be_a(Logger::LogDevice)
513
513
  end
514
514
 
515
+ describe '#dev' do
516
+
517
+ let(:dev) { logdev.dev }
518
+
519
+ it 'is SlackLogDevice instance' do
520
+ expect(dev).to be(device)
521
+ end
522
+
523
+ end
524
+
515
525
  describe '#filename' do
516
526
 
517
527
  it 'is nil' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_log_device
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport