fluent-plugin-serialport 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -1
- data/.travis.yml +4 -0
- data/License.txt +14 -0
- data/README.rdoc +3 -4
- data/Rakefile +13 -6
- data/fluent-plugin-serialport.gemspec +6 -3
- data/lib/fluent/plugin/in_serialport.rb +3 -1
- data/test/plugin/test_in_serialport.rb +1 -1
- data/test/test_helper.rb +2 -0
- metadata +59 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8c912ae5e6293bd0c0606e37e73c03abc48d4f6f
|
4
|
+
data.tar.gz: 5e67795e3d6520a52695ef0d4d850082af91a2f9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b62b32d6b67e3903abfc4bb7d95509dfbf812475fc88665339ec0b5b21163fde031b5d0cdd39bba907c2eada41ce5bafca1ee581ca75f48cc1bd8a8e7ab28b29
|
7
|
+
data.tar.gz: 59d84bcf7fba1131bcc9a922019717874fd814878b6599da33e63e319de8a369b831e9497108b8647f64e4452bf2e723bae44cf7b583217341608903b7bbbf02
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/License.txt
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright (c) 2012-2015 MATSUMOTO Katsuyoshi
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
14
|
+
|
data/README.rdoc
CHANGED
@@ -4,13 +4,12 @@ fluent-plugin-serialport provides input plugin for {Fluentd}[http://fluentd.org]
|
|
4
4
|
|
5
5
|
= Install
|
6
6
|
|
7
|
-
gem install fluent-plugin-serialport
|
7
|
+
gem install fluent-plugin-serialport
|
8
8
|
|
9
9
|
or
|
10
10
|
|
11
|
-
git clone git@github.com:katsyoshi/fluent-plugin-serialport.git
|
12
|
-
|
13
|
-
cp fluent-plugin-serialport/lib/fluent/plugin/flent-plugin-serial.rb ${FLUENT_DIR}/plugin/.
|
11
|
+
git clone git@github.com:katsyoshi/fluent-plugin-serialport.git
|
12
|
+
cp fluent-plugin-serialport/lib/fluent/plugin/flent-plugin-serial.rb ${FLUENT_DIR}/plugin/.
|
14
13
|
|
15
14
|
== Configuration
|
16
15
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
task :test do
|
4
|
+
require 'rake/testtask'
|
5
|
+
Rake::TestTask.new do |task|
|
6
|
+
task.libs << 'lib' << 'test'
|
7
|
+
task.pattern = 'test/**/test_*.rb'
|
8
|
+
task.verbose = true
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
|
-
task :
|
12
|
+
task :report do
|
13
|
+
require 'simplecov'
|
14
|
+
SimpleCov.start
|
15
|
+
end
|
16
|
+
|
17
|
+
task :default => [:test]
|
@@ -3,14 +3,14 @@ $:.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.0.
|
6
|
+
s.version = "0.0.3"
|
7
7
|
s.authors = ["MATSUMOTO Katsuyoshi"]
|
8
|
-
s.email = ["
|
8
|
+
s.email = ["github@katsyoshi.org"]
|
9
9
|
s.homepage = "https://github.com/katsyoshi/fluent-plugin-serialport"
|
10
10
|
s.summary = "fluentd plugin for serial port"
|
11
11
|
s.description = "fluentd plugin for serial port"
|
12
|
+
s.license = "Apache License, Version 2.0"
|
12
13
|
s.has_rdoc = false
|
13
|
-
# s.rubyforge_project = "fluent-plugin-serialport"
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -19,4 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
s.add_dependency "fluentd"
|
21
21
|
s.add_dependency "serialport"
|
22
|
+
s.add_development_dependency "simplecov"
|
23
|
+
s.add_development_dependency "test-unit"
|
24
|
+
s.add_development_dependency "rake"
|
22
25
|
end
|
@@ -5,6 +5,7 @@ class SerialPortInput < Input
|
|
5
5
|
config_param :baud_rate, :integer
|
6
6
|
config_param :tag, :string, :default => "serial"
|
7
7
|
config_param :eol, :string, :default => $/
|
8
|
+
config_param :include_time, :bool, :default => false
|
8
9
|
|
9
10
|
def initialize
|
10
11
|
require 'serialport'
|
@@ -30,7 +31,8 @@ class SerialPortInput < Input
|
|
30
31
|
loop do
|
31
32
|
unless @serial.closed?
|
32
33
|
begin
|
33
|
-
|
34
|
+
timenow = @include_time ? Time.now.to_s << ' ' : ''
|
35
|
+
data = {@device => timenow << @serial.readline(@eol)}
|
34
36
|
Engine.emit(@tag, Engine.now, data)
|
35
37
|
rescue
|
36
38
|
STDERR.puts caller()
|
@@ -18,7 +18,7 @@ class SerialPortInputTest < Test::Unit::TestCase
|
|
18
18
|
Fluent::Test::InputTestDriver.new(Fluent::SerialPortInput).configure(conf)
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def test_configure_test_driver
|
22
22
|
d = create_driver
|
23
23
|
assert_equal 'serialport', d.instance.com_port
|
24
24
|
assert_equal 9600, d.instance.baud_rate
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,96 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-serialport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- MATSUMOTO Katsuyoshi
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: fluentd
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: serialport
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: simplecov
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
44
81
|
- !ruby/object:Gem::Version
|
45
82
|
version: '0'
|
46
83
|
description: fluentd plugin for serial port
|
47
84
|
email:
|
48
|
-
-
|
85
|
+
- github@katsyoshi.org
|
49
86
|
executables: []
|
50
87
|
extensions: []
|
51
88
|
extra_rdoc_files: []
|
52
89
|
files:
|
53
|
-
- .gitignore
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
54
92
|
- Gemfile
|
93
|
+
- License.txt
|
55
94
|
- README.rdoc
|
56
95
|
- Rakefile
|
57
96
|
- fluent-plugin-serialport.gemspec
|
@@ -59,30 +98,29 @@ files:
|
|
59
98
|
- test/plugin/test_in_serialport.rb
|
60
99
|
- test/test_helper.rb
|
61
100
|
homepage: https://github.com/katsyoshi/fluent-plugin-serialport
|
62
|
-
licenses:
|
101
|
+
licenses:
|
102
|
+
- Apache License, Version 2.0
|
103
|
+
metadata: {}
|
63
104
|
post_install_message:
|
64
105
|
rdoc_options: []
|
65
106
|
require_paths:
|
66
107
|
- lib
|
67
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
109
|
requirements:
|
70
|
-
- -
|
110
|
+
- - ">="
|
71
111
|
- !ruby/object:Gem::Version
|
72
112
|
version: '0'
|
73
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
114
|
requirements:
|
76
|
-
- -
|
115
|
+
- - ">="
|
77
116
|
- !ruby/object:Gem::Version
|
78
117
|
version: '0'
|
79
118
|
requirements: []
|
80
119
|
rubyforge_project:
|
81
|
-
rubygems_version:
|
120
|
+
rubygems_version: 2.4.5
|
82
121
|
signing_key:
|
83
|
-
specification_version:
|
122
|
+
specification_version: 4
|
84
123
|
summary: fluentd plugin for serial port
|
85
124
|
test_files:
|
86
125
|
- test/plugin/test_in_serialport.rb
|
87
126
|
- test/test_helper.rb
|
88
|
-
has_rdoc: false
|