datalogger 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ module DataLogger
5
5
  def initialize(component='app')
6
6
  self.component = component
7
7
  self.sinks = []
8
- self.sinks << STDOUTSink.new
8
+ self.sinks << Sinks::STDOUT.new
9
9
  end
10
10
 
11
11
  def log_to_sinks(data)
@@ -0,0 +1,17 @@
1
+ module DataLogger
2
+ module Sinks
3
+ class STDOUT
4
+ def initialize(sync=true)
5
+ ::STDOUT.sync = sync
6
+ end
7
+
8
+ def stringify_data(data)
9
+ data.inject("") { |s, (k,v)| s + "#{k}=#{v} " }.strip
10
+ end
11
+
12
+ def log(component, data)
13
+ puts "#{component} #{stringify_data(data)}"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module DataLogger
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/datalogger.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "datalogger/version"
2
2
  require "datalogger/logger"
3
- require "datalogger/stdout_sink"
3
+ require "datalogger/sinks/stdout"
4
4
 
5
5
  module DataLogger
6
6
  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.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -25,7 +25,7 @@ files:
25
25
  - datalogger.gemspec
26
26
  - lib/datalogger.rb
27
27
  - lib/datalogger/logger.rb
28
- - lib/datalogger/stdout_sink.rb
28
+ - lib/datalogger/sinks/stdout.rb
29
29
  - lib/datalogger/version.rb
30
30
  - spec/logger_spec.rb
31
31
  - spec/stdout_sink_spec.rb
@@ -1,15 +0,0 @@
1
- module DataLogger
2
- class STDOUTSink
3
- def initialize(sync=true)
4
- STDOUT.sync = sync
5
- end
6
-
7
- def stringify_data(data)
8
- data.inject("") { |s, (k,v)| s + "#{k}=#{v} " }.strip
9
- end
10
-
11
- def log(component, data)
12
- puts "#{component} #{stringify_data(data)}"
13
- end
14
- end
15
- end