workbook 0.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.travis.yml +1 -0
- data/lib/workbook/readers/xlsx_reader.rb +1 -1
- data/lib/workbook/version.rb +1 -1
- data/test/test_modules_cell.rb +1 -1
- data/test/test_readers_xlsx_reader.rb +5 -0
- data/test/test_writers_xlsx_writer.rb +2 -1
- data/workbook.gemspec +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9848d95050eba74f800057126830112584caf0eb
|
4
|
+
data.tar.gz: 744f2789a85dd61fcc897e4af12ae0f748e11247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b257542702392dc54034a613036bc6e7b09e8b706fe87e825a550b529f9c4b43cd861927082b5fe7d04af73c656326d0309d026f5262e6ef95a4b6271af73c3a
|
7
|
+
data.tar.gz: f349e45d8c0aff9df3c96ae3a68b951201b163bb25d9e6c4838db6c14bfec0d747745902b19a10a128f30accdf58845622f20f3f878da7437d7f8332bd69d7df
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -121,7 +121,7 @@ module Workbook
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def parse_shared_string_file file
|
124
|
-
Nokogiri::XML(file).css("sst si
|
124
|
+
Nokogiri::XML(file).css("sst si").collect{|a| a.text}
|
125
125
|
end
|
126
126
|
def parse_xlsx_sheet sheet_xml
|
127
127
|
sheet = Workbook::Sheet.new
|
data/lib/workbook/version.rb
CHANGED
data/test/test_modules_cell.rb
CHANGED
@@ -27,7 +27,7 @@ class TestModulesCell < Minitest::Test
|
|
27
27
|
assert_equal(Date.new,w.value)
|
28
28
|
w.value = 1
|
29
29
|
assert_equal(1,w.value)
|
30
|
-
|
30
|
+
assert(["Integer", "Fixnum"].include?(w.value.class.to_s))
|
31
31
|
w.value = 1.0
|
32
32
|
assert_equal(1.0,w.value)
|
33
33
|
assert_equal(Float,w.value.class)
|
@@ -58,5 +58,10 @@ module Readers
|
|
58
58
|
t = b.sheet.table
|
59
59
|
assert_nil(t["A3"].value)
|
60
60
|
end
|
61
|
+
def test_parse_shared_string_file
|
62
|
+
file_contents = "<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"3095\" uniqueCount=\"1241\"><si><t>Nummer</t></si><si><t>Locatie</t></si><si><r><t>ZR 1</t></r><r><rPr><vertAlign val=\"superscript\"/><sz val=\"11\"/><rFont val=\"Calibri\"/><scheme val=\"minor\"/></rPr><t>e</t></r><r><rPr><sz val=\"11\"/><rFont val=\"Calibri\"/><family val=\"2\"/><scheme val=\"minor\"/></rPr><t xml:space=\"preserve\"> etage</t></r></si><si><t>Kaas</t></si></sst>"
|
63
|
+
result = Workbook::Book.new.parse_shared_string_file(file_contents)
|
64
|
+
assert_equal(["Nummer", "Locatie", "ZR 1e etage", "Kaas"],result)
|
65
|
+
end
|
61
66
|
end
|
62
67
|
end
|
@@ -101,7 +101,8 @@ module Writers
|
|
101
101
|
b = Workbook::Book.new
|
102
102
|
b.template.set_default_formats!
|
103
103
|
b.formats_to_xlsx_format
|
104
|
-
|
104
|
+
raw_keys = b.template.create_or_find_format_by(:header).raws.keys
|
105
|
+
assert((raw_keys.include?(Integer) or raw_keys.include?(Fixnum)))
|
105
106
|
end
|
106
107
|
|
107
108
|
def test_format_to_xlsx_integrated
|
data/workbook.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency("rchardet", "~> 1.3")
|
22
22
|
s.add_dependency("rake", '~> 10.0')
|
23
23
|
s.add_dependency("json", '~> 1.8')
|
24
|
+
# s.add_dependency("rubyzip", '~> 1.2', '>= 1.2.1')
|
24
25
|
s.add_dependency('axlsx', '~> 2.1.0.pre')
|
25
26
|
if RUBY_VERSION < "1.9"
|
26
27
|
s.add_dependency('nokogiri', "~> 1.5.10")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten Brouwers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-prof
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
259
|
rubyforge_project: workbook
|
260
|
-
rubygems_version: 2.
|
260
|
+
rubygems_version: 2.6.11
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Workbook is a datastructure to contain books of tables (an anlogy used in
|