haml 2.2.18 → 2.2.19

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

data/Rakefile CHANGED
@@ -72,10 +72,9 @@ task :install => [:package] do
72
72
  end
73
73
 
74
74
  desc "Release a new Haml package to Rubyforge."
75
- task :release => [:check_release, :package] do
75
+ task :release => [:check_release, :release_elpa, :package] do
76
76
  name = File.read("VERSION_NAME").strip
77
77
  version = File.read("VERSION").strip
78
- #sh %{rubyforge login}
79
78
  sh %{rubyforge add_release haml haml "#{name} (v#{version})" pkg/haml-#{version}.gem}
80
79
  sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.tar.gz}
81
80
  sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.tar.bz2}
@@ -129,7 +128,7 @@ end
129
128
  # Ensures that the version have been updated for a new release.
130
129
  task :check_release do
131
130
  version = File.read("VERSION").strip
132
- #raise "There have been changes since current version (#{version})" if changed_since?(version)
131
+ raise "There have been changes since current version (#{version})" if changed_since?(version)
133
132
  raise "VERSION_NAME must not be 'Bleeding Edge'" if File.read("VERSION_NAME") == "Bleeding Edge"
134
133
  end
135
134
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.18
1
+ 2.2.19
@@ -114,7 +114,7 @@ module ActionView
114
114
  if is_haml?
115
115
  haml_buffer.buffer.concat(string)
116
116
  else
117
- concat_without_haml(string)
117
+ safe_concat_without_haml(string)
118
118
  end
119
119
  end
120
120
  alias_method :safe_concat_without_haml, :safe_concat
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.18
4
+ version: 2.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-02-04 00:00:00 -08:00
13
+ date: 2010-02-07 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -134,7 +134,6 @@ files:
134
134
  - test/sass/more_results/more_import.css
135
135
  - test/sass/more_results/more1_with_line_comments.css
136
136
  - test/sass/more_results/more1.css
137
- - test/sass/to_sass_test.rb
138
137
  - test/sass/templates/basic.sass
139
138
  - test/sass/templates/bork.sass
140
139
  - test/sass/templates/compressed.sass
@@ -277,7 +276,6 @@ summary: An elegant, structured XHTML/XML templating engine. Comes with Sass, a
277
276
  test_files:
278
277
  - test/sass/script_test.rb
279
278
  - test/sass/css2sass_test.rb
280
- - test/sass/to_sass_test.rb
281
279
  - test/sass/functions_test.rb
282
280
  - test/sass/engine_test.rb
283
281
  - test/sass/plugin_test.rb
@@ -1,549 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
-
4
- class ToSassTest < Test::Unit::TestCase
5
- def test_basic
6
- assert_renders <<SASS, <<SCSS
7
- foo bar
8
- baz: bang
9
- bip: bop
10
- SASS
11
- foo bar {
12
- baz: bang;
13
- bip: bop; }
14
- SCSS
15
- assert_renders <<SASS, <<SCSS, :old => true
16
- foo bar
17
- :baz bang
18
- :bip bop
19
- SASS
20
- foo bar {
21
- baz: bang;
22
- bip: bop; }
23
- SCSS
24
- end
25
-
26
- def test_nesting
27
- assert_renders <<SASS, <<SCSS
28
- foo bar
29
- baz bang
30
- baz: bang
31
- bip: bop
32
- blat: boo
33
- SASS
34
- foo bar {
35
- baz bang {
36
- baz: bang;
37
- bip: bop; }
38
- blat: boo; }
39
- SCSS
40
- end
41
-
42
- def test_nesting_with_parent_ref
43
- assert_renders <<SASS, <<SCSS
44
- foo bar
45
- &:hover
46
- baz: bang
47
- SASS
48
- foo bar {
49
- &:hover {
50
- baz: bang; } }
51
- SCSS
52
- end
53
-
54
- def test_selector_interpolation
55
- assert_renders <<SASS, <<SCSS
56
- foo \#{!bar + "baz"}.bip
57
- baz: bang
58
- SASS
59
- foo \#{!bar + "baz"}.bip {
60
- baz: bang; }
61
- SCSS
62
- end
63
-
64
- def test_multiline_selector_with_commas
65
- assert_renders <<SASS, <<SCSS
66
- foo bar,
67
- baz bang
68
- baz: bang
69
- SASS
70
- foo bar,
71
- baz bang {
72
- baz: bang; }
73
- SCSS
74
-
75
- assert_renders <<SASS, <<SCSS
76
- blat
77
- foo bar,
78
- baz bang
79
- baz: bang
80
- SASS
81
- blat {
82
- foo bar,
83
- baz bang {
84
- baz: bang; } }
85
- SCSS
86
- end
87
-
88
- def test_multiline_selector_without_commas
89
- assert_renders <<SASS, <<SCSS
90
- foo bar baz bang
91
- baz: bang
92
- SASS
93
- foo bar
94
- baz bang {
95
- baz: bang; }
96
- SCSS
97
- end
98
-
99
- def test_escaped_selector
100
- assert_renders <<SASS, <<SCSS
101
- foo bar
102
- \\:hover
103
- baz: bang
104
- SASS
105
- foo bar {
106
- :hover {
107
- baz: bang; } }
108
- SCSS
109
- end
110
-
111
- def test_property_name_interpolation
112
- assert_renders <<SASS, <<SCSS
113
- foo bar
114
- baz\#{!bang}bip\#{!bop}: 12
115
- SASS
116
- foo bar {
117
- baz\#{!bang}bip\#{!bop}: 12; }
118
- SCSS
119
- end
120
-
121
- def test_property_name_interpolation
122
- assert_renders <<SASS, <<SCSS
123
- foo bar
124
- baz\#{!bang}bip\#{!bop}: 12
125
- SASS
126
- foo bar {
127
- baz\#{!bang}bip\#{!bop}: 12; }
128
- SCSS
129
- end
130
-
131
- def test_property_value_interpolation
132
- assert_renders <<SASS, <<SCSS
133
- foo bar
134
- baz: 12 \#{!bang} bip \#{"bop"} blat
135
- SASS
136
- foo bar {
137
- baz: 12 \#{!bang} bip \#{"bop"} blat; }
138
- SCSS
139
- end
140
-
141
- def test_dynamic_properties
142
- assert_renders <<SASS, <<SCSS
143
- foo bar
144
- baz= 12 !bang "bip"
145
- SASS
146
- foo bar {
147
- baz= 12 !bang "bip"; }
148
- SCSS
149
- end
150
-
151
- def test_dynamic_properties_with_old
152
- assert_renders <<SASS, <<SCSS, :old => true
153
- foo bar
154
- :baz= 12 !bang "bip"
155
- SASS
156
- foo bar {
157
- baz= 12 !bang "bip"; }
158
- SCSS
159
- end
160
-
161
- def test_multiline_properties
162
- assert_renders <<SASS, <<SCSS
163
- foo bar
164
- baz: bip bam boon
165
- SASS
166
- foo bar {
167
- baz:
168
- bip
169
- bam
170
- boon; }
171
- SCSS
172
- end
173
-
174
- def test_multiline_dynamic_properties
175
- assert_renders <<SASS, <<SCSS
176
- foo bar
177
- baz= !bip "bam" 12px
178
- SASS
179
- foo bar {
180
- baz=
181
- !bip
182
- "bam"
183
- 12px; }
184
- SCSS
185
- end
186
-
187
- def test_silent_comments
188
- assert_renders <<SASS, <<SCSS
189
- // foo
190
-
191
- // bar
192
-
193
- // baz
194
-
195
- foo bar
196
- a: b
197
- SASS
198
- // foo
199
-
200
- // bar
201
-
202
- // baz
203
-
204
- foo bar {
205
- a: b; }
206
- SCSS
207
-
208
- assert_renders <<SASS, <<SCSS
209
- // foo
210
- bar
211
- baz
212
- bang
213
-
214
- foo bar
215
- a: b
216
- SASS
217
- // foo
218
- // bar
219
- // baz
220
- // bang
221
-
222
- foo bar {
223
- a: b; }
224
- SCSS
225
- end
226
-
227
-
228
- def test_loud_comments
229
- assert_renders <<SASS, <<SCSS
230
- /* foo
231
-
232
- /* bar
233
-
234
- /* baz
235
-
236
- foo bar
237
- a: b
238
- SASS
239
- /* foo */
240
-
241
- /* bar */
242
-
243
- /* baz */
244
-
245
- foo bar {
246
- a: b; }
247
- SCSS
248
-
249
- assert_renders <<SASS, <<SCSS
250
- /* foo
251
- bar
252
- baz
253
- bang
254
-
255
- foo bar
256
- a: b
257
- SASS
258
- /* foo
259
- bar
260
- baz
261
- bang */
262
-
263
- foo bar {
264
- a: b; }
265
- SCSS
266
-
267
- assert_renders <<SASS, <<SCSS
268
- /* foo
269
- bar
270
- baz
271
- bang
272
-
273
- foo bar
274
- a: b
275
- SASS
276
- /* foo
277
- * bar
278
- * baz
279
- * bang */
280
-
281
- foo bar {
282
- a: b; }
283
- SCSS
284
- end
285
-
286
- def test_loud_comments_with_weird_indentation
287
- assert_renders <<SASS, <<SCSS
288
- foo
289
- /* foo
290
- bar
291
- baz
292
- a: b
293
- SASS
294
- foo {
295
- /* foo
296
- bar
297
- baz */
298
- a: b; }
299
- SCSS
300
- end
301
-
302
- def test_debug
303
- assert_renders <<SASS, <<SCSS
304
- foo
305
- @debug 12px
306
- bar: baz
307
- SASS
308
- foo {
309
- @debug 12px;
310
- bar: baz; }
311
- SCSS
312
- end
313
-
314
- def test_directive_without_children
315
- assert_renders <<SASS, <<SCSS
316
- foo
317
- @foo #bar "baz"
318
- bar: baz
319
- SASS
320
- foo {
321
- @foo #bar "baz";
322
- bar: baz; }
323
- SCSS
324
- end
325
-
326
- def test_directive_with_prop_children
327
- assert_renders <<SASS, <<SCSS
328
- foo
329
- @foo #bar "baz"
330
- a: b
331
- c: d
332
-
333
- bar: baz
334
- SASS
335
- foo {
336
- @foo #bar "baz" {
337
- a: b;
338
- c: d; }
339
-
340
- bar: baz; }
341
- SCSS
342
- end
343
-
344
- def test_directive_with_rule_children
345
- assert_renders <<SASS, <<SCSS
346
- foo
347
- @foo #bar "baz"
348
- #blat
349
- a: b
350
- .bang
351
- c: d
352
- e: f
353
-
354
- bar: baz
355
- SASS
356
- foo {
357
- @foo #bar "baz" {
358
- #blat {
359
- a: b; }
360
- .bang {
361
- c: d;
362
- e: f; } }
363
-
364
- bar: baz; }
365
- SCSS
366
- end
367
-
368
- def test_directive_with_rule_and_prop_children
369
- assert_renders <<SASS, <<SCSS
370
- foo
371
- @foo #bar "baz"
372
- g: h
373
- #blat
374
- a: b
375
- .bang
376
- c: d
377
- e: f
378
- i: j
379
-
380
- bar: baz
381
- SASS
382
- foo {
383
- @foo #bar "baz" {
384
- g: h;
385
- #blat {
386
- a: b; }
387
- .bang {
388
- c: d;
389
- e: f; }
390
- i: j; }
391
-
392
- bar: baz; }
393
- SCSS
394
- end
395
-
396
- def test_for
397
- assert_renders <<SASS, <<SCSS
398
- foo
399
- @for !a from !b to !c
400
- a: b
401
- @for !c from 1 to 16
402
- d: e
403
- f: g
404
- SASS
405
- foo {
406
- @for !a from !b to !c {
407
- a: b; }
408
- @for !c from 1 to 16 {
409
- d: e;
410
- f: g; } }
411
- SCSS
412
- end
413
-
414
- def test_if
415
- assert_renders <<SASS, <<SCSS
416
- foo
417
- @if !foo or !bar
418
- a: b
419
- @if !baz
420
- d: e
421
- @else if !bang
422
- f: g
423
- @else
424
- h: i
425
- SASS
426
- foo {
427
- @if !foo or !bar {
428
- a: b; }
429
- @if !baz {
430
- d: e; }
431
- @else if !bang {
432
- f: g; }
433
- @else {
434
- h: i; } }
435
- SCSS
436
- end
437
-
438
- def test_import
439
- assert_renders <<SASS, <<SCSS
440
- @import foo
441
-
442
- foo
443
- bar: baz
444
- SASS
445
- @import "foo";
446
-
447
- foo {
448
- bar: baz; }
449
- SCSS
450
-
451
- assert_renders <<SASS, <<SCSS
452
- @import foo.css
453
-
454
- foo
455
- bar: baz
456
- SASS
457
- @import "foo.css";
458
-
459
- foo {
460
- bar: baz; }
461
- SCSS
462
- end
463
-
464
- def test_import_as_directive_in_sass
465
- assert_sass_to_sass '@import "foo.css"'
466
- assert_sass_to_sass '@import url(foo.css)'
467
- end
468
-
469
- def test_import_as_directive_in_scss
470
- assert_renders <<SASS, <<SCSS
471
- @import "foo.css" print
472
- SASS
473
- @import "foo.css" print;
474
- SCSS
475
-
476
- assert_renders <<SASS, <<SCSS
477
- @import url(foo.css) screen, print
478
- SASS
479
- @import url(foo.css) screen, print;
480
- SCSS
481
- end
482
-
483
- def test_argless_mixin_definition
484
- assert_renders <<SASS, <<SCSS
485
- =foo-bar
486
- baz
487
- a: b
488
- SASS
489
- @mixin foo-bar {
490
- baz {
491
- a: b; } }
492
- SCSS
493
-
494
- assert_renders <<SASS, render(<<SCSS)
495
- =foo-bar
496
- baz
497
- a: b
498
- SASS
499
- @mixin foo-bar() {
500
- baz {
501
- a: b; } }
502
- SCSS
503
- end
504
-
505
- def test_mixin_definition_without_defaults
506
- assert_renders <<SASS, <<SCSS
507
- =foo-bar(!baz, !bang)
508
- baz
509
- a = !baz !bang
510
- SASS
511
- @mixin foo-bar(!baz, !bang) {
512
- baz {
513
- a = !baz !bang; } }
514
- SCSS
515
- end
516
-
517
- def test_mixin_definition_with_defaults
518
- assert_renders <<SASS, <<SCSS
519
- =foo-bar(!baz, !bang = 12px)
520
- baz
521
- a = !baz !bang
522
- SASS
523
- @mixin foo-bar(!baz, !bang = 12px) {
524
- baz {
525
- a = !baz !bang; } }
526
- SCSS
527
- end
528
-
529
- private
530
-
531
- def assert_sass_to_sass(sass, options = {})
532
- assert_equal(sass.rstrip, render(sass, options).rstrip,
533
- "Expected Sass to transform to itself")
534
- end
535
-
536
- def assert_scss_to_sass(sass, scss, options = {})
537
- assert_equal(sass.rstrip, render(scss, options.merge(:syntax => :scss)).rstrip,
538
- "Expected SCSS to transform to Sass")
539
- end
540
-
541
- def assert_renders(sass, scss, options = {})
542
- assert_sass_to_sass(sass, options)
543
- assert_scss_to_sass(sass, scss, options)
544
- end
545
-
546
- def render(scss, options = {})
547
- Sass::Engine.new(scss, options).to_tree.to_sass(options)
548
- end
549
- end