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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36eeca38d2791f71dafba9b1ae6308e63b3554efd98e2949448c4715863b7616
4
- data.tar.gz: cf90d5ff1def79ee8b17877523a5e8233b7c5253801c98eb0e725724a6e3f48d
3
+ metadata.gz: bdd18155c813e1b242f54bf1b9b5696334ec496058a65ce281950d5971b91450
4
+ data.tar.gz: efb138a131f1e4799d26d823c3b3ddd45b34add899054d1cf8986b7d9143d26a
5
5
  SHA512:
6
- metadata.gz: cc203883d561d86a51eb35c11f4c4547929605387a43d38c16eb48f975a2da1ea332c7cbb4aab21e4760424ceb015de2e4d50aeeddd9bf595ccd3bf1f363ac63
7
- data.tar.gz: b91d7d210c6894c17bfbb2b40dd0c243f2c5228f35c780f8e5d8afba9367303d2df1897ae734bec636f8eab615cda7188d63e63b270b3f543fafc39d91d1aa7e
6
+ metadata.gz: 44a8ac8f904193b9a03db187a6bd7cb292793c1751261e063003d4a8bfcb61233f55c5303b22066dfb7d36f0b7519d238aee6023aa51793f30e0dab33d9f1491
7
+ data.tar.gz: c1c00561d544eb4666e411fb6b59205ce242394005bdead120ef73e852d0fac03bf6ed929becbe1e819b3f8226535093dc25d42ed3a655dd892c57a2a4890828
@@ -1,5 +1,11 @@
1
1
  # Xsv Changelog
2
2
 
3
+ ## HEAD
4
+
5
+ - Add Sheet#hidden?
6
+
7
+ - Clean up code; get rid of some deprecation warnings
8
+
3
9
  ## 0.3.12 - 2020-04-15
4
10
 
5
11
  - Accessing worksheets by name (texpert)
@@ -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
- when :Id, :Type, :Target
29
- @relationship[name] = value
29
+ when :Id, :Type, :Target
30
+ @relationship[name] = value
30
31
  end
31
32
  end
32
33
 
@@ -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
- return @parsing = true if name == :sheets
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
- when :name, :sheetId
35
- @sheet_ids[name] = value
36
- when :'r:id'
37
- @sheet_ids[:r_id] = value
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
- return @parsing = false if name == :sheets
46
+ if name == :sheets
47
+ @parsing = false
48
+ return
49
+ end
43
50
 
44
51
  return unless name == :sheet
45
52
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Xsv
3
- VERSION = "0.3.12"
3
+ VERSION = "0.3.13"
4
4
  end
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.12
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-04-15 00:00:00.000000000 Z
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip