simple_xlsx_reader 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/simple_xlsx_reader.rb +15 -3
- data/lib/simple_xlsx_reader/version.rb +1 -1
- 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: 592fa09e1f66127581441dcee23a2ec10481a08f
|
4
|
+
data.tar.gz: 2165196985a70b2f594828e43523c237600f7c08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ef8fe7df99b9bea2742c49663aa899421e5d4b6a145c62ee15afef9a8938ba1bfe0c5bf4b9d0999e2cffc6189436fd4f3b1a59af8a796a05c1dc4d6d9f7de77
|
7
|
+
data.tar.gz: d1a2cb30e2dce280b529f6b877745cfbfa1f7cc8bbcacd506b268ca624da74d637e9e47bff8602f53d0c33ebd38055750c6eda88bbeaedd34d8eeb5e891e8b2e
|
data/CHANGELOG.md
CHANGED
data/lib/simple_xlsx_reader.rb
CHANGED
@@ -1,9 +1,21 @@
|
|
1
1
|
require "simple_xlsx_reader/version"
|
2
2
|
require 'nokogiri'
|
3
|
-
require 'zip/zip'
|
4
|
-
require 'zip/zipfilesystem'
|
5
3
|
require 'date'
|
6
4
|
|
5
|
+
# Rubyzip 1.0 only has different naming, everything else is the same, so let's
|
6
|
+
# be flexible so we don't force people into a dependency hell w/ other gems.
|
7
|
+
begin
|
8
|
+
# Try loading rubyzip < 1.0
|
9
|
+
require 'zip/zip'
|
10
|
+
require 'zip/zipfilesystem'
|
11
|
+
SimpleXlsxReader::Zip = Zip::ZipFile
|
12
|
+
rescue LoadError
|
13
|
+
# Try loading rubyzip >= 1.0
|
14
|
+
require 'zip'
|
15
|
+
require 'zip/filesystem'
|
16
|
+
SimpleXlsxReader::Zip = Zip::File
|
17
|
+
end
|
18
|
+
|
7
19
|
module SimpleXlsxReader
|
8
20
|
class CellLoadError < StandardError; end
|
9
21
|
|
@@ -61,7 +73,7 @@ module SimpleXlsxReader
|
|
61
73
|
|
62
74
|
def self.load(file_path)
|
63
75
|
self.new.tap do |xml|
|
64
|
-
Zip
|
76
|
+
SimpleXlsxReader::Zip.open(file_path) do |zip|
|
65
77
|
xml.workbook = Nokogiri::XML(zip.read('xl/workbook.xml'))
|
66
78
|
xml.styles = Nokogiri::XML(zip.read('xl/styles.xml'))
|
67
79
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_xlsx_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Woody Peterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|