saxlsx 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saxlsx/rows_collection_parser.rb +7 -7
- data/lib/saxlsx/version.rb +1 -1
- data/spec/data/SpecInlineStrings.xlsx +0 -0
- data/spec/sheet_spec.rb +14 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b88b50d9148929625a2acdf54bd7d8818f7b03c
|
4
|
+
data.tar.gz: ef9c524a126a202c9ca6db5b04e468c5d8054fbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
51
|
+
case name
|
52
|
+
when :row
|
53
53
|
@current_row = []
|
54
54
|
@next_column = 'A'
|
55
|
-
|
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]
|
97
|
+
@shared_strings[text.to_i]
|
98
|
+
when 'inlineStr'
|
99
|
+
text
|
100
100
|
when 'b'
|
101
101
|
BooleanParser.parse text
|
102
102
|
else
|
data/lib/saxlsx/version.rb
CHANGED
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.
|
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
|