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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6be5061a431a70bb33a5f09f77260bc6b43c806
4
- data.tar.gz: c29da70505ab5d7e16820ec96c28600388ed56d3
3
+ metadata.gz: 9848d95050eba74f800057126830112584caf0eb
4
+ data.tar.gz: 744f2789a85dd61fcc897e4af12ae0f748e11247
5
5
  SHA512:
6
- metadata.gz: 6880c1ea1b7bc8bd49c27a7e19a08ffa74f7e62e628a9dfe4fb81c1a0cac65bc83099d428ec2973d9fc2ea7742a9faa6eb677866050efdbd2c4d2e8616431c3d
7
- data.tar.gz: 54a41200b7ec799da9920120426fc2e883d208a1afd1dfdb135c5639316ec499316142b756e2265edf1134bcfb5bb55343d44d82667e04c52f81c63b9e77c0e7
6
+ metadata.gz: b257542702392dc54034a613036bc6e7b09e8b706fe87e825a550b529f9c4b43cd861927082b5fe7d04af73c656326d0309d026f5262e6ef95a4b6271af73c3a
7
+ data.tar.gz: f349e45d8c0aff9df3c96ae3a68b951201b163bb25d9e6c4838db6c14bfec0d747745902b19a10a128f30accdf58845622f20f3f878da7437d7f8332bd69d7df
data/.gitignore CHANGED
@@ -12,4 +12,6 @@ plus.png
12
12
  profile.*
13
13
  untitled document.xlsx*
14
14
  .DS_Store
15
- doc
15
+ doc
16
+ private_*
17
+ test_private_*
data/.travis.yml CHANGED
@@ -5,5 +5,6 @@ rvm:
5
5
  - 2.1.0
6
6
  - 2.2.0
7
7
  - 2.3.0
8
+ - 2.4.0
8
9
  before_install:
9
10
  - gem install bundler
@@ -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 t").collect{|a| a.text}
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
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Workbook
3
- VERSION = '0.7'
3
+ VERSION = '0.7.1'
4
4
  end
@@ -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
- assert_equal(Fixnum,w.value.class)
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
- assert_equal(false,b.template.create_or_find_format_by(:header).raws[Fixnum].nil?)
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: '0.7'
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-03-28 00:00:00.000000000 Z
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.5.1
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