saxlsx 1.0.0 → 1.1.0

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: 48288886c8097438a2f3527b42c31f0db2a63c34
4
- data.tar.gz: 3386ac7f891cc701d09697e5620d4d5aafee216b
3
+ metadata.gz: 4b88b50d9148929625a2acdf54bd7d8818f7b03c
4
+ data.tar.gz: ef9c524a126a202c9ca6db5b04e468c5d8054fbf
5
5
  SHA512:
6
- metadata.gz: e8ca7c015a5b34310b2008f70ea9eec36abdcae99dd4fd29ba70711de286f8dfb37a1cbf4ff7e295b98bd1a2d2cdb700f9b83f9cd790df16d9818a943792c005
7
- data.tar.gz: 7dea47237742b543733e9aab3ffdd2c8d11cb9a8a7826e63b244dd20b782dc5661c16bccbef23485cec81fb9855dd1069799d351f67555f35dcb0509a8f30763
6
+ metadata.gz: 80c590e046b649a9907fb2ec0501114fe5a2bc79407f2e3311e0794ecf290e50e43f85c911552513d526fc3133a8f1ae194d6034e53bf18dcaa9eaecb0fe71aa
7
+ data.tar.gz: cfaf63a640c451923a82a4522b0a15ea480bbfa29842a3260f2cf4b25bfd0a98b6e964252b3510b234e599fbc905c91e9d1a3d1991e77003ab7cb9d340b1cea8
@@ -48,13 +48,11 @@ module Saxlsx
48
48
 
49
49
  def start_element(name)
50
50
  @current_element = name
51
-
52
- if name == :row
51
+ case name
52
+ when :row
53
53
  @current_row = []
54
54
  @next_column = 'A'
55
- end
56
-
57
- if name == :c
55
+ when :c
58
56
  @current_type = nil
59
57
  @current_number_format = nil
60
58
  end
@@ -81,7 +79,7 @@ module Saxlsx
81
79
  end
82
80
 
83
81
  def text(value)
84
- if @current_row && @current_element == :v
82
+ if @current_row && (@current_element == :v || @current_element == :t)
85
83
  while @next_column != @current_column
86
84
  @current_row << nil
87
85
  @next_column = ColumnNameGenerator.next_to(@next_column)
@@ -96,7 +94,9 @@ module Saxlsx
96
94
  def value_of(text)
97
95
  case @current_type
98
96
  when 's'
99
- @shared_strings[text.to_i] || text
97
+ @shared_strings[text.to_i]
98
+ when 'inlineStr'
99
+ text
100
100
  when 'b'
101
101
  BooleanParser.parse text
102
102
  else
@@ -1,3 +1,3 @@
1
1
  module Saxlsx
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
Binary file
data/spec/sheet_spec.rb CHANGED
@@ -104,4 +104,18 @@ describe Sheet do
104
104
  end
105
105
  end
106
106
  end
107
+
108
+ context 'with inline strings' do
109
+ let(:filename) { "#{File.dirname(__FILE__)}/data/SpecInlineStrings.xlsx" }
110
+
111
+ it 'should read inline strings' do
112
+ Workbook.open filename do |w|
113
+ w.sheets[0].tap do |s|
114
+ s.rows[0].should eq [
115
+ 'Test'
116
+ ]
117
+ end
118
+ end
119
+ end
120
+ end
107
121
  end
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.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgars Beigarts
@@ -127,6 +127,7 @@ files:
127
127
  - spec/column_name_generator_spec.rb
128
128
  - spec/data/Spec.xlsx
129
129
  - spec/data/Spec1904.xlsx
130
+ - spec/data/SpecInlineStrings.xlsx
130
131
  - spec/sheet_spec.rb
131
132
  - spec/spec_helper.rb
132
133
  - spec/workbook_spec.rb
@@ -158,6 +159,7 @@ test_files:
158
159
  - spec/column_name_generator_spec.rb
159
160
  - spec/data/Spec.xlsx
160
161
  - spec/data/Spec1904.xlsx
162
+ - spec/data/SpecInlineStrings.xlsx
161
163
  - spec/sheet_spec.rb
162
164
  - spec/spec_helper.rb
163
165
  - spec/workbook_spec.rb