fluent-plugin-geoblipper 0.0.4.4 → 0.0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-geoblipper"
4
- gem.version = "0.0.4.4"
4
+ gem.version = "0.0.4.5"
5
5
  gem.authors = ["Sean Dick", "Change.org"]
6
6
  gem.email = ["sean@change.org"]
7
7
  gem.homepage = "https://github.com/seanmdick/fluent-plugin-geoblipper"
@@ -13,6 +13,7 @@ class Fluent::GeoBlipperOutput < Fluent::BufferedOutput
13
13
  config_param :geodata_location, :string
14
14
  config_param :max_entries, :integer, :default => -1
15
15
  config_param :ip_key, :string, :default => 'ip'
16
+ config_param :debug, :boolean, :default => false
16
17
 
17
18
  def start
18
19
  super
@@ -27,7 +28,7 @@ class Fluent::GeoBlipperOutput < Fluent::BufferedOutput
27
28
  if loc
28
29
  record.merge({latitude: loc.latitude, longitude: loc.longitude}).to_json + "\n"
29
30
  else
30
- # Fluent::Engine.emit('debug.livemap', Time.now, {message: "geodata not found for #{address}"})
31
+ Fluent::Engine.emit('debug.livemap', Time.now, {message: "geodata not found for #{address}"})
31
32
  ''
32
33
  end
33
34
  end
@@ -37,7 +38,11 @@ class Fluent::GeoBlipperOutput < Fluent::BufferedOutput
37
38
  items = io.read.split("\n")
38
39
  entries = items.slice(0..@max_entries).map {|item| JSON.parse(item) }
39
40
  unless entries.empty?
40
- @pubnub.publish(http_sync: true, message: entries, channel: @pubnub_channel)
41
+ unless @debug
42
+ @pubnub.publish(http_sync: true, message: entries, channel: @pubnub_channel)
43
+ else
44
+ Fluent::Engine.emit('debug.pubnub', Time.now, {message: entries, channel: @pubnub_channel})
45
+ end
41
46
  end
42
47
  end
43
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-geoblipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.4
4
+ version: 0.0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-26 00:00:00.000000000 Z
13
+ date: 2015-11-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd