fluent-plugin-growthforecast 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fluent-plugin-growthforecast"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["TAGOMORI Satoshi"]
12
- s.date = "2012-12-04"
12
+ s.date = "2012-12-05"
13
13
  s.description = "Plugin to post numbers to GrowthForecast (by kazeburo)"
14
14
  s.email = "tagomoris@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -11,10 +11,6 @@ class Fluent::GrowthForecastOutput < Fluent::Output
11
11
  config_param :service, :string
12
12
  config_param :section, :string, :default => nil
13
13
 
14
- config_param :authentication, :string, :default => nil # nil or 'none' or 'basic'
15
- config_param :username, :string, :default => ''
16
- config_param :password, :string, :default => ''
17
-
18
14
  config_param :name_keys, :string, :default => nil
19
15
  config_param :name_key_pattern, :string, :default => nil
20
16
 
@@ -44,8 +40,6 @@ class Fluent::GrowthForecastOutput < Fluent::Output
44
40
  @name_key_pattern = Regexp.new(@name_key_pattern)
45
41
  end
46
42
 
47
- @authentication ||= 'none'
48
-
49
43
  @mode = case @mode
50
44
  when 'count' then :count
51
45
  when 'modified' then :modified
@@ -90,19 +84,8 @@ class Fluent::GrowthForecastOutput < Fluent::Output
90
84
 
91
85
  def post(tag, name, value)
92
86
  url = format_url(tag,name)
93
-
94
- uri = URI.parse(url)
95
- req = Net::HTTP::Post(uri.path)
96
- req.set_form_data({'number' => value.to_i.to_s, 'mode' => @mode.to_s})
97
- case @authentication
98
- when 'basic'
99
- req.basic_auth(@username, @password)
100
- end
101
-
102
87
  begin
103
- res = Net::HTTP.start(uri.host, uri.port) do |http|
104
- http.request(req)
105
- end
88
+ res = Net::HTTP.post_form(URI.parse(url), {'number' => value.to_i, 'mode' => @mode.to_s})
106
89
  rescue IOError, EOFError, SystemCallError
107
90
  # server didn't respond
108
91
  $log.warn "Net::HTTP.post_form raises exception: #{$!.class}, '#{$!.message}'"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-growthforecast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
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-12-04 00:00:00.000000000 Z
12
+ date: 2012-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -189,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: -3904779649461648706
192
+ hash: -1202506327029138940
193
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements: