embulk-parser-json 0.0.1 → 0.0.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: 6aa19505fd68d24404a80cf3b403ce606e96debf
4
- data.tar.gz: bf8f54eeb5a03754bec3264c2f468922e0dd2a0d
3
+ metadata.gz: e9403fc54ab64135da124a3791e34087dda9b62a
4
+ data.tar.gz: e3da372fe2d7ab82aac794864b9ff5de2eaf1464
5
5
  SHA512:
6
- metadata.gz: e1a69df98a31380ccc7672b477d9ef71af8d1f08becc449b81bf4fadc2cce1ac85ce789bfbd6dd3ce3c053e9e10d6ad7953592659c4b556ed7ae3d22da5038c1
7
- data.tar.gz: 0fa843f6faf5a62007e80d22817636777ea02408f5c666806d97740a9b5923a143fe14a81aa36cead2c5517ec625e06b5c491d88812b86fc7f2cd0dbf7b166a0
6
+ metadata.gz: 0975db258c9e8b38de2f1b9859b76e3e52a568db92963ad4b53a82e9a954646ef3e34514771f8133d33757702b0912f7a9231b6faf0fd83d266bc046abdd5d2c
7
+ data.tar.gz: a35875f4ba86f1dc576b67718e256a2dd91224426c42f5173609ae177ceedf89a788fe3ba47326d3ee5fa05121b304472df28cf97c11aa49c8e323b07367ff67
@@ -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.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Takuma kanari"]
9
9
  spec.email = ["chemtrails.t@gmail.com"]
10
10
  spec.summary = %q{Embulk parser plugin for json}
@@ -46,7 +46,15 @@ module Embulk
46
46
  when "double"
47
47
  v.to_f
48
48
  when "boolean"
49
- ["yes", "true", "1"].include?(v.downcase)
49
+ if v.nil?
50
+ nil
51
+ elsif v.kind_of?(String)
52
+ ["yes", "true", "1"].include?(v.downcase)
53
+ elsif v.kind_of?(Numeric)
54
+ !v.zero?
55
+ else
56
+ !!v
57
+ end
50
58
  when "timestamp"
51
59
  v.empty? ? nil : Time.strptime(v, c["format"])
52
60
  else
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma kanari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-14 00:00:00.000000000 Z
11
+ date: 2016-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonpath
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.2.2
89
+ rubygems_version: 2.4.5.1
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Embulk parser plugin for json