embulk-input-lkqd 0.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dffec9445784f4667ccb1e7c3e9b55667102fdaa
4
+ data.tar.gz: 9ff4d2c48b900585e887b1f9bb30fcf9e3f5e4ee
5
+ SHA512:
6
+ metadata.gz: b01226178d7293fbc8486120e14c6a17775e1ce3e71df00691d0a7c1c791157f1709a57239bb674494c358939bb3a7730135e296a81cb0b81207396d68bb62b7
7
+ data.tar.gz: f92899f48bdf0e2347da43087075bc51f7f3d9641846c25c0e30a5cb1d180da4d8fa66d46447f28dc65ff0a61463b41deb259e4cc3cc5d83dc3638737ac41229
@@ -0,0 +1,5 @@
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ /.bundle/
5
+ /Gemfile.lock
@@ -0,0 +1 @@
1
+ jruby-9.1.5.0
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org/'
2
+ gemspec
@@ -0,0 +1,21 @@
1
+
2
+ MIT License
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,32 @@
1
+ # Lkqd input plugin for Embulk
2
+
3
+ TODO: Write short description here and embulk-input-lkqd.gemspec file.
4
+
5
+ ## Overview
6
+
7
+ * **Plugin type**: input
8
+ * **Resume supported**: yes
9
+ * **Cleanup supported**: yes
10
+ * **Guess supported**: no
11
+
12
+ ## Configuration
13
+
14
+ - **option1**: description (integer, required)
15
+ - **option2**: description (string, default: `"myvalue"`)
16
+ - **option3**: description (string, default: `null`)
17
+
18
+ ## Example
19
+
20
+ ```yaml
21
+ in:
22
+ type: lkqd
23
+ option1: example1
24
+ option2: example2
25
+ ```
26
+
27
+
28
+ ## Build
29
+
30
+ ```
31
+ $ rake
32
+ ```
@@ -0,0 +1,3 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task default: :build
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "embulk-input-lkqd"
3
+ spec.version = "0.0.0"
4
+ spec.authors = ["Ming Liu"]
5
+ spec.summary = "LKQD input plugin for Embulk"
6
+ spec.description = "Loads reporting data from LKQD API."
7
+ spec.email = ["liuming@lmws.net"]
8
+ spec.licenses = ["MIT"]
9
+ # TODO set this: spec.homepage = "https://github.com//embulk-input-lkqd"
10
+
11
+ spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
12
+ spec.test_files = spec.files.grep(%r{^(test|spec)/})
13
+ spec.require_paths = ["lib"]
14
+
15
+ #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
16
+ spec.add_development_dependency 'embulk', ['>= 0.8.28']
17
+ spec.add_development_dependency 'bundler', ['>= 1.10.6']
18
+ spec.add_development_dependency 'rake', ['>= 10.0']
19
+ end
@@ -0,0 +1,59 @@
1
+ module Embulk
2
+ module Input
3
+
4
+ class Lkqd < InputPlugin
5
+ Plugin.register_input("lkqd", self)
6
+
7
+ def self.transaction(config, &control)
8
+ # configuration code:
9
+ task = {
10
+ "option1" => config.param("option1", :integer), # integer, required
11
+ "option2" => config.param("option2", :string, default: "myvalue"), # string, optional
12
+ "option3" => config.param("option3", :string, default: nil), # string, optional
13
+ }
14
+
15
+ columns = [
16
+ Column.new(0, "example", :string),
17
+ Column.new(1, "column", :long),
18
+ Column.new(2, "value", :double),
19
+ ]
20
+
21
+ resume(task, columns, 1, &control)
22
+ end
23
+
24
+ def self.resume(task, columns, count, &control)
25
+ task_reports = yield(task, columns, count)
26
+
27
+ next_config_diff = {}
28
+ return next_config_diff
29
+ end
30
+
31
+ # TODO
32
+ # def self.guess(config)
33
+ # sample_records = [
34
+ # {"example"=>"a", "column"=>1, "value"=>0.1},
35
+ # {"example"=>"a", "column"=>2, "value"=>0.2},
36
+ # ]
37
+ # columns = Guess::SchemaGuess.from_hash_records(sample_records)
38
+ # return {"columns" => columns}
39
+ # end
40
+
41
+ def init
42
+ # initialization code:
43
+ @option1 = task["option1"]
44
+ @option2 = task["option2"]
45
+ @option3 = task["option3"]
46
+ end
47
+
48
+ def run
49
+ page_builder.add(["example-value", 1, 0.1])
50
+ page_builder.add(["example-value", 2, 0.2])
51
+ page_builder.finish
52
+
53
+ task_report = {}
54
+ return task_report
55
+ end
56
+ end
57
+
58
+ end
59
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embulk-input-lkqd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ming Liu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: embulk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.28
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.28
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.10.6
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.10.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Loads reporting data from LKQD API.
56
+ email:
57
+ - liuming@lmws.net
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".ruby-version"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - embulk-input-lkqd.gemspec
69
+ - lib/embulk/input/lkqd.rb
70
+ homepage:
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.6.8
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: LKQD input plugin for Embulk
94
+ test_files: []