saxlsx 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 912aea753226e55b3b97c74c094e36fff1a703b3
4
- data.tar.gz: 71b3a09c85b6fbcb8dc5da74dfcb4134d4eb3ba6
3
+ metadata.gz: 7dc32c3edddd79931a9aa2c524b797621542ab84
4
+ data.tar.gz: 741e327689fe7525f0c2613c191c3c9e75a45d7a
5
5
  SHA512:
6
- metadata.gz: ee4a4b76abdf8d4d797a1704c892cd9359b2b2a646ac38267feeba182d7f349b7016c50788e0382ef9552cc767f2b3356ef5adbf462cc761fc44d24ad164b410
7
- data.tar.gz: 1cd5883650144d961e7ff726af1900d5ca037f4c0a9d5efd2aeccdcf9312145ee108c21a6b35e3be8ccde8d942b2b578ed5e0be1c75fb077c8798c6ed947cbf6
6
+ metadata.gz: 2f12ad7f5636ac9bf9a48f2d1b8d22f05e77ab2e40a44ebb314ced6f7d0390be7189ba774c2402c3ec278036ca9efd4489934fbea7a1c0d8d28817e2bd0be174
7
+ data.tar.gz: ba0525a308e673c1ab5570545d9698349fab4324c1342c679b6ec8395940cf4ec7da09d2d4331450a486c712f377264bbc89514b551af2c1274bc2fef8fcac22
data/README.md CHANGED
@@ -32,7 +32,7 @@ $ gem install saxlsx
32
32
  ## Usage
33
33
 
34
34
  ```ruby
35
- Saxlsx::Workbook.open filename do |w|
35
+ Saxlsx::Workbook.open filename, auto_format: true do |w|
36
36
  w.sheets.each do |s|
37
37
  puts s.rows.count
38
38
  s.rows.each do |r|
@@ -42,6 +42,10 @@ Saxlsx::Workbook.open filename do |w|
42
42
  end
43
43
  ```
44
44
 
45
+ By default `saxlsx` will try to convert `General` type cells that look like
46
+ numbers to ruby floats or integers. You can disable this feature
47
+ using `auto_format: false`.
48
+
45
49
  ## How fast is it?
46
50
 
47
51
  ```bash
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "saxlsx"
5
+
6
+ require "irb"
7
+ IRB.start
@@ -104,7 +104,7 @@ module Saxlsx
104
104
  else
105
105
  case @current_number_format
106
106
  when :date
107
- @base_date + Integer(text)
107
+ @base_date + Float(text)
108
108
  when :date_time
109
109
  # Round time to seconds
110
110
  date = @base_date + Rational((Float(text) * SECONDS_IN_DAY).round, SECONDS_IN_DAY)
@@ -1,3 +1,3 @@
1
1
  module Saxlsx
2
- VERSION = '1.6.0'
2
+ VERSION = '1.6.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saxlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgars Beigarts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -97,7 +97,8 @@ dependencies:
97
97
  description: Fast xlsx reader on top of Ox SAX parser
98
98
  email:
99
99
  - edgars.beigarts@makit.lv
100
- executables: []
100
+ executables:
101
+ - console
101
102
  extensions: []
102
103
  extra_rdoc_files: []
103
104
  files:
@@ -107,6 +108,7 @@ files:
107
108
  - LICENSE.txt
108
109
  - README.md
109
110
  - Rakefile
111
+ - bin/console
110
112
  - lib/saxlsx.rb
111
113
  - lib/saxlsx/boolean_parser.rb
112
114
  - lib/saxlsx/column_name_generator.rb