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 +4 -4
- data/lib/tapsoob/data_stream.rb +27 -0
- data/lib/tapsoob/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9257ce158006409f702d21898b3352d8269aa1dd4459096e76b89521125e45be
|
4
|
+
data.tar.gz: 45c341a28a30a5ac78d68b426b9afae60bb604172c9dd2bd7b2b0333774d4a97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d7a546a51d161e10bc35e7059cc80b1df2061653763daac67f8a3189ebb7b4d63fb68eff14150f13cedbcfb150142f1d3cc8401aaa1d97cf70aed9d7167fdbf
|
7
|
+
data.tar.gz: 12ab879416b51181480181e6ca41e538e332b2c88c94d40e968d68eff69069b1d98b7442b284aa429d016c07e9dcb1a6a0c2253d93982c5afda9d7f0e56a42a4
|
data/lib/tapsoob/data_stream.rb
CHANGED
@@ -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"]
|
data/lib/tapsoob/version.rb
CHANGED