yell-adapters-gelf 2.0.0 → 2.0.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: 677b6910aecfd33721a24f884185e2cf4e3a61a4
4
- data.tar.gz: d58f6268acd53a1a99290cba4baf08aa37cc1b0d
3
+ metadata.gz: d170e814b9f170402881a84e5c6ffd9a64c74796
4
+ data.tar.gz: befca3e31f26195a816fc2ce640695491843da3d
5
5
  SHA512:
6
- metadata.gz: 02a53e6a1cf49307ca6f408f7c51359606d8c25e3bceccd094ceb0570defb625e3cfad9fd2a88546ee81ca65e430a3cd5f478516e1c230cb6cc876ff7831b2bc
7
- data.tar.gz: 237c36afe90050199475f04067333c290803452f82e7754eddd0399ff4b80d5928a41647ddee8d9fce5028bff27f2a663851141a49ff5a593f457fecbe960f7f
6
+ metadata.gz: 82dd0d73817bebc6424feb5fc9f87d9a27d3671e2a04dd2f0fbc1b510a2efba5a55e558b399a9425b5f0f592f7dd3a0a2e13a884abe79a718dd4ac21a53c9bc3
7
+ data.tar.gz: af493d023d91b85c82f4bf79b57c2a725ae073c6806dca46d2362ac96df05da84f6633667c9c4f2cf56fdd5d18e867e2d2930838b17d20bfe2ec78a0e648cdcd
data/.travis.yml CHANGED
@@ -1,15 +1,15 @@
1
1
  language: ruby
2
2
 
3
- script: "rake"
3
+ script: "rspec"
4
4
 
5
5
  rvm:
6
6
  - 1.8.7
7
- - 1.9.2
8
7
  - 1.9.3
8
+ - 2.0.0
9
+ - 2.1.1
9
10
  - jruby-18mode
10
11
  - jruby-19mode
11
- - rbx-18mode
12
- # - rbx-19mode
12
+ - rbx-2
13
13
  - ree
14
14
 
15
15
  notifications:
data/Gemfile CHANGED
@@ -6,7 +6,8 @@ gemspec
6
6
  group :development, :test do
7
7
  gem "rake"
8
8
 
9
- gem "rspec"
9
+ gem "rspec-core", '~> 2'
10
+ gem 'rspec-expectations', '~> 2'
10
11
  gem "rr"
11
12
  end
12
13
 
data/Rakefile CHANGED
@@ -1,22 +1,2 @@
1
- $:.unshift( 'lib' )
2
-
3
- require 'bundler'
4
- Bundler::GemHelper.install_tasks
5
-
6
- # === RSpec
7
- begin
8
- require 'rspec/core/rake_task'
9
-
10
- desc "Run specs"
11
- RSpec::Core::RakeTask.new do |t|
12
- t.rspec_opts = %w(--color --format progress --order random)
13
- t.ruby_opts = %w(-w)
14
- end
15
- rescue LoadError
16
- task :spec do
17
- abort "`gem install rspec` in order to run tests"
18
- end
19
- end
20
-
21
- task :default => :spec
1
+ require "bundler/gem_tasks"
22
2
 
@@ -49,13 +49,13 @@ module Yell #:nodoc:
49
49
  @sender = nil
50
50
  @uid = 0
51
51
 
52
- self.facility = options.fetch(:facility, 'yell')
52
+ self.facility = Yell.__fetch__(options, :facility, :default => 'yell')
53
53
 
54
54
  # initialize the UDP Sender
55
- self.host = options.fetch(:host, 'localhost')
56
- self.port = options.fetch(:port, 12201)
55
+ self.host = Yell.__fetch__(options, :host, :default => 'localhost')
56
+ self.port = Yell.__fetch__(options, :port, :default => 12201)
57
57
 
58
- self.max_chunk_size = options.fetch(:max_chunk_size, :wan)
58
+ self.max_chunk_size = Yell.__fetch__(options, :max_chunk_size, :default => :wan)
59
59
  end
60
60
 
61
61
  write do |event|
@@ -151,17 +151,17 @@ module Yell #:nodoc:
151
151
  when Hash
152
152
  message
153
153
  when Exception
154
- { "short_message" => "#{message.class}: #{message.message}" }.tap do |m|
155
- m.merge!( "long_message" => message.backtrace.join("\n") ) if message.backtrace
154
+ {"short_message" => "#{message.class}: #{message.message}"}.tap do |m|
155
+ m.merge!("long_message" => message.backtrace.join("\n")) if message.backtrace
156
156
  end
157
- else { "short_message" => message.to_s }
157
+ else {"short_message" => message.to_s}
158
158
  end
159
159
  end
160
160
 
161
161
  end
162
162
 
163
- register( :gelf, Yell::Adapters::Gelf )
164
- register( :graylog2, Yell::Adapters::Gelf )
163
+ register(:gelf, Yell::Adapters::Gelf)
164
+ register(:graylog2, Yell::Adapters::Gelf)
165
165
 
166
166
  end
167
167
  end
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,8 @@ $:.unshift File.expand_path('../../lib', __FILE__)
3
3
 
4
4
  require 'yell-adapters-gelf'
5
5
 
6
- require 'rspec'
6
+ require 'rspec/core'
7
+ require 'rspec/expectations'
7
8
  require 'rr'
8
9
 
9
10
  RSpec.configure do |config|
@@ -27,22 +27,55 @@ describe Yell::Adapters::Gelf do
27
27
  its(:max_chunk_size) { should == 1420 }
28
28
  end
29
29
 
30
+ context :facility do
31
+ subject { adapter.facility }
32
+
33
+ context "from initialize options" do
34
+ let(:adapter) { Yell::Adapters::Gelf.new('facility' => 'facility') }
35
+
36
+ it { should == 'facility' }
37
+ end
38
+
39
+ context "from accessor" do
40
+ let(:adapter) { Yell::Adapters::Gelf.new }
41
+ before { adapter.facility = 'facility' }
42
+
43
+ it { should == 'facility' }
44
+ end
45
+ end
46
+
30
47
  context :host do
31
- let(:adapter) { Yell::Adapters::Gelf.new }
32
48
  subject { adapter.host }
33
49
 
34
- before { adapter.host = 'hostname' }
50
+ context "from initialize options" do
51
+ let(:adapter) { Yell::Adapters::Gelf.new('host' => 'hostname') }
52
+
53
+ it { should == 'hostname' }
54
+ end
55
+
56
+ context "from accessor" do
57
+ let(:adapter) { Yell::Adapters::Gelf.new }
58
+ before { adapter.host = 'hostname' }
35
59
 
36
- it { should == 'hostname' }
60
+ it { should == 'hostname' }
61
+ end
37
62
  end
38
63
 
39
64
  context :port do
40
- let(:adapter) { Yell::Adapters::Gelf.new }
41
65
  subject { adapter.port }
42
66
 
43
- before { adapter.port = 1234 }
67
+ context "from initialize options" do
68
+ let(:adapter) { Yell::Adapters::Gelf.new('port' => 1234) }
69
+
70
+ it { should == 1234 }
71
+ end
72
+
73
+ context "from accessor" do
74
+ let(:adapter) { Yell::Adapters::Gelf.new }
75
+ before { adapter.port = 1234 }
44
76
 
45
- it { should == 1234 }
77
+ it { should == 1234 }
78
+ end
46
79
  end
47
80
 
48
81
  context :max_chunk_size do
@@ -59,7 +92,7 @@ describe Yell::Adapters::Gelf do
59
92
  it { should == 8154 }
60
93
  end
61
94
 
62
- context :other do
95
+ context 'other'do
63
96
  before { adapter.max_chunk_size = "1234" }
64
97
  it { should == 1234 }
65
98
  end
@@ -88,7 +121,13 @@ describe Yell::Adapters::Gelf do
88
121
  end
89
122
 
90
123
  it "should be zipped" do
91
- datagrams[0][0..1].bytes.should == [0x78, 0x9C] # zlib header
124
+ expected = "\x78\x9c" # zlib header
125
+
126
+ if RUBY_VERSION[0, 1].to_i >= 2
127
+ expected = expected.b
128
+ end
129
+
130
+ datagrams[0][0..1].should == expected
92
131
  end
93
132
  end
94
133
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "yell-adapters-gelf"
5
- s.version = "2.0.0"
5
+ s.version = "2.0.1"
6
6
  s.authors = ["Rudolf Schmidt"]
7
7
 
8
8
  s.homepage = "http://rubygems.org/gems/yell"
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_runtime_dependency "yell", "~> 2.0"
20
+ s.add_runtime_dependency "yell", ">= 2.0.4", "< 3"
21
21
  s.add_runtime_dependency "json"
22
22
  end
23
23
 
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yell-adapters-gelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rudolf Schmidt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-28 00:00:00.000000000 Z
11
+ date: 2014-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yell
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.4
20
+ - - <
18
21
  - !ruby/object:Gem::Version
19
- version: '2.0'
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.4
30
+ - - <
25
31
  - !ruby/object:Gem::Version
26
- version: '2.0'
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: json
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
80
  version: '0'
75
81
  requirements: []
76
82
  rubyforge_project: yell
77
- rubygems_version: 2.0.6
83
+ rubygems_version: 2.2.2
78
84
  signing_key:
79
85
  specification_version: 4
80
86
  summary: Yell - Your Extensible Logging Library