saxlsx 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saxlsx/rows_collection_parser.rb +2 -2
- data/lib/saxlsx/version.rb +1 -1
- data/lib/saxlsx.rb +2 -0
- data/spec/data/Spec.xlsx +0 -0
- data/spec/sheet_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 850d7678a428facb3540f2ede647e9c86abd370b
|
4
|
+
data.tar.gz: 3115277cae3bd74a25d25d9079ae7c1187663d07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bd7ce2c41e5004cac2f04a65164358082b53b24c7d536534e999815ce9c3cf1360d40b92e738c0b31b28b89a0ef6bc263b15a5c188475af80cfaeaae321ef1
|
7
|
+
data.tar.gz: 4cb3aaab6197f53c6c90fb025c6322091b6b3febaf4d57a2168cc451a04328310f525967e92665855c99bf56079e33ad9add5a6cbac3edc8765a4ac0a000ca57
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Saxlsx
|
2
2
|
class RowsCollectionParser < Ox::Sax
|
3
|
-
SECONDS_IN_DAY =
|
3
|
+
SECONDS_IN_DAY = 86400
|
4
4
|
NUM_FORMATS = {
|
5
5
|
0 => :string, # General
|
6
6
|
1 => :fixnum, # 0
|
@@ -106,7 +106,7 @@ module Saxlsx
|
|
106
106
|
@base_date + text.to_i
|
107
107
|
when :date_time
|
108
108
|
# Round time to seconds
|
109
|
-
date = @base_date + (
|
109
|
+
date = @base_date + Rational((text.to_f * SECONDS_IN_DAY).round, SECONDS_IN_DAY)
|
110
110
|
DateTime.new(date.year, date.month, date.day, date.hour, date.minute, date.second)
|
111
111
|
when :fixnum
|
112
112
|
text.to_i
|
data/lib/saxlsx/version.rb
CHANGED
data/lib/saxlsx.rb
CHANGED
data/spec/data/Spec.xlsx
CHANGED
Binary file
|
data/spec/sheet_spec.rb
CHANGED
@@ -35,7 +35,8 @@ describe Sheet do
|
|
35
35
|
3,
|
36
36
|
DateTime.new(2013, 12, 13, 8, 0, 58),
|
37
37
|
DateTime.new(1970, 1, 1),
|
38
|
-
BigDecimal.new('3.4028236692093801E+38')
|
38
|
+
BigDecimal.new('3.4028236692093801E+38'),
|
39
|
+
DateTime.new(2015, 2, 13, 12, 40, 5)
|
39
40
|
]
|
40
41
|
s.rows[1].should eq [
|
41
42
|
'Case sensitive',
|
@@ -80,7 +81,7 @@ describe Sheet do
|
|
80
81
|
w.sheets[0].to_csv tmp_path
|
81
82
|
|
82
83
|
csv = File.open(csv_file, 'r') { |f| f.readlines }
|
83
|
-
csv[0].should eq %{"LevenshteinDistance","3.14","3","2013-12-13T08:00:58+00:00","1970-01-01T00:00:00+00:00","0.34028236692093801E39"\n}
|
84
|
+
csv[0].should eq %{"LevenshteinDistance","3.14","3","2013-12-13T08:00:58+00:00","1970-01-01T00:00:00+00:00","0.34028236692093801E39","2015-02-13T12:40:05+00:00"\n}
|
84
85
|
csv[1].should eq %{"Case sensitive","false","3.0","1970-01-01T01:00:00+00:00"\n}
|
85
86
|
csv[2].should eq "\"Fields\",\"Type\",\"URL Mining\"\n"
|
86
87
|
csv[3].should eq "\"autor\",\"text\",\"false\"\n"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saxlsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgars Beigarts
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.4.6
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Fast xlsx reader on top of Ox SAX parser
|