inky-rb 1.3.8.0 → 1.4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/inky.gemspec +5 -5
  3. data/lib/inky/component_factory.rb +15 -8
  4. data/lib/inky/rails/version.rb +1 -1
  5. data/lib/inky.rb +6 -1
  6. data/spec/cases/button/with_extra_attr.inky +3 -0
  7. data/spec/cases/button/with_link.inky +1 -1
  8. data/spec/cases/button/with_link_and_extra_attr.inky +3 -0
  9. data/spec/cases/h_line/basic.inky +1 -0
  10. data/spec/cases/h_line/multiple.inky +8 -0
  11. data/spec/cases/h_line/with_attr.inky +2 -0
  12. data/spec/cases/spacer/with_attr.inky +6 -0
  13. data/spec/cases/spacer/with_size.inky +1 -1
  14. data/spec/cases/spacer/with_size_lg.inky +1 -1
  15. data/spec/cases/spacer/with_size_sm.inky +1 -1
  16. data/spec/cases/spacer/with_size_sm_and_lg.inky +1 -1
  17. data/spec/cases/spacer/with_sizes_and_attr.inky +6 -0
  18. data/spec/components_spec.rb +48 -48
  19. data/spec/grid_spec.rb +38 -38
  20. data/spec/spec_helper.rb +0 -1
  21. data/spec/test_app/log/test.log +101 -4702
  22. data/spec/test_app/spec/features/inky_spec.rb +3 -3
  23. metadata +85 -131
  24. data/spec/_cases_output/button/no_link.inky +0 -1
  25. data/spec/_cases_output/button/with_expand_class.inky +0 -4
  26. data/spec/_cases_output/button/with_image.inky +0 -3
  27. data/spec/_cases_output/button/with_link.inky +0 -3
  28. data/spec/_cases_output/button/with_tricky_class.inky +0 -22
  29. data/spec/_cases_output/callout/basic.inky +0 -1
  30. data/spec/_cases_output/callout/with_attributes.inky +0 -3
  31. data/spec/_cases_output/general/empty_attributes.inky +0 -6
  32. data/spec/_cases_output/general/multiple_root.inky +0 -2
  33. data/spec/_cases_output/general/no_tag.inky +0 -1
  34. data/spec/_cases_output/general/root_within_text.inky +0 -3
  35. data/spec/_cases_output/general/void_html_elements.inky +0 -6
  36. data/spec/_cases_output/grid/columns.inky +0 -2
  37. data/spec/_cases_output/grid/container.inky +0 -1
  38. data/spec/_cases_output/grid/container_with_align.inky +0 -1
  39. data/spec/_cases_output/grid/row.inky +0 -1
  40. data/spec/_cases_output/grid/row_with_columns.inky +0 -5
  41. data/spec/_cases_output/menu/item.inky +0 -1
  42. data/spec/_cases_output/menu/menu.inky +0 -2
  43. data/spec/_cases_output/menu/menu_with_align.inky +0 -2
  44. data/spec/_cases_output/menu/menu_with_items.inky +0 -5
  45. data/spec/_cases_output/spacer/basic.inky +0 -5
  46. data/spec/_cases_output/spacer/with_size.inky +0 -5
  47. data/spec/_cases_output/spacer/with_size_lg.inky +0 -5
  48. data/spec/_cases_output/spacer/with_size_sm.inky +0 -5
  49. data/spec/_cases_output/spacer/with_size_sm_and_lg.inky +0 -5
  50. data/spec/_cases_output/wrapper/basic.inky +0 -1
  51. data/spec/_cases_output/wrapper/with_align.inky +0 -1
  52. data/spec/_cases_output/wrapper/with_attributes.inky +0 -1
data/spec/grid_spec.rb CHANGED
@@ -61,12 +61,12 @@ RSpec.describe 'Grid' do
61
61
  input = '<columns>One</columns>'
62
62
  expected = <<-HTML
63
63
  <th class="small-12 large-12 columns first last">
64
- <table>
64
+ <table><tbody>
65
65
  <tr>
66
66
  <th>One</th>
67
67
  <th class="expander"></th>
68
68
  </tr>
69
- </table>
69
+ </tbody></table>
70
70
  </th>
71
71
  HTML
72
72
 
@@ -84,12 +84,12 @@ RSpec.describe 'Grid' do
84
84
  input = '<columns>One</columns>'
85
85
  expected = <<-HTML
86
86
  <th class="small-5 large-5 columns first last">
87
- <table>
87
+ <table><tbody>
88
88
  <tr>
89
89
  <th>One</th>
90
90
  <th class="expander"></th>
91
91
  </tr>
92
- </table>
92
+ </tbody></table>
93
93
  </th>
94
94
  HTML
95
95
 
@@ -105,12 +105,12 @@ RSpec.describe 'Grid' do
105
105
  input = '<columns large="12" small="12">One</columns>'
106
106
  expected = <<-HTML
107
107
  <th class="small-12 large-12 columns first last">
108
- <table>
108
+ <table><tbody>
109
109
  <tr>
110
110
  <th>One</th>
111
111
  <th class="expander"></th>
112
112
  </tr>
113
- </table>
113
+ </tbody></table>
114
114
  </th>
115
115
  HTML
116
116
 
@@ -127,18 +127,18 @@ RSpec.describe 'Grid' do
127
127
  expected = <<-HTML
128
128
  <body>
129
129
  <th class="small-12 large-6 columns first">
130
- <table>
130
+ <table><tbody>
131
131
  <tr>
132
132
  <th>One</th>
133
133
  </tr>
134
- </table>
134
+ </tbody></table>
135
135
  </th>
136
136
  <th class="small-12 large-6 columns last">
137
- <table>
137
+ <table><tbody>
138
138
  <tr>
139
139
  <th>Two</th>
140
140
  </tr>
141
- </table>
141
+ </tbody></table>
142
142
  </th>
143
143
  </body>
144
144
  HTML
@@ -157,25 +157,25 @@ RSpec.describe 'Grid' do
157
157
  expected = <<-INKY
158
158
  <body>
159
159
  <th class="small-12 large-4 columns first">
160
- <table>
160
+ <table><tbody>
161
161
  <tr>
162
162
  <th>One</th>
163
163
  </tr>
164
- </table>
164
+ </tbody></table>
165
165
  </th>
166
166
  <th class="small-12 large-4 columns">
167
- <table>
167
+ <table><tbody>
168
168
  <tr>
169
169
  <th>Two</th>
170
170
  </tr>
171
- </table>
171
+ </tbody></table>
172
172
  </th>
173
173
  <th class="small-12 large-4 columns last">
174
- <table>
174
+ <table><tbody>
175
175
  <tr>
176
176
  <th>Three</th>
177
177
  </tr>
178
- </table>
178
+ </tbody></table>
179
179
  </th>
180
180
  </body>
181
181
  INKY
@@ -187,12 +187,12 @@ RSpec.describe 'Grid' do
187
187
  input = '<columns class="small-offset-8 hide-for-small">One</columns>'
188
188
  expected = <<-HTML
189
189
  <th class="small-12 large-12 columns small-offset-8 hide-for-small first last">
190
- <table>
190
+ <table><tbody>
191
191
  <tr>
192
192
  <th>One</th>
193
193
  <th class="expander"></th>
194
194
  </tr>
195
- </table>
195
+ </tbody></table>
196
196
  </th>
197
197
  HTML
198
198
 
@@ -210,18 +210,18 @@ RSpec.describe 'Grid' do
210
210
  expected = <<-INKY
211
211
  <body>
212
212
  <th class="small-4 large-4 columns first">
213
- <table>
213
+ <table><tbody>
214
214
  <tr>
215
215
  <th>One</th>
216
216
  </tr>
217
- </table>
217
+ </tbody></table>
218
218
  </th>
219
219
  <th class="small-8 large-8 columns last">
220
- <table>
220
+ <table><tbody>
221
221
  <tr>
222
222
  <th>Two</th>
223
223
  </tr>
224
- </table>
224
+ </tbody></table>
225
225
  </th>
226
226
  </body>
227
227
  INKY
@@ -239,18 +239,18 @@ RSpec.describe 'Grid' do
239
239
  expected = <<-HTML
240
240
  <body>
241
241
  <th class="small-12 large-4 columns first">
242
- <table>
242
+ <table><tbody>
243
243
  <tr>
244
244
  <th>One</th>
245
245
  </tr>
246
- </table>
246
+ </tbody></table>
247
247
  </th>
248
248
  <th class="small-12 large-8 columns last">
249
- <table>
249
+ <table><tbody>
250
250
  <tr>
251
251
  <th>Two</th>
252
252
  </tr>
253
- </table>
253
+ </tbody></table>
254
254
  </th>
255
255
  </body>
256
256
  HTML
@@ -268,18 +268,18 @@ RSpec.describe 'Grid' do
268
268
  expected = <<-HTML
269
269
  <body>
270
270
  <th class="small-12 large-6 columns first">
271
- <table>
271
+ <table><tbody>
272
272
  <tr>
273
273
  <th>One</th>
274
274
  </tr>
275
- </table>
275
+ </tbody></table>
276
276
  </th>
277
277
  <th class="small-12 large-6 columns last">
278
- <table>
278
+ <table><tbody>
279
279
  <tr>
280
280
  <th>Two</th>
281
281
  </tr>
282
- </table>
282
+ </tbody></table>
283
283
  </th>
284
284
  </body>
285
285
  HTML
@@ -294,7 +294,7 @@ RSpec.describe 'Grid' do
294
294
  <tbody>
295
295
  <tr>
296
296
  <th class="small-12 large-12 columns first last">
297
- <table>
297
+ <table><tbody>
298
298
  <tr>
299
299
  <th>
300
300
  <table class="row">
@@ -304,7 +304,7 @@ RSpec.describe 'Grid' do
304
304
  </table>
305
305
  </th>
306
306
  </tr>
307
- </table>
307
+ </tbody></table>
308
308
  </th>
309
309
  </tr>
310
310
  </tbody>
@@ -318,13 +318,13 @@ RSpec.describe 'Grid' do
318
318
  input = '<columns small="6" valign="middle" foo="bar">x</columns>'
319
319
  expected = <<-HTML
320
320
  <th class="small-6 large-6 columns first last" valign="middle" foo="bar">
321
- <table>
321
+ <table><tbody>
322
322
  <tr>
323
323
  <th>
324
324
  x
325
325
  </th>
326
326
  </tr>
327
- </table>
327
+ </tbody></table>
328
328
  </th>
329
329
  HTML
330
330
 
@@ -336,9 +336,9 @@ RSpec.describe 'Block Grid' do
336
336
  it 'returns the correct block grid syntax' do
337
337
  input = '<block-grid up="4"></block-grid>'
338
338
  expected = <<-HTML
339
- <table class="block-grid up-4">
339
+ <table class="block-grid up-4"><tbody>
340
340
  <tr></tr>
341
- </table>
341
+ </tbody></table>
342
342
  HTML
343
343
 
344
344
  compare(input, expected)
@@ -347,9 +347,9 @@ RSpec.describe 'Block Grid' do
347
347
  it 'copies classes to the final HTML output' do
348
348
  input = '<block-grid up="4" class="show-for-large"></block-grid>'
349
349
  expected = <<-HTML
350
- <table class="block-grid up-4 show-for-large">
350
+ <table class="block-grid up-4 show-for-large"><tbody>
351
351
  <tr></tr>
352
- </table>
352
+ </tbody></table>
353
353
  HTML
354
354
 
355
355
  compare(input, expected)
data/spec/spec_helper.rb CHANGED
@@ -11,7 +11,6 @@ def reformat_html(html)
11
11
  .gsub(/ </, '<').gsub(/> /, '>') # Remove leading/trailing spaces inside tags
12
12
  .gsub(' data-parsed=""', '') # Don't consider this known inky-node artefact
13
13
  .gsub(' data-parsed>', '>') # Ditto
14
- .gsub('&#xA0;', ' ') # These are the same entity...
15
14
  .gsub(/(align="[^"]+") (class="[^"]+")/, '\2 \1') # Tweak order to match inky-node on container
16
15
  .gsub(/class\="([^"]+)"/) do # Sort class names
17
16
  classes = $1.split(' ').sort.join(' ')