to_spreadsheet 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/to_spreadsheet/rails/action_pack_renderers.rb +1 -1
- data/lib/to_spreadsheet/rule.rb +2 -2
- data/lib/to_spreadsheet/version.rb +1 -1
- data/spec/defaults_spec.rb +2 -2
- data/spec/format_spec.rb +3 -3
- data/spec/types_spec.rb +4 -4
- data/spec/worksheets_spec.rb +1 -1
- metadata +36 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 776455eae95d6fc809d03558bc270aead0bb0c57
|
4
|
+
data.tar.gz: f38ea16841baabc6bcccfe42eb3d01d8d1d4d624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf617a13f77b92278751e2ffc70516d00a7e026c892c13d6deb36c8fe63f6754428ad032a696ba2387183fcf245775266364ded8614ce915fef2375180652e6
|
7
|
+
data.tar.gz: 0dd83cfc2f159be301559c61861f3eae5eb1f0e60fb297226d368ba84df6cd003aefdfd6d893a28d8541032de50c5c2955c19f9e86b3bab11c636f74492de6f8
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'action_controller/metal/renderers'
|
3
|
-
require 'action_controller/
|
3
|
+
require 'action_controller/responder'
|
4
4
|
|
5
5
|
# This will let us do thing like `render :xlsx => 'index'`
|
6
6
|
# This is similar to how Rails internally implements its :json and :xml renderers
|
data/lib/to_spreadsheet/rule.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'active_support/core_ext'
|
1
|
+
require 'active_support/core_ext/string'
|
2
2
|
module ToSpreadsheet
|
3
3
|
module Rule
|
4
4
|
def self.make(rule_type, selector_type, selector_value, options)
|
@@ -6,4 +6,4 @@ module ToSpreadsheet
|
|
6
6
|
klass.new(selector_type, selector_value, options)
|
7
7
|
end
|
8
8
|
end
|
9
|
-
end
|
9
|
+
end
|
data/spec/defaults_spec.rb
CHANGED
@@ -20,10 +20,10 @@ HAML
|
|
20
20
|
|
21
21
|
context 'default values' do
|
22
22
|
it 'get set when the cell is empty' do
|
23
|
-
row.cells[0].value.
|
23
|
+
expect(row.cells[0].value).to eq(100)
|
24
24
|
end
|
25
25
|
it 'does not get set when the cell is not empty' do
|
26
|
-
row.cells[1].value.
|
26
|
+
expect(row.cells[1].value).to eq(50)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/spec/format_spec.rb
CHANGED
@@ -23,16 +23,16 @@ describe ToSpreadsheet::Rule::Format do
|
|
23
23
|
|
24
24
|
context 'local styles' do
|
25
25
|
it 'sets column width' do
|
26
|
-
sheet.column_info[0].width.
|
26
|
+
expect(sheet.column_info[0].width).to eq(25)
|
27
27
|
end
|
28
28
|
it 'runs lambdas on properties' do
|
29
29
|
cell = sheet.rows[1].cells[0]
|
30
30
|
styles = sheet.workbook.styles
|
31
31
|
font_id = styles.cellXfs[cell.style].fontId
|
32
|
-
styles.fonts[font_id].color.rgb.
|
32
|
+
expect(styles.fonts[font_id].color.rgb).to eq(Axlsx::Color.new(rgb: 'cccccc').rgb)
|
33
33
|
end
|
34
34
|
it 'runs blocks for selectors' do
|
35
|
-
sheet.name.
|
35
|
+
expect(sheet.name).to eq('Test')
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
data/spec/types_spec.rb
CHANGED
@@ -19,19 +19,19 @@ HAML
|
|
19
19
|
|
20
20
|
context 'data types' do
|
21
21
|
it 'num' do
|
22
|
-
row.cells[0].value.
|
22
|
+
expect(row.cells[0].value).to eq(20)
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'float' do
|
26
|
-
row.cells[1].type.
|
26
|
+
expect(row.cells[1].type).to be :float
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'date' do
|
30
|
-
row.cells[2].type.
|
30
|
+
expect(row.cells[2].type).to be :date
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'empty date' do
|
34
|
-
row.cells[3].type.
|
34
|
+
expect(row.cells[3].type).not_to be :date
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/spec/worksheets_spec.rb
CHANGED
metadata
CHANGED
@@ -1,97 +1,111 @@
|
|
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.0.5
|
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: 2015-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: axlsx
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: chronic
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: responders
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: haml-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec-rails
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
description: Render XLSX from Rails using existing views ( .*.html => .xlsx )
|
@@ -101,28 +115,28 @@ extensions: []
|
|
101
115
|
extra_rdoc_files:
|
102
116
|
- README.textile
|
103
117
|
files:
|
104
|
-
- README.textile
|
105
118
|
- LICENSE
|
119
|
+
- README.textile
|
106
120
|
- Rakefile
|
107
|
-
- lib/to_spreadsheet
|
121
|
+
- lib/to_spreadsheet.rb
|
108
122
|
- lib/to_spreadsheet/context.rb
|
123
|
+
- lib/to_spreadsheet/context/pairing.rb
|
109
124
|
- lib/to_spreadsheet/rails/action_pack_renderers.rb
|
110
125
|
- lib/to_spreadsheet/rails/mime_types.rb
|
111
126
|
- lib/to_spreadsheet/rails/view_helpers.rb
|
112
127
|
- lib/to_spreadsheet/railtie.rb
|
113
128
|
- lib/to_spreadsheet/renderer.rb
|
129
|
+
- lib/to_spreadsheet/rule.rb
|
114
130
|
- lib/to_spreadsheet/rule/base.rb
|
115
131
|
- lib/to_spreadsheet/rule/container.rb
|
116
132
|
- lib/to_spreadsheet/rule/default_value.rb
|
117
133
|
- lib/to_spreadsheet/rule/format.rb
|
118
134
|
- lib/to_spreadsheet/rule/sheet.rb
|
119
135
|
- lib/to_spreadsheet/rule/workbook.rb
|
120
|
-
- lib/to_spreadsheet/rule.rb
|
121
136
|
- lib/to_spreadsheet/selectors.rb
|
122
137
|
- lib/to_spreadsheet/themes/default.rb
|
123
138
|
- lib/to_spreadsheet/type_from_value.rb
|
124
139
|
- lib/to_spreadsheet/version.rb
|
125
|
-
- lib/to_spreadsheet.rb
|
126
140
|
- spec/defaults_spec.rb
|
127
141
|
- spec/format_spec.rb
|
128
142
|
- spec/types_spec.rb
|
@@ -136,17 +150,17 @@ require_paths:
|
|
136
150
|
- lib
|
137
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
138
152
|
requirements:
|
139
|
-
- -
|
153
|
+
- - ">="
|
140
154
|
- !ruby/object:Gem::Version
|
141
155
|
version: '0'
|
142
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
|
-
- -
|
158
|
+
- - ">="
|
145
159
|
- !ruby/object:Gem::Version
|
146
160
|
version: '0'
|
147
161
|
requirements: []
|
148
162
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.4.6
|
150
164
|
signing_key:
|
151
165
|
specification_version: 4
|
152
166
|
summary: Render existing views as Excel documents with style!
|
@@ -155,3 +169,4 @@ test_files:
|
|
155
169
|
- spec/format_spec.rb
|
156
170
|
- spec/types_spec.rb
|
157
171
|
- spec/worksheets_spec.rb
|
172
|
+
has_rdoc: true
|