xsv 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/xsv/relationships_handler.rb +3 -2
- data/lib/xsv/sheet.rb +6 -0
- data/lib/xsv/sheets_ids_handler.rb +13 -6
- data/lib/xsv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd18155c813e1b242f54bf1b9b5696334ec496058a65ce281950d5971b91450
|
4
|
+
data.tar.gz: efb138a131f1e4799d26d823c3b3ddd45b34add899054d1cf8986b7d9143d26a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44a8ac8f904193b9a03db187a6bd7cb292793c1751261e063003d4a8bfcb61233f55c5303b22066dfb7d36f0b7519d238aee6023aa51793f30e0dab33d9f1491
|
7
|
+
data.tar.gz: c1c00561d544eb4666e411fb6b59205ce242394005bdead120ef73e852d0fac03bf6ed929becbe1e819b3f8226535093dc25d42ed3a655dd892c57a2a4890828
|
data/CHANGELOG.md
CHANGED
@@ -17,6 +17,7 @@ module Xsv
|
|
17
17
|
|
18
18
|
def initialize(&block)
|
19
19
|
@block = block
|
20
|
+
@relationship = {}
|
20
21
|
end
|
21
22
|
|
22
23
|
def start_element(name)
|
@@ -25,8 +26,8 @@ module Xsv
|
|
25
26
|
|
26
27
|
def attr(name, value)
|
27
28
|
case name
|
28
|
-
|
29
|
-
|
29
|
+
when :Id, :Type, :Target
|
30
|
+
@relationship[name] = value
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
data/lib/xsv/sheet.rb
CHANGED
@@ -39,6 +39,7 @@ module Xsv
|
|
39
39
|
@headers = []
|
40
40
|
@mode = :array
|
41
41
|
@row_skip = 0
|
42
|
+
@hidden = ids[:state] == "hidden"
|
42
43
|
|
43
44
|
@last_row, @column_count = SheetBoundsHandler.get_bounds(@io, @workbook)
|
44
45
|
end
|
@@ -48,6 +49,11 @@ module Xsv
|
|
48
49
|
"#<#{self.class.name}:#{self.object_id}>"
|
49
50
|
end
|
50
51
|
|
52
|
+
# Returns true if the worksheet is hidden
|
53
|
+
def hidden?
|
54
|
+
@hidden
|
55
|
+
end
|
56
|
+
|
51
57
|
# Iterate over rows, returning either hashes or arrays based on the current mode.
|
52
58
|
def each_row(&block)
|
53
59
|
@io.rewind
|
@@ -17,10 +17,14 @@ module Xsv
|
|
17
17
|
|
18
18
|
def initialize(&block)
|
19
19
|
@block = block
|
20
|
+
@parsing = false
|
20
21
|
end
|
21
22
|
|
22
23
|
def start_element(name)
|
23
|
-
|
24
|
+
if name == :sheets
|
25
|
+
@parsing = true
|
26
|
+
return
|
27
|
+
end
|
24
28
|
|
25
29
|
return unless name == :sheet
|
26
30
|
|
@@ -31,15 +35,18 @@ module Xsv
|
|
31
35
|
return unless @parsing
|
32
36
|
|
33
37
|
case name
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
when :name, :sheetId, :state
|
39
|
+
@sheet_ids[name] = value
|
40
|
+
when :'r:id'
|
41
|
+
@sheet_ids[:r_id] = value
|
38
42
|
end
|
39
43
|
end
|
40
44
|
|
41
45
|
def end_element(name)
|
42
|
-
|
46
|
+
if name == :sheets
|
47
|
+
@parsing = false
|
48
|
+
return
|
49
|
+
end
|
43
50
|
|
44
51
|
return unless name == :sheet
|
45
52
|
|
data/lib/xsv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xsv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martijn Storck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|