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 +4 -4
- data/README.md +2 -2
- data/lib/to_spreadsheet/rule/format.rb +1 -1
- data/lib/to_spreadsheet/version.rb +1 -1
- data/spec/format_spec.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59db3fcd754f0a95dd09f3fe7ffae57462a002745b6993a9fc3baa84014378ed
|
4
|
+
data.tar.gz: 831e9e4a81117cb1904bf503a05d1e3bb24ed817f90de0f031d05cb292308143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
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.
|
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
|
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:
|
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:
|
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.
|
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
|