to_spreadsheet 1.0.7 → 1.1.0

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: 7bc03e5c897fae15afdda71d0d98a405032b495459c82f0944b3e2266875679b
4
- data.tar.gz: f330f6898c87f33cc6651533bfcfb2daaabfa9f5f6691f8df8f3c7cc7cbb71e9
3
+ metadata.gz: 59db3fcd754f0a95dd09f3fe7ffae57462a002745b6993a9fc3baa84014378ed
4
+ data.tar.gz: 831e9e4a81117cb1904bf503a05d1e3bb24ed817f90de0f031d05cb292308143
5
5
  SHA512:
6
- metadata.gz: 4668c0f720945b9e123ed8b153c997f32ab831c726a04d1648ba47e85df77d2f3bc4024459a3507c6c3b66e65930aabd540ab4befd662cb5ddeade3de52207d4
7
- data.tar.gz: 4e1ead53e8ad461797d8c8126a3e5afb51e7db55186f4ccba23ea574e13ccc31cb2e681f8b341f84830d7fa0ee636f9ce74767063d73f37efebaca7bc12ba40d
6
+ metadata.gz: efe03b92346c0fb021f2d5c4780966bb5267b448e0c209a48a14631af6b8031970d8e09f01c3b5594e72ead6aa89bae257e577ea9f9733bcba059795cbc96b37
7
+ data.tar.gz: '09271ae875d3d5e3ccddf69a5144afabdbf16e481b05633d4dfeb7aec2132fcea2024b233c65971a870c4d0fdc18ddea0bd4c3053c7d4eef10e178a5ec3d87b1'
data/README.md CHANGED
@@ -74,7 +74,7 @@ format_xls 'table.my-table' do
74
74
  workbook use_autowidth: true
75
75
  sheet orientation: landscape
76
76
  format 'th', b: true # bold
77
- format 'tbody tr', bg_color: lambda { |row| 'ddffdd' if row.index.odd? }
77
+ format 'tbody tr', bg_color: lambda { |row| 'ddffdd' if row.row_index.odd? }
78
78
  format 'A3:B10', i: true # italic
79
79
  format column: 0, width: 35
80
80
  format 'td.custom', lambda { |cell| modify cell somehow.}
@@ -112,7 +112,7 @@ end
112
112
  You can define themes, i.e. blocks of formatting code:
113
113
  ```ruby
114
114
  ToSpreadsheet.theme :zebra do
115
- format 'tr', bg_color: lambda { |row| 'ddffdd' if row.index.odd? }
115
+ format 'tr', bg_color: lambda { |row| 'ddffdd' if row.row_index.odd? }
116
116
  end
117
117
  ```
118
118
 
@@ -8,7 +8,7 @@ module ToSpreadsheet
8
8
  wb = sheet.workbook
9
9
  case selector_type
10
10
  when :css
11
- css_match selector_query, context.to_xml_node(sheet) do |xml_node|
11
+ css_match selector_query, context.to_xml_node(sheet) do |xml_node|
12
12
  add_and_apply_style wb, context, context.to_xls_entity(xml_node)
13
13
  end
14
14
  when :row
@@ -1,3 +1,3 @@
1
1
  module ToSpreadsheet
2
- VERSION = '1.0.7'
2
+ VERSION = '1.1.0'
3
3
  end
data/spec/format_spec.rb CHANGED
@@ -6,7 +6,7 @@ describe ToSpreadsheet::Rule::Format do
6
6
  :ruby
7
7
  format_xls do
8
8
  format column: 0, width: 25
9
- format 'tr', fg_color: lambda { |row| 'cccccc' if row.index.odd? }
9
+ format 'tr', fg_color: lambda { |row| 'cccccc' if row.row_index.odd? }
10
10
  format 'table' do |ws|
11
11
  ws.name = 'Test'
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: axlsx
42
+ name: caxlsx
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -174,13 +174,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.0.6
177
+ rubygems_version: 3.1.2
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Render existing views as Excel documents with style!
181
181
  test_files:
182
- - spec/format_spec.rb
183
- - spec/rails_integration_spec.rb
184
- - spec/types_spec.rb
185
182
  - spec/defaults_spec.rb
183
+ - spec/rails_integration_spec.rb
186
184
  - spec/worksheets_spec.rb
185
+ - spec/format_spec.rb
186
+ - spec/types_spec.rb