embulk-parser-xpath2 0.1.1 → 0.1.2

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: 69980d53b9741ba610c927933b66e4ddfaff8e1d
4
- data.tar.gz: d64828bfaad5b3165c0eaaef5d7f934c20a8b77b
3
+ metadata.gz: d18d3543eeb861a75f6a19ef91bb00e004aaccf5
4
+ data.tar.gz: c585d26f626e4eb8f9e72deb3ece90902c1318d8
5
5
  SHA512:
6
- metadata.gz: 8e91ecf327863a4cd394042a65bbb0ce0736af94a190bf159b8ee576eeb0f03d54e9e781ddda055a8a671f539772eac1581b9358c5d4618c074a6182490f89fd
7
- data.tar.gz: 5a58463f01abb96302b2e34720829ae4e9de3578d298f2263f3d2cd01fc50fe2831ae331408ddbc9a9ca8876473786aaa9f3d48f311a74de5d01576f9b3cf462
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
  [![Gem Version](https://badge.fury.io/rb/embulk-parser-xpath2.svg)](https://badge.fury.io/rb/embulk-parser-xpath2)
3
3
  [![Build Status](https://travis-ci.org/maji-KY/embulk-parser-xpath2.svg?branch=develop)](https://travis-ci.org/maji-KY/embulk-parser-xpath2)
4
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/1af04aa85e2b477e945c93158512d3b2)](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
+ [![CodeFactor](https://www.codefactor.io/repository/github/maji-ky/embulk-parser-xpath2/badge)](https://www.codefactor.io/repository/github/maji-ky/embulk-parser-xpath2)
6
+ [![Known Vulnerabilities](https://snyk.io/test/github/maji-ky/embulk-parser-xpath2/badge.svg)](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
@@ -13,9 +13,9 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.1"
16
+ version = "0.1.2"
17
17
  ext {
18
- embulkVersion = "0.8.35"
18
+ embulkVersion = "0.8.39"
19
19
  }
20
20
 
21
21
  sourceCompatibility = 1.8
data/build.sbt CHANGED
@@ -1,4 +1,4 @@
1
- val embulkVersion = "0.8.35"
1
+ val embulkVersion = "0.8.39"
2
2
 
3
3
  lazy val commonSettings = Seq(
4
4
  organization := "com.github.maji-KY",
@@ -4,9 +4,7 @@ import scala.util.control.Exception.ignoring
4
4
 
5
5
  object LoanPattern {
6
6
 
7
- type Closable = { def close(): Unit }
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.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-10-24 00:00:00.000000000 Z
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.1.jar
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