tapsoob 0.3.25-java → 0.3.26-java

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
  SHA256:
3
- metadata.gz: d124a866776acf86f71e3158dadd3e81f2030f858caa81e82999a3dc3cad82f4
4
- data.tar.gz: d68c1125793da5e9d0862345148a9b4e8b7d874517d79a46cb39752b092af0f8
3
+ metadata.gz: 9257ce158006409f702d21898b3352d8269aa1dd4459096e76b89521125e45be
4
+ data.tar.gz: 45c341a28a30a5ac78d68b426b9afae60bb604172c9dd2bd7b2b0333774d4a97
5
5
  SHA512:
6
- metadata.gz: 60a875dc77e9476993b60b64d2596bd659dd7e61b791349914c6eafbc843d9b2ad06e08c77c9345c1e3101ba9d2ef166acb479e31e595c7bca4ef35d7617dc5c
7
- data.tar.gz: ffa787880d5db54be32f66c42f5daccc08d0dccb4542606d0ed37bf484194c914e81169f958501299acc6c377fe055a505ba5f5b81c8c9295697c88e18eb4d13
6
+ metadata.gz: 0d7a546a51d161e10bc35e7059cc80b1df2061653763daac67f8a3189ebb7b4d63fb68eff14150f13cedbcfb150142f1d3cc8401aaa1d97cf70aed9d7167fdbf
7
+ data.tar.gz: 12ab879416b51181480181e6ca41e538e332b2c88c94d40e968d68eff69069b1d98b7442b284aa429d016c07e9dcb1a6a0c2253d93982c5afda9d7f0e56a42a4
@@ -1,4 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
+ require 'date'
3
+ require 'time'
4
+
2
5
  require 'tapsoob/log'
3
6
  require 'tapsoob/utils'
4
7
 
@@ -232,6 +235,30 @@ module Tapsoob
232
235
  end
233
236
  end
234
237
 
238
+ # Parse date/datetime/time columns
239
+ if rows.has_key?(:types)
240
+ %w(date datetime time).each do |type|
241
+ if rows[:types].include?(type)
242
+ klass = case type
243
+ when "date"
244
+ Date
245
+ when "datetime"
246
+ DateTime
247
+ when "time"
248
+ Time
249
+ end
250
+
251
+
252
+ type_indices = rows[:types].each_index.select { |idx| rows[:types][idx] == type }
253
+ rows[:data].each_index do |idx|
254
+ type_indices.each do |ti|
255
+ rows[:data][idx][ti] = klass.parse(rows[:data][idx][ti])
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+
235
262
  # Remove id column
236
263
  if @options[:"discard-identity"]
237
264
  columns = rows[:header] - ["id"]
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.3.25".freeze
3
+ VERSION = "0.3.26".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapsoob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.25
4
+ version: 0.3.26
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger