embulk-parser-xpath2 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +10 -0
- data/build.gradle +2 -2
- data/build.sbt +1 -1
- data/src/main/scala/org/embulk/parser/xpath2/LoanPattern.scala +1 -3
- data/src/main/scala/org/embulk/parser/xpath2/PluginTask.scala +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d18d3543eeb861a75f6a19ef91bb00e004aaccf5
|
4
|
+
data.tar.gz: c585d26f626e4eb8f9e72deb3ece90902c1318d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e590e135e55fecbd12bd5c4ff757a2824f9ea315d40b34013dc31e61e7f4b08c5b22b465b1197fd6ac501ddb18ed8403cc2cb05207fec958d4ab03d4d81f0354
|
7
|
+
data.tar.gz: 53daf517e3f70614b71469b97bfea1f12c7752a79117ee831d5943c650b95ec918eb6e34e26a806a5a764efcc9ed4bd1d490655f33eadf8b47cb8690edb31240
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Xml parser plugin for Embulk
|
2
2
|
[](https://badge.fury.io/rb/embulk-parser-xpath2)
|
3
3
|
[](https://travis-ci.org/maji-KY/embulk-parser-xpath2)
|
4
|
+
[](https://www.codacy.com/app/maji-KY/embulk-parser-xpath2?utm_source=github.com&utm_medium=referral&utm_content=maji-KY/embulk-parser-xpath2&utm_campaign=Badge_Grade)
|
5
|
+
[](https://www.codefactor.io/repository/github/maji-ky/embulk-parser-xpath2)
|
6
|
+
[](https://snyk.io/test/github/maji-ky/embulk-parser-xpath2)
|
4
7
|
|
5
8
|
Embulk parser plugin for parsing xml data by XPath perfectly!
|
6
9
|
|
@@ -20,6 +23,7 @@ Embulk parser plugin for parsing xml data by XPath perfectly!
|
|
20
23
|
- **root**: root element to start fetching each entries (string, required)
|
21
24
|
- **schema**: specify the attribute of table and data type (required)
|
22
25
|
- **namespaces**: specify namespaces (required)
|
26
|
+
- **stop_on_invalid_record**: stop bulk load transaction if a invalid record is found (boolean, default is `false`)
|
23
27
|
|
24
28
|
## Example
|
25
29
|
|
@@ -32,6 +36,7 @@ parser:
|
|
32
36
|
- { path: 'ns2:title', name: title, type: string }
|
33
37
|
- { path: 'ns2:meta/ns2:author', name: author, type: string }
|
34
38
|
- { path: 'ns2:date', name: date, type: timestamp, format: '%Y%m%d' }
|
39
|
+
- { path: 'ns2:ratings/ns2:rating[@by="subscribers"]', name: ratings, type: json }
|
35
40
|
namespaces: {ns1: 'http://example.com/ns1/', ns2: 'http://example.com/ns2/'}
|
36
41
|
```
|
37
42
|
|
@@ -48,6 +53,11 @@ Then you can fetch entries from the following xml:
|
|
48
53
|
<ns2:author>maji-KY</ns2:author>
|
49
54
|
</ns2:meta>
|
50
55
|
<ns2:date>20010101</ns2:date>
|
56
|
+
<ns2:ratings>
|
57
|
+
<ns2:rating by="subscribers">1</ns2:rating>
|
58
|
+
<ns2:rating by="subscribers">2</ns2:rating>
|
59
|
+
<ns2:rating>3</ns2:rating>
|
60
|
+
</ns2:ratings>
|
51
61
|
</ns2:entry>
|
52
62
|
</ns1:root>
|
53
63
|
```
|
data/build.gradle
CHANGED
data/build.sbt
CHANGED
@@ -4,9 +4,7 @@ import scala.util.control.Exception.ignoring
|
|
4
4
|
|
5
5
|
object LoanPattern {
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
def apply[R <: Closable, A](resource: R)(f: R => A): A = {
|
7
|
+
def apply[R <: AutoCloseable, A](resource: R)(f: R => A): A = {
|
10
8
|
try {
|
11
9
|
f(resource)
|
12
10
|
} finally {
|
@@ -1,8 +1,6 @@
|
|
1
1
|
package org.embulk.parser.xpath2
|
2
2
|
|
3
|
-
import org.embulk.config.Task
|
4
|
-
import org.embulk.config.Config
|
5
|
-
import org.embulk.config.ConfigDefault
|
3
|
+
import org.embulk.config.{Config, ConfigDefault, Task}
|
6
4
|
import org.embulk.parser.xpath2.config.{NamespacesConfig, SchemaConfig}
|
7
5
|
import org.embulk.spi.time.TimestampParser
|
8
6
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-parser-xpath2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maji-KY
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- src/test/scala/org/embulk/parser/xpath2/XPath2ParserPluginSpec.scala
|
73
73
|
- classpath/vtd-xml-2.13.4.jar
|
74
74
|
- classpath/scala-library-2.12.4.jar
|
75
|
-
- classpath/embulk-parser-xpath2-0.1.
|
75
|
+
- classpath/embulk-parser-xpath2-0.1.2.jar
|
76
76
|
homepage: https://github.com/maji-KY/embulk-parser-xpath2
|
77
77
|
licenses:
|
78
78
|
- GPL-2.0
|