fluent-plugin-serialport 0.1.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba4f2e4c7d56244479db582ef6965d322b4c725a
4
- data.tar.gz: bdec7475b49599dfe44509de28a2d3dd73ed796e
3
+ metadata.gz: 1d30caee6ecd937883c1072505107f41f207b65c
4
+ data.tar.gz: 4cbc230c9d0aa38738dd596380728901be04dc6e
5
5
  SHA512:
6
- metadata.gz: dd753c46fc9106340bd8f5bb052403d9a4ca28c1c2c12ab787031572ebb9698b3680cf91678d968449c0561b8a6394da61d8cb974e7a9057e98bd842f02a8e11
7
- data.tar.gz: fc41a0f672b0151b4d21ae5bc35bc66ce7b8feeb54e156903b91775ad46e5930da9c1b30dbba7c7411fde8e145d0a57f6d79b25544d0ea5abaf87b11ed650ec4
6
+ metadata.gz: 596feb2a869f42ccd0af4d5cdd8f0c0e24aaca53254dbede892b646dab121a7e18118c9976b4627a39dbf3c9148f923a53facf2bcdcf42c8eef8a39f99ee981b
7
+ data.tar.gz: cff51fcecc7eaba5e901d13ac843ee64bb6a43e87fe343d3fd42b6670668e65b778c2888fadce3e09fd2b18639ffd330e56be3ceac37ecfd302eafbae9cad0b7
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.5
4
- - 2.2.2
3
+ - 2.1
4
+ - 2.2
5
+ - 2.3.4
6
+ - 2.4.1
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-serialport"
6
- s.version = "0.1.0"
6
+ s.version = "0.14.0"
7
7
  s.authors = ["MATSUMOTO Katsuyoshi"]
8
8
  s.email = ["github@katsyoshi.org"]
9
9
  s.homepage = "https://github.com/katsyoshi/fluent-plugin-serialport"
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency "fluentd"
20
+ s.add_dependency "fluentd", ">= 0.14", "< 2"
21
21
  s.add_dependency "serialport"
22
22
  s.add_development_dependency "simplecov"
23
23
  s.add_development_dependency "test-unit"
@@ -1,19 +1,17 @@
1
1
  require 'fluent/input'
2
- module Fluent
3
- class SerialPortInput < Input
4
- Plugin.register_input('serialport', self)
5
- config_param :com_port, :string
6
- config_param :baud_rate, :integer
7
- config_param :tag, :string, :default => "serial"
8
- config_param :eol, :string, :default => $/
9
- config_param :include_time, :bool, :default => false
2
+ require 'serialport'
10
3
 
11
- define_method("router") { Fluent::Engine } unless method_defined?(:router)
4
+ module Fluent::Plugin
5
+ class SerialPortInput < Fluent::Plugin::Input
6
+ Fluent::Plugin.register_input('serialport', self)
12
7
 
13
- def initialize
14
- require 'serialport'
15
- super
16
- end
8
+ helpers :thread
9
+
10
+ config_param :com_port, :string
11
+ config_param :baud_rate, :integer
12
+ config_param :tag, :string, default: "serial"
13
+ config_param :eol, :string, default: $/
14
+ config_param :include_time, :bool, default: false
17
15
 
18
16
  def configure(conf)
19
17
  super
@@ -21,13 +19,14 @@ class SerialPortInput < Input
21
19
  end
22
20
 
23
21
  def start
22
+ super
24
23
  @serial = SerialPort.new(@com_port, @baud_rate, 8, 1, SerialPort::NONE)
25
- @thread = Thread.new(&method(:run))
24
+ thread_create(:in_serialport, &method(:run))
26
25
  end
27
26
 
28
27
  def shutdown
29
28
  @serial.close
30
- @thread.join
29
+ super
31
30
  end
32
31
 
33
32
  def run
@@ -38,7 +37,7 @@ class SerialPortInput < Input
38
37
  data = {@device => timenow << @serial.readline(@eol)}
39
38
  router.emit(@tag, Engine.now, data)
40
39
  rescue
41
- STDERR.puts caller()
40
+ $stderr.puts(caller) unless stopped?
42
41
  break
43
42
  end
44
43
  end
@@ -1,9 +1,8 @@
1
- require 'fluent/test'
1
+ require 'test_helper'
2
2
 
3
3
  class SerialPortInputTest < Test::Unit::TestCase
4
4
  def setup
5
5
  Fluent::Test.setup
6
- require 'fluent/plugin/in_serialport'
7
6
  end
8
7
 
9
8
  CONFIG = %[
@@ -15,7 +14,7 @@ class SerialPortInputTest < Test::Unit::TestCase
15
14
  ]
16
15
 
17
16
  def create_driver(conf=CONFIG)
18
- Fluent::Test::InputTestDriver.new(Fluent::SerialPortInput).configure(conf)
17
+ Fluent::Test::Driver::Input.new(Fluent::Plugin::SerialPortInput).configure(conf)
19
18
  end
20
19
 
21
20
  def test_configure_test_driver
@@ -1,30 +1,12 @@
1
- require 'bundler'
1
+ require 'bundler/setup'
2
2
  require 'simplecov'
3
3
  SimpleCov.start
4
4
 
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
5
  require 'test/unit'
13
6
 
14
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ $LOAD_PATH.unshift(File.join(__dir__, '..', 'lib'))
8
+ $LOAD_PATH.unshift(__dir__)
16
9
  require 'fluent/test'
17
- unless ENV.has_key?('VERBOSE')
18
- nulllogger = Object.new
19
- nulllogger.instance_eval {|obj|
20
- def method_missing(method, *args)
21
- # pass
22
- end
23
- }
24
- $log = nulllogger
25
- end
10
+ require 'fluent/test/driver/input'
26
11
 
27
12
  require 'fluent/plugin/in_serialport'
28
-
29
- class Test::Unit::TestCase
30
- end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-serialport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MATSUMOTO Katsuyoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-24 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.14'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '0'
29
+ version: '0.14'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: serialport
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -117,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
123
  version: '0'
118
124
  requirements: []
119
125
  rubyforge_project:
120
- rubygems_version: 2.5.2
126
+ rubygems_version: 2.6.11
121
127
  signing_key:
122
128
  specification_version: 4
123
129
  summary: fluentd plugin for serial port