embulk-input-http 0.0.19 → 0.0.20

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ebbbb5d16b7496fb5933d3c9680c7b5d38d133c
4
- data.tar.gz: b1c14c5409eea15e7a5c06926585e06308a40c24
3
+ metadata.gz: d106f68b837bc832cfdc9761b71f7489f89d0adf
4
+ data.tar.gz: 7a69f451397cd623cf2a813b82180aab8f251f12
5
5
  SHA512:
6
- metadata.gz: f28897b0bfd4ede1e9e5a5723e4f1ce1d0c1baa676aa2cbe6aac184c8e4c20c936f75f2765eff408a906a52572da183a549cf0bda3f94647e01594ea002affec
7
- data.tar.gz: fa75cbab09a61217da184c4694dbbc1b2af824ff7c4147a8c44221a2c4e0fabe9e4e83d9322f4d388bd1968b13aaad753c43b620f31babcbcaa68adc5d8fb45e
6
+ metadata.gz: 7bbe32a099103303e3dec079292cd268e33478d08f4099ba665df167f38776b7aa0a87083367f1b19979af6df37b5c85c4cc42567d400eb4d3292b4079b388ae
7
+ data.tar.gz: be742d9cbf99f5ac7530bbafd034e551aa4db83aacd50600f124fd3f0a3ba90145bce7ba8f029c9f48380526b0e295588290cd387ba21429b4f6213c0c23c539
@@ -0,0 +1,31 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/openjdk:8-jdk
6
+
7
+ working_directory: ~/repo
8
+
9
+ environment:
10
+ # Customize the JVM maximum heap limit
11
+ JVM_OPTS: -Xmx3200m
12
+ TERM: dumb
13
+
14
+ steps:
15
+ - checkout
16
+
17
+ # Download and cache dependencies
18
+ - restore_cache:
19
+ keys:
20
+ - v1-dependencies-{{ checksum "build.gradle" }}
21
+ - v1-dependencies-
22
+
23
+ - run: gradle dependencies
24
+
25
+ - save_cache:
26
+ paths:
27
+ - ~/.gradle
28
+ key: v1-dependencies-{{ checksum "build.gradle" }}
29
+
30
+ - run: gradle test
31
+
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Embulk::Input::Http
2
2
 
3
+ [![CircleCI](https://circleci.com/gh/takumakanari/embulk-input-http.svg?style=svg)](https://circleci.com/gh/takumakanari/embulk-input-http)
4
+
3
5
  Input HTTP plugin for [Embulk](https://github.com/embulk/embulk).
4
6
  Fetch data via HTTP.
5
7
 
@@ -34,6 +36,7 @@ in:
34
36
  - **method**: http method, get is used by default (optional)
35
37
  - **user_agent**: the usrr agent to specify request header (optional)
36
38
  - **request_headers**: the extra request headers as key-value (optional)
39
+ - **request_body**: the request body content, enabled if method is post and params are empty (optional)
37
40
  - **charset**: charset to specify request header (optional, default: utf8)
38
41
  - **basic_auth**: username/password for basic authentication (optional)
39
42
  - **open_timeout**: timeout msec to open connection (optional, default: 2000)
data/build.gradle CHANGED
@@ -1,6 +1,6 @@
1
1
  plugins {
2
2
  id "com.jfrog.bintray" version "1.1"
3
- id "com.github.jruby-gradle.base" version "0.1.5"
3
+ id "com.github.jruby-gradle.base" version "1.5.0"
4
4
  id "java"
5
5
  id "checkstyle"
6
6
  }
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.0.19"
16
+ version = "0.0.20"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -51,23 +51,29 @@ task checkstyle(type: Checkstyle) {
51
51
  }
52
52
 
53
53
  task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
- jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
55
- script "${project.name}.gemspec"
54
+ jrubyArgs "-S"
55
+ script "gem"
56
+ scriptArgs "build", "${project.name}.gemspec"
56
57
  doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
57
58
  }
58
59
 
59
60
  task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
60
- jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
61
- script "pkg/${project.name}-${project.version}.gem"
61
+ jrubyArgs "-S"
62
+ script "gem"
63
+ scriptArgs "push", "pkg/${project.name}-${project.version}.gem"
62
64
  }
63
65
 
64
- task "package"(dependsOn: ["gemspec", "classpath"]) << {
65
- println "> Build succeeded."
66
- println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
66
+ task "package"(dependsOn: ["gemspec", "classpath"]) {
67
+ doLast {
68
+ println "> Build succeeded."
69
+ println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
70
+ }
67
71
  }
68
72
 
69
73
 
70
- task gemspec << { file("${project.name}.gemspec").write($/
74
+ task gemspec {
75
+ doLast {
76
+ file("${project.name}.gemspec").write($/
71
77
  Gem::Specification.new do |spec|
72
78
  spec.name = "${project.name}"
73
79
  spec.version = "${project.version}"
@@ -85,5 +91,6 @@ Gem::Specification.new do |spec|
85
91
  spec.add_development_dependency 'rake', ['>= 10.0']
86
92
  end
87
93
  /$)
94
+ }
88
95
  }
89
96
  clean { delete "${project.name}.gemspec" }
@@ -13,6 +13,8 @@ in:
13
13
  request_interval: 600
14
14
  interval_includes_response_time: 1
15
15
  request_headers: {X-Some-Key1: some-value1, X-Some-key2: some-value2}
16
+ # request_body: |
17
+ # {"field1" : "one", "field2" : 2}
16
18
  pager: {from_param: from, to_param: to, pages: 10, step: 100}
17
19
  # input_direct: false
18
20
  parser:
@@ -1,5 +1,6 @@
1
+ #Thu Jun 21 15:19:12 JST 2018
1
2
  distributionBase=GRADLE_USER_HOME
2
3
  distributionPath=wrapper/dists
3
4
  zipStoreBase=GRADLE_USER_HOME
4
5
  zipStorePath=wrapper/dists
5
- distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
@@ -16,6 +16,7 @@ import org.apache.http.client.methods.HttpGet;
16
16
  import org.apache.http.client.methods.HttpPost;
17
17
  import org.apache.http.client.methods.HttpRequestBase;
18
18
  import org.apache.http.client.utils.URIBuilder;
19
+ import org.apache.http.entity.StringEntity;
19
20
  import org.apache.http.impl.client.BasicCredentialsProvider;
20
21
  import org.apache.http.impl.client.HttpClientBuilder;
21
22
  import org.apache.http.message.BasicHeader;
@@ -106,6 +107,10 @@ public class HttpFileInputPlugin implements FileInputPlugin
106
107
  @ConfigDefault("null")
107
108
  Optional<ParamsOption> getParams();
108
109
 
110
+ @Config("request_body")
111
+ @ConfigDefault("null")
112
+ Optional<String> getRequestBody();
113
+
109
114
  @Config("basic_auth")
110
115
  @ConfigDefault("null")
111
116
  Optional<BasicAuthOption> getBasicAuth();
@@ -268,7 +273,7 @@ public class HttpFileInputPlugin implements FileInputPlugin
268
273
  }
269
274
  return request;
270
275
  }
271
- else if (task.getHttpMethod() == HttpMethod.POST) {
276
+ if (task.getHttpMethod() == HttpMethod.POST) {
272
277
  HttpPost request = new HttpPost(task.getUrl());
273
278
  if (queries != null) {
274
279
  List<NameValuePair> pairs = new ArrayList<>();
@@ -279,6 +284,10 @@ public class HttpFileInputPlugin implements FileInputPlugin
279
284
  }
280
285
  request.setEntity(new UrlEncodedFormEntity(pairs));
281
286
  }
287
+ else if (task.getRequestBody().isPresent()) {
288
+ logger.info(new StringEntity(task.getRequestBody().get()).toString());
289
+ request.setEntity(new StringEntity(task.getRequestBody().get()));
290
+ }
282
291
  return request;
283
292
  }
284
293
  throw new IllegalArgumentException(String.format("Unsupported http method %s", task.getMethod()));
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma kanari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-09 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ~>
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
18
  version: '1.0'
19
19
  name: bundler
@@ -21,13 +21,13 @@ dependencies:
21
21
  type: :development
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '10.0'
33
33
  name: rake
@@ -35,7 +35,7 @@ dependencies:
35
35
  type: :development
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  description: Fetch data via http
@@ -45,10 +45,17 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".circleci/config.yml"
49
+ - ".gitignore"
49
50
  - LICENSE.txt
50
51
  - README.md
51
52
  - build.gradle
53
+ - classpath/commons-codec-1.10.jar
54
+ - classpath/commons-io-2.6.jar
55
+ - classpath/commons-logging-1.2.jar
56
+ - classpath/embulk-input-http-0.0.20.jar
57
+ - classpath/httpclient-4.5.5.jar
58
+ - classpath/httpcore-4.4.9.jar
52
59
  - config/checkstyle/checkstyle.xml
53
60
  - config/checkstyle/default.xml
54
61
  - example/json-example.yml
@@ -68,12 +75,6 @@ files:
68
75
  - src/test/java/org/embulk/input/http/TestPagerOption.java
69
76
  - src/test/java/org/embulk/input/http/TestParamsOption.java
70
77
  - src/test/java/org/embulk/input/http/TestQueryOption.java
71
- - classpath/commons-codec-1.10.jar
72
- - classpath/commons-io-2.6.jar
73
- - classpath/commons-logging-1.2.jar
74
- - classpath/embulk-input-http-0.0.19.jar
75
- - classpath/httpclient-4.5.5.jar
76
- - classpath/httpcore-4.4.9.jar
77
78
  homepage: https://github.com/takumakanari/embulk-input-http
78
79
  licenses:
79
80
  - MIT
@@ -84,17 +85,17 @@ require_paths:
84
85
  - lib
85
86
  required_ruby_version: !ruby/object:Gem::Requirement
86
87
  requirements:
87
- - - '>='
88
+ - - ">="
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
90
91
  required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  requirements:
92
- - - '>='
93
+ - - ">="
93
94
  - !ruby/object:Gem::Version
94
95
  version: '0'
95
96
  requirements: []
96
97
  rubyforge_project:
97
- rubygems_version: 2.1.9
98
+ rubygems_version: 2.6.8
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: Embulk plugin for http input