flnt 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flnt.rb +2 -2
- data/lib/flnt/configuration.rb +3 -0
- data/lib/flnt/version.rb +1 -1
- data/spec/lib/flnt/configuration_spec.rb +10 -0
- data/spec/lib/flnt_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b2acd326993c550068ab0e17c5785fdc519eed
|
4
|
+
data.tar.gz: aa3550730b3576dde36bbdfbaaa45fb2bc787733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 278588d6e9cd876ae04bd1b109294bb87a94b618298e5b3cbe892d5944691b34a58cf3d76a04adffeee3d5a39d49f1523e40dfd1ed8d4c3f2766babf35c0ba40
|
7
|
+
data.tar.gz: c42b2a84703cc3597d2e17bede59560e7af9fc9eb7023e58c68d4400aa5912256bcafa94f7ff9eaffb5ccc41121fe141ed7c110c4f1347d5ca95cafff3b37f14
|
data/lib/flnt.rb
CHANGED
@@ -28,8 +28,8 @@ module Flnt
|
|
28
28
|
!! @initialized
|
29
29
|
end
|
30
30
|
|
31
|
-
def initialize!
|
32
|
-
if !initialized? and !test_mode?
|
31
|
+
def initialize!(force=false)
|
32
|
+
if force or ( !initialized? and !test_mode? )
|
33
33
|
@initialized = true
|
34
34
|
Fluent::Logger::FluentLogger.open(*Flnt::Configuration())
|
35
35
|
end
|
data/lib/flnt/configuration.rb
CHANGED
data/lib/flnt/version.rb
CHANGED
@@ -31,6 +31,16 @@ describe "Flnt::Configuration" do
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
+
it "should be force to hook Flint.initialize!(true)" do
|
35
|
+
allow(Flnt).to receive(:initialized?).and_return(true)
|
36
|
+
expect(Fluent::Logger::FluentLogger).to receive(:open)
|
37
|
+
expect(Flnt).to receive(:Configuration)
|
38
|
+
|
39
|
+
Flnt::Configuration.configure do |c|
|
40
|
+
c.host = 'fluentd.example.jp'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
34
44
|
after do
|
35
45
|
Flnt::Configuration.instance_eval do
|
36
46
|
@host = nil
|
data/spec/lib/flnt_spec.rb
CHANGED
@@ -26,6 +26,14 @@ describe "Flnt" do
|
|
26
26
|
Flnt.init_foo
|
27
27
|
end
|
28
28
|
|
29
|
+
it "should be able to force to initialize fluentd connection" do
|
30
|
+
allow(Flnt).to receive(:initialized?).and_return(true)
|
31
|
+
|
32
|
+
expect(Fluent::Logger::FluentLogger).to receive(:open)
|
33
|
+
expect(Flnt).to receive(:Configuration)
|
34
|
+
Flnt.initialize!(true)
|
35
|
+
end
|
36
|
+
|
29
37
|
it "should return Flnt::Logger tagged with called method name" do
|
30
38
|
ret = Flnt.init_foo
|
31
39
|
expect(ret.instance_eval { @tag }).to eq "init_foo"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flnt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uchio KONDO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluent-logger
|