datalogger 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,13 +20,16 @@ module DataLogger
20
20
  end
21
21
 
22
22
  if blk
23
+ ret = nil
23
24
  start = Time.now
24
25
  log_to_sinks(data.merge at: 'start')
25
- yield
26
+ ret = yield
26
27
  log_to_sinks(data.merge at: 'finish', elapsed: (Time.now - start))
28
+ ret
27
29
  else
28
30
  log_to_sinks(data)
31
+ nil
29
32
  end
30
33
  end
31
34
  end
32
- end
35
+ end
@@ -14,4 +14,4 @@ module DataLogger
14
14
  end
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module DataLogger
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/datalogger.rb CHANGED
@@ -1,6 +1,3 @@
1
1
  require "datalogger/version"
2
2
  require "datalogger/logger"
3
- require "datalogger/sinks/stdout"
4
-
5
- module DataLogger
6
- end
3
+ require "datalogger/sinks/stdout"
data/spec/logger_spec.rb CHANGED
@@ -4,5 +4,18 @@ require 'minitest/autorun'
4
4
  require 'datalogger'
5
5
 
6
6
  describe DataLogger::Logger do
7
- it "must have some tests ;-)"
7
+ it "must respond to component" do
8
+ l = DataLogger::Logger.new
9
+ l.respond_to?(:component).must_equal(true)
10
+ end
11
+
12
+ it "must set component to 'app' by default" do
13
+ l = DataLogger::Logger.new
14
+ l.component.must_equal('app')
15
+ end
16
+
17
+ it "must allow for component to be set" do
18
+ l = DataLogger::Logger.new('non-default')
19
+ l.component.must_equal('non-default')
20
+ end
8
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datalogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-21 00:00:00.000000000Z
12
+ date: 2012-01-25 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Easy to use structured data logger
15
15
  email:
@@ -28,7 +28,6 @@ files:
28
28
  - lib/datalogger/sinks/stdout.rb
29
29
  - lib/datalogger/version.rb
30
30
  - spec/logger_spec.rb
31
- - spec/stdout_sink_spec.rb
32
31
  homepage: https://github.com/gorsuch/datalogger
33
32
  licenses: []
34
33
  post_install_message:
@@ -55,4 +54,3 @@ specification_version: 3
55
54
  summary: Structurd data logger
56
55
  test_files:
57
56
  - spec/logger_spec.rb
58
- - spec/stdout_sink_spec.rb
File without changes