embulk-parser-json 0.0.4 → 0.0.5

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: 00136715fce9203f8e51e69bad23a9fa32f7f97e
4
- data.tar.gz: 1ce41b3998ab0e7c9daf4ab4f667235cae993223
3
+ metadata.gz: 4a50a899523c149951f3bb4b67f917ed7be074d0
4
+ data.tar.gz: eff2a6db83ee9af56a4588c1951b28093732094d
5
5
  SHA512:
6
- metadata.gz: 2a5b8e785d2d61c0a65981dba6ef53617ee797b637b1f80f6a8efe23449965f75e8183b4c53a8555c3ebe42cf9ead5e6c595af67b9e20168b67914230c380925
7
- data.tar.gz: adef59fdc523f07484f58a96e8acb9314e9019c8c4968e4a41d741f043efc752eb2963d96a108ae196cf17a3413c97a35e0e97b7f021952bffa5a760388f4250
6
+ metadata.gz: 66d5ab493130ac329c0a2790c2803d294f9860e8949a1c6706cae2b8f7cffca272b2cf5f97bf3468ce24c09d7b2ee5207d17b707d5551214b2f285b318cd5ca3
7
+ data.tar.gz: 3f7f230abb7b10dc89a6385732ed5108e236328d4950e0a6b8518bdad59edb86f3add74a83e39e9762c69eb12de808fd7af16b6579ea677430d68c36b66e31a6
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "embulk-parser-json"
7
- spec.version = "0.0.4"
7
+ spec.version = "0.0.5"
8
8
  spec.authors = ["Takuma kanari"]
9
9
  spec.email = ["chemtrails.t@gmail.com"]
10
10
  spec.summary = %q{Embulk parser plugin for json with jsonpath}
@@ -47,7 +47,9 @@ module Embulk
47
47
  when "json"
48
48
  val
49
49
  when "boolean"
50
- if val.nil? || val.empty?
50
+ if kind_of_boolean?(val)
51
+ val
52
+ elsif val.nil? || val.empty?
51
53
  nil
52
54
  elsif val.kind_of?(String)
53
55
  ["yes", "true", "1"].include?(val.downcase)
@@ -63,6 +65,10 @@ module Embulk
63
65
  end
64
66
  end
65
67
  end
68
+
69
+ def kind_of_boolean?(val)
70
+ val.kind_of?(TrueClass) || val.kind_of?(FalseClass)
71
+ end
66
72
  end
67
73
  end
68
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-parser-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma kanari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-20 00:00:00.000000000 Z
11
+ date: 2017-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonpath
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.5.1
90
+ rubygems_version: 2.4.5
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Embulk parser plugin for json with jsonpath