spree 0.8.0 → 0.8.1

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

Potentially problematic release.


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

Files changed (181) hide show
  1. data/CHANGELOG +4 -0
  2. data/config/environment.rb +3 -3
  3. data/lib/spree.rb +1 -1
  4. data/public/stylesheets/compiled/screen.css +59 -267
  5. metadata +4 -207
  6. data/vendor/gems/haml-2.1.0/FAQ +0 -138
  7. data/vendor/gems/haml-2.1.0/MIT-LICENSE +0 -20
  8. data/vendor/gems/haml-2.1.0/README.rdoc +0 -332
  9. data/vendor/gems/haml-2.1.0/REVISION +0 -1
  10. data/vendor/gems/haml-2.1.0/Rakefile +0 -185
  11. data/vendor/gems/haml-2.1.0/VERSION +0 -1
  12. data/vendor/gems/haml-2.1.0/bin/css2sass +0 -7
  13. data/vendor/gems/haml-2.1.0/bin/haml +0 -9
  14. data/vendor/gems/haml-2.1.0/bin/html2haml +0 -7
  15. data/vendor/gems/haml-2.1.0/bin/sass +0 -8
  16. data/vendor/gems/haml-2.1.0/extra/haml-mode.el +0 -434
  17. data/vendor/gems/haml-2.1.0/extra/sass-mode.el +0 -98
  18. data/vendor/gems/haml-2.1.0/init.rb +0 -8
  19. data/vendor/gems/haml-2.1.0/lib/haml.rb +0 -1042
  20. data/vendor/gems/haml-2.1.0/lib/haml/buffer.rb +0 -255
  21. data/vendor/gems/haml-2.1.0/lib/haml/engine.rb +0 -268
  22. data/vendor/gems/haml-2.1.0/lib/haml/error.rb +0 -22
  23. data/vendor/gems/haml-2.1.0/lib/haml/exec.rb +0 -395
  24. data/vendor/gems/haml-2.1.0/lib/haml/filters.rb +0 -276
  25. data/vendor/gems/haml-2.1.0/lib/haml/helpers.rb +0 -468
  26. data/vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_extensions.rb +0 -45
  27. data/vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_mods.rb +0 -181
  28. data/vendor/gems/haml-2.1.0/lib/haml/html.rb +0 -218
  29. data/vendor/gems/haml-2.1.0/lib/haml/precompiler.rb +0 -889
  30. data/vendor/gems/haml-2.1.0/lib/haml/shared.rb +0 -45
  31. data/vendor/gems/haml-2.1.0/lib/haml/template.rb +0 -51
  32. data/vendor/gems/haml-2.1.0/lib/haml/template/patch.rb +0 -58
  33. data/vendor/gems/haml-2.1.0/lib/haml/template/plugin.rb +0 -72
  34. data/vendor/gems/haml-2.1.0/lib/haml/util.rb +0 -77
  35. data/vendor/gems/haml-2.1.0/lib/haml/version.rb +0 -47
  36. data/vendor/gems/haml-2.1.0/lib/sass.rb +0 -1062
  37. data/vendor/gems/haml-2.1.0/lib/sass/css.rb +0 -388
  38. data/vendor/gems/haml-2.1.0/lib/sass/engine.rb +0 -499
  39. data/vendor/gems/haml-2.1.0/lib/sass/environment.rb +0 -33
  40. data/vendor/gems/haml-2.1.0/lib/sass/error.rb +0 -35
  41. data/vendor/gems/haml-2.1.0/lib/sass/plugin.rb +0 -203
  42. data/vendor/gems/haml-2.1.0/lib/sass/plugin/merb.rb +0 -56
  43. data/vendor/gems/haml-2.1.0/lib/sass/plugin/rails.rb +0 -24
  44. data/vendor/gems/haml-2.1.0/lib/sass/repl.rb +0 -51
  45. data/vendor/gems/haml-2.1.0/lib/sass/script.rb +0 -38
  46. data/vendor/gems/haml-2.1.0/lib/sass/script/bool.rb +0 -13
  47. data/vendor/gems/haml-2.1.0/lib/sass/script/color.rb +0 -97
  48. data/vendor/gems/haml-2.1.0/lib/sass/script/funcall.rb +0 -28
  49. data/vendor/gems/haml-2.1.0/lib/sass/script/functions.rb +0 -122
  50. data/vendor/gems/haml-2.1.0/lib/sass/script/lexer.rb +0 -152
  51. data/vendor/gems/haml-2.1.0/lib/sass/script/literal.rb +0 -60
  52. data/vendor/gems/haml-2.1.0/lib/sass/script/number.rb +0 -231
  53. data/vendor/gems/haml-2.1.0/lib/sass/script/operation.rb +0 -30
  54. data/vendor/gems/haml-2.1.0/lib/sass/script/parser.rb +0 -142
  55. data/vendor/gems/haml-2.1.0/lib/sass/script/string.rb +0 -42
  56. data/vendor/gems/haml-2.1.0/lib/sass/script/unary_operation.rb +0 -21
  57. data/vendor/gems/haml-2.1.0/lib/sass/script/variable.rb +0 -20
  58. data/vendor/gems/haml-2.1.0/lib/sass/tree/attr_node.rb +0 -64
  59. data/vendor/gems/haml-2.1.0/lib/sass/tree/comment_node.rb +0 -34
  60. data/vendor/gems/haml-2.1.0/lib/sass/tree/debug_node.rb +0 -22
  61. data/vendor/gems/haml-2.1.0/lib/sass/tree/directive_node.rb +0 -50
  62. data/vendor/gems/haml-2.1.0/lib/sass/tree/file_node.rb +0 -27
  63. data/vendor/gems/haml-2.1.0/lib/sass/tree/for_node.rb +0 -29
  64. data/vendor/gems/haml-2.1.0/lib/sass/tree/if_node.rb +0 -27
  65. data/vendor/gems/haml-2.1.0/lib/sass/tree/mixin_def_node.rb +0 -18
  66. data/vendor/gems/haml-2.1.0/lib/sass/tree/mixin_node.rb +0 -34
  67. data/vendor/gems/haml-2.1.0/lib/sass/tree/node.rb +0 -99
  68. data/vendor/gems/haml-2.1.0/lib/sass/tree/rule_node.rb +0 -120
  69. data/vendor/gems/haml-2.1.0/lib/sass/tree/variable_node.rb +0 -24
  70. data/vendor/gems/haml-2.1.0/lib/sass/tree/while_node.rb +0 -20
  71. data/vendor/gems/haml-2.1.0/rails/init.rb +0 -1
  72. data/vendor/gems/haml-2.1.0/test/benchmark.rb +0 -99
  73. data/vendor/gems/haml-2.1.0/test/haml/engine_test.rb +0 -734
  74. data/vendor/gems/haml-2.1.0/test/haml/helper_test.rb +0 -224
  75. data/vendor/gems/haml-2.1.0/test/haml/html2haml_test.rb +0 -92
  76. data/vendor/gems/haml-2.1.0/test/haml/markaby/standard.mab +0 -52
  77. data/vendor/gems/haml-2.1.0/test/haml/mocks/article.rb +0 -6
  78. data/vendor/gems/haml-2.1.0/test/haml/results/content_for_layout.xhtml +0 -15
  79. data/vendor/gems/haml-2.1.0/test/haml/results/eval_suppressed.xhtml +0 -9
  80. data/vendor/gems/haml-2.1.0/test/haml/results/filters.xhtml +0 -62
  81. data/vendor/gems/haml-2.1.0/test/haml/results/helpers.xhtml +0 -93
  82. data/vendor/gems/haml-2.1.0/test/haml/results/helpful.xhtml +0 -10
  83. data/vendor/gems/haml-2.1.0/test/haml/results/just_stuff.xhtml +0 -68
  84. data/vendor/gems/haml-2.1.0/test/haml/results/list.xhtml +0 -12
  85. data/vendor/gems/haml-2.1.0/test/haml/results/nuke_inner_whitespace.xhtml +0 -40
  86. data/vendor/gems/haml-2.1.0/test/haml/results/nuke_outer_whitespace.xhtml +0 -148
  87. data/vendor/gems/haml-2.1.0/test/haml/results/original_engine.xhtml +0 -20
  88. data/vendor/gems/haml-2.1.0/test/haml/results/partial_layout.xhtml +0 -5
  89. data/vendor/gems/haml-2.1.0/test/haml/results/partials.xhtml +0 -21
  90. data/vendor/gems/haml-2.1.0/test/haml/results/render_layout.xhtml +0 -3
  91. data/vendor/gems/haml-2.1.0/test/haml/results/silent_script.xhtml +0 -74
  92. data/vendor/gems/haml-2.1.0/test/haml/results/standard.xhtml +0 -42
  93. data/vendor/gems/haml-2.1.0/test/haml/results/tag_parsing.xhtml +0 -23
  94. data/vendor/gems/haml-2.1.0/test/haml/results/very_basic.xhtml +0 -5
  95. data/vendor/gems/haml-2.1.0/test/haml/results/whitespace_handling.xhtml +0 -89
  96. data/vendor/gems/haml-2.1.0/test/haml/rhtml/_av_partial_1.rhtml +0 -12
  97. data/vendor/gems/haml-2.1.0/test/haml/rhtml/_av_partial_2.rhtml +0 -8
  98. data/vendor/gems/haml-2.1.0/test/haml/rhtml/action_view.rhtml +0 -62
  99. data/vendor/gems/haml-2.1.0/test/haml/rhtml/standard.rhtml +0 -54
  100. data/vendor/gems/haml-2.1.0/test/haml/template_test.rb +0 -204
  101. data/vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_1.haml +0 -9
  102. data/vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_1_ugly.haml +0 -9
  103. data/vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_2.haml +0 -5
  104. data/vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_2_ugly.haml +0 -5
  105. data/vendor/gems/haml-2.1.0/test/haml/templates/_layout.erb +0 -3
  106. data/vendor/gems/haml-2.1.0/test/haml/templates/_layout_for_partial.haml +0 -3
  107. data/vendor/gems/haml-2.1.0/test/haml/templates/_partial.haml +0 -8
  108. data/vendor/gems/haml-2.1.0/test/haml/templates/_text_area.haml +0 -3
  109. data/vendor/gems/haml-2.1.0/test/haml/templates/action_view.haml +0 -47
  110. data/vendor/gems/haml-2.1.0/test/haml/templates/action_view_ugly.haml +0 -47
  111. data/vendor/gems/haml-2.1.0/test/haml/templates/breakage.haml +0 -8
  112. data/vendor/gems/haml-2.1.0/test/haml/templates/content_for_layout.haml +0 -10
  113. data/vendor/gems/haml-2.1.0/test/haml/templates/eval_suppressed.haml +0 -11
  114. data/vendor/gems/haml-2.1.0/test/haml/templates/filters.haml +0 -66
  115. data/vendor/gems/haml-2.1.0/test/haml/templates/helpers.haml +0 -95
  116. data/vendor/gems/haml-2.1.0/test/haml/templates/helpful.haml +0 -11
  117. data/vendor/gems/haml-2.1.0/test/haml/templates/just_stuff.haml +0 -83
  118. data/vendor/gems/haml-2.1.0/test/haml/templates/list.haml +0 -12
  119. data/vendor/gems/haml-2.1.0/test/haml/templates/nuke_inner_whitespace.haml +0 -32
  120. data/vendor/gems/haml-2.1.0/test/haml/templates/nuke_outer_whitespace.haml +0 -144
  121. data/vendor/gems/haml-2.1.0/test/haml/templates/original_engine.haml +0 -17
  122. data/vendor/gems/haml-2.1.0/test/haml/templates/partial_layout.haml +0 -3
  123. data/vendor/gems/haml-2.1.0/test/haml/templates/partialize.haml +0 -1
  124. data/vendor/gems/haml-2.1.0/test/haml/templates/partials.haml +0 -12
  125. data/vendor/gems/haml-2.1.0/test/haml/templates/render_layout.haml +0 -2
  126. data/vendor/gems/haml-2.1.0/test/haml/templates/silent_script.haml +0 -40
  127. data/vendor/gems/haml-2.1.0/test/haml/templates/standard.haml +0 -42
  128. data/vendor/gems/haml-2.1.0/test/haml/templates/standard_ugly.haml +0 -42
  129. data/vendor/gems/haml-2.1.0/test/haml/templates/tag_parsing.haml +0 -21
  130. data/vendor/gems/haml-2.1.0/test/haml/templates/very_basic.haml +0 -4
  131. data/vendor/gems/haml-2.1.0/test/haml/templates/whitespace_handling.haml +0 -87
  132. data/vendor/gems/haml-2.1.0/test/linked_rails.rb +0 -12
  133. data/vendor/gems/haml-2.1.0/test/sass/css2sass_test.rb +0 -193
  134. data/vendor/gems/haml-2.1.0/test/sass/engine_test.rb +0 -769
  135. data/vendor/gems/haml-2.1.0/test/sass/functions_test.rb +0 -96
  136. data/vendor/gems/haml-2.1.0/test/sass/more_results/more1.css +0 -9
  137. data/vendor/gems/haml-2.1.0/test/sass/more_results/more1_with_line_comments.css +0 -26
  138. data/vendor/gems/haml-2.1.0/test/sass/more_results/more_import.css +0 -29
  139. data/vendor/gems/haml-2.1.0/test/sass/more_templates/_more_partial.sass +0 -2
  140. data/vendor/gems/haml-2.1.0/test/sass/more_templates/more1.sass +0 -23
  141. data/vendor/gems/haml-2.1.0/test/sass/more_templates/more_import.sass +0 -11
  142. data/vendor/gems/haml-2.1.0/test/sass/plugin_test.rb +0 -208
  143. data/vendor/gems/haml-2.1.0/test/sass/results/alt.css +0 -4
  144. data/vendor/gems/haml-2.1.0/test/sass/results/basic.css +0 -9
  145. data/vendor/gems/haml-2.1.0/test/sass/results/compact.css +0 -5
  146. data/vendor/gems/haml-2.1.0/test/sass/results/complex.css +0 -87
  147. data/vendor/gems/haml-2.1.0/test/sass/results/compressed.css +0 -1
  148. data/vendor/gems/haml-2.1.0/test/sass/results/expanded.css +0 -19
  149. data/vendor/gems/haml-2.1.0/test/sass/results/import.css +0 -29
  150. data/vendor/gems/haml-2.1.0/test/sass/results/line_numbers.css +0 -49
  151. data/vendor/gems/haml-2.1.0/test/sass/results/mixins.css +0 -95
  152. data/vendor/gems/haml-2.1.0/test/sass/results/multiline.css +0 -24
  153. data/vendor/gems/haml-2.1.0/test/sass/results/nested.css +0 -22
  154. data/vendor/gems/haml-2.1.0/test/sass/results/parent_ref.css +0 -13
  155. data/vendor/gems/haml-2.1.0/test/sass/results/script.css +0 -16
  156. data/vendor/gems/haml-2.1.0/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
  157. data/vendor/gems/haml-2.1.0/test/sass/results/subdir/subdir.css +0 -3
  158. data/vendor/gems/haml-2.1.0/test/sass/results/units.css +0 -11
  159. data/vendor/gems/haml-2.1.0/test/sass/script_test.rb +0 -153
  160. data/vendor/gems/haml-2.1.0/test/sass/templates/_partial.sass +0 -2
  161. data/vendor/gems/haml-2.1.0/test/sass/templates/alt.sass +0 -16
  162. data/vendor/gems/haml-2.1.0/test/sass/templates/basic.sass +0 -23
  163. data/vendor/gems/haml-2.1.0/test/sass/templates/bork.sass +0 -2
  164. data/vendor/gems/haml-2.1.0/test/sass/templates/bork2.sass +0 -2
  165. data/vendor/gems/haml-2.1.0/test/sass/templates/compact.sass +0 -17
  166. data/vendor/gems/haml-2.1.0/test/sass/templates/complex.sass +0 -309
  167. data/vendor/gems/haml-2.1.0/test/sass/templates/compressed.sass +0 -15
  168. data/vendor/gems/haml-2.1.0/test/sass/templates/expanded.sass +0 -17
  169. data/vendor/gems/haml-2.1.0/test/sass/templates/import.sass +0 -11
  170. data/vendor/gems/haml-2.1.0/test/sass/templates/importee.sass +0 -19
  171. data/vendor/gems/haml-2.1.0/test/sass/templates/line_numbers.sass +0 -13
  172. data/vendor/gems/haml-2.1.0/test/sass/templates/mixins.sass +0 -76
  173. data/vendor/gems/haml-2.1.0/test/sass/templates/multiline.sass +0 -20
  174. data/vendor/gems/haml-2.1.0/test/sass/templates/nested.sass +0 -25
  175. data/vendor/gems/haml-2.1.0/test/sass/templates/parent_ref.sass +0 -25
  176. data/vendor/gems/haml-2.1.0/test/sass/templates/script.sass +0 -101
  177. data/vendor/gems/haml-2.1.0/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
  178. data/vendor/gems/haml-2.1.0/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
  179. data/vendor/gems/haml-2.1.0/test/sass/templates/subdir/subdir.sass +0 -6
  180. data/vendor/gems/haml-2.1.0/test/sass/templates/units.sass +0 -11
  181. data/vendor/gems/haml-2.1.0/test/test_helper.rb +0 -21
@@ -1,96 +0,0 @@
1
- require 'test/unit'
2
- require File.dirname(__FILE__) + '/../../lib/sass'
3
- require 'sass/script'
4
-
5
- class SassFunctionTest < Test::Unit::TestCase
6
- def test_hsl
7
- # These tests adapted from the w3c browser tests
8
- # http://www.w3.org/Style/CSS/Test/CSS3/Color/20070927/html4/t040204-hsl-h-rotating-b.htm
9
- red = [255, 0, 0]
10
- assert_rgb_hsl(red, ['0', '100%', '50%'])
11
- assert_rgb_hsl(red, ['-360', '100%', '50%'])
12
- assert_rgb_hsl(red, ['360', '100%', '50%'])
13
- assert_rgb_hsl(red, ['6120', '100%', '50%'])
14
-
15
- yellow = [255, 255, 0]
16
- assert_rgb_hsl(yellow, ['60', '100%', '50%'])
17
- assert_rgb_hsl(yellow, ['-300', '100%', '50%'])
18
- assert_rgb_hsl(yellow, ['420', '100%', '50%'])
19
- assert_rgb_hsl(yellow, ['-9660', '100%', '50%'])
20
-
21
- green = [0, 255, 0]
22
- assert_rgb_hsl(green, ['120', '100%', '50%'])
23
- assert_rgb_hsl(green, ['-240', '100%', '50%'])
24
- assert_rgb_hsl(green, ['480', '100%', '50%'])
25
- assert_rgb_hsl(green, ['99840', '100%', '50%'])
26
-
27
- cyan = [0, 255, 255]
28
- assert_rgb_hsl(cyan, ['180', '100%', '50%'])
29
- assert_rgb_hsl(cyan, ['-180', '100%', '50%'])
30
- assert_rgb_hsl(cyan, ['540', '100%', '50%'])
31
- assert_rgb_hsl(cyan, ['-900', '100%', '50%'])
32
-
33
- blue = [0, 0, 255]
34
- assert_rgb_hsl(blue, ['240', '100%', '50%'])
35
- assert_rgb_hsl(blue, ['-120', '100%', '50%'])
36
- assert_rgb_hsl(blue, ['600', '100%', '50%'])
37
- assert_rgb_hsl(blue, ['-104880', '100%', '50%'])
38
-
39
- purple = [255, 0, 255]
40
- assert_rgb_hsl(purple, ['300', '100%', '50%'])
41
- assert_rgb_hsl(purple, ['-60', '100%', '50%'])
42
- assert_rgb_hsl(purple, ['660', '100%', '50%'])
43
- assert_rgb_hsl(purple, ['2820', '100%', '50%'])
44
- end
45
-
46
- def test_hsl_checks_bounds
47
- assert_error_message("Saturation -114 must be between 0% and 100% for `hsl'", "hsl(10, -114, 12)");
48
- assert_error_message("Lightness 256 must be between 0% and 100% for `hsl'", "hsl(10, 10, 256%)");
49
- end
50
-
51
- def test_percentage
52
- assert_equal("50%", evaluate("percentage(.5)"))
53
- assert_equal("100%", evaluate("percentage(1)"))
54
- assert_equal("25%", evaluate("percentage(25px / 100px)"))
55
- assert_error_message("25px is not a unitless number for `percentage'", "percentage(25px)")
56
- assert_error_message("#cccccc is not a unitless number for `percentage'", "percentage(#ccc)")
57
- assert_error_message("string is not a unitless number for `percentage'", %Q{percentage("string")})
58
- end
59
-
60
- def test_numeric_transformations
61
- assert_equal("5", evaluate("round(4.8)"))
62
- assert_equal("5px", evaluate("round(4.8px)"))
63
- assert_equal("5px", evaluate("round(5.49px)"))
64
- assert_equal("4", evaluate("floor(4.8)"))
65
- assert_equal("4px", evaluate("floor(4.8px)"))
66
- assert_equal("5", evaluate("ceil(4.1)"))
67
- assert_equal("5px", evaluate("ceil(4.8px)"))
68
- assert_equal("5", evaluate("abs(-5)"))
69
- assert_equal("5px", evaluate("abs(-5px)"))
70
- assert_equal("5", evaluate("abs(5)"))
71
- assert_equal("5px", evaluate("abs(5px)"))
72
- assert_error_message("#cccccc is not a number for `round'", "round(#ccc)")
73
- assert_error_message("foo is not a number for `floor'", "floor(\"foo\")")
74
- assert_error_message("a is not a number for `ceil'", "ceil(\"a\")")
75
- assert_error_message("#aaaaaa is not a number for `abs'", "abs(#aaa)")
76
- end
77
-
78
- private
79
-
80
- def assert_rgb_hsl(rgb, hsl)
81
- hsl = hsl.map {|v| Sass::Script::Parser.parse v, 0, 0 }
82
- assert_equal(rgb, Sass::Script::Functions.hsl(*hsl).value)
83
- end
84
-
85
- def evaluate(value)
86
- Sass::Script::Parser.parse(value, 0, 0).perform({}).to_s
87
- end
88
-
89
- def assert_error_message(message, value)
90
- evaluate(value)
91
- flunk("Error message expected but not raised: #{message}")
92
- rescue Sass::SyntaxError => e
93
- assert_equal(message, e.message)
94
- end
95
-
96
- end
@@ -1,9 +0,0 @@
1
- body { font: Arial; background: blue; }
2
-
3
- #page { width: 700px; height: 100; }
4
- #page #header { height: 300px; }
5
- #page #header h1 { font-size: 50px; color: blue; }
6
-
7
- #content.user.show #container.top #column.left { width: 100px; }
8
- #content.user.show #container.top #column.right { width: 600px; }
9
- #content.user.show #container.bottom { background: brown; }
@@ -1,26 +0,0 @@
1
- /* line 3, ../more_templates/more1.sass */
2
- body {
3
- font: Arial;
4
- background: blue; }
5
-
6
- /* line 7, ../more_templates/more1.sass */
7
- #page {
8
- width: 700px;
9
- height: 100; }
10
- /* line 10, ../more_templates/more1.sass */
11
- #page #header {
12
- height: 300px; }
13
- /* line 12, ../more_templates/more1.sass */
14
- #page #header h1 {
15
- font-size: 50px;
16
- color: blue; }
17
-
18
- /* line 18, ../more_templates/more1.sass */
19
- #content.user.show #container.top #column.left {
20
- width: 100px; }
21
- /* line 20, ../more_templates/more1.sass */
22
- #content.user.show #container.top #column.right {
23
- width: 600px; }
24
- /* line 22, ../more_templates/more1.sass */
25
- #content.user.show #container.bottom {
26
- background: brown; }
@@ -1,29 +0,0 @@
1
- imported { otherconst: hello; myconst: goodbye; pre-mixin: here; }
2
-
3
- body { font: Arial; background: blue; }
4
-
5
- #page { width: 700px; height: 100; }
6
- #page #header { height: 300px; }
7
- #page #header h1 { font-size: 50px; color: blue; }
8
-
9
- #content.user.show #container.top #column.left { width: 100px; }
10
- #content.user.show #container.top #column.right { width: 600px; }
11
- #content.user.show #container.bottom { background: brown; }
12
-
13
- midrule { inthe: middle; }
14
-
15
- body { font: Arial; background: blue; }
16
-
17
- #page { width: 700px; height: 100; }
18
- #page #header { height: 300px; }
19
- #page #header h1 { font-size: 50px; color: blue; }
20
-
21
- #content.user.show #container.top #column.left { width: 100px; }
22
- #content.user.show #container.top #column.right { width: 600px; }
23
- #content.user.show #container.bottom { background: brown; }
24
-
25
- @import url(basic.css);
26
- @import url(../results/complex.css);
27
- #foo { background-color: #baf; }
28
-
29
- nonimported { myconst: hello; otherconst: goodbye; post-mixin: here; }
@@ -1,2 +0,0 @@
1
- #foo
2
- :background-color #baf
@@ -1,23 +0,0 @@
1
-
2
-
3
- body
4
- :font Arial
5
- :background blue
6
-
7
- #page
8
- :width 700px
9
- :height 100
10
- #header
11
- :height 300px
12
- h1
13
- :font-size 50px
14
- :color blue
15
-
16
- #content.user.show
17
- #container.top
18
- #column.left
19
- :width 100px
20
- #column.right
21
- :width 600px
22
- #container.bottom
23
- :background brown
@@ -1,11 +0,0 @@
1
- !preconst = "hello"
2
-
3
- =premixin
4
- pre-mixin: here
5
-
6
- @import importee, basic, basic.css, ../results/complex.css, more_partial
7
-
8
- nonimported
9
- :myconst = !preconst
10
- :otherconst = !postconst
11
- +postmixin
@@ -1,208 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
- require 'sass/plugin'
4
- require 'fileutils'
5
-
6
- class SassPluginTest < Test::Unit::TestCase
7
- @@templates = %w{
8
- complex script parent_ref import alt
9
- subdir/subdir subdir/nested_subdir/nested_subdir
10
- }
11
-
12
- def setup
13
- FileUtils.mkdir tempfile_loc
14
- FileUtils.mkdir tempfile_loc(nil,"more_")
15
- set_plugin_opts
16
- Sass::Plugin.update_stylesheets
17
- end
18
-
19
- def teardown
20
- FileUtils.rm_r tempfile_loc
21
- FileUtils.rm_r tempfile_loc(nil,"more_")
22
- end
23
-
24
- def test_templates_should_render_correctly
25
- @@templates.each { |name| assert_renders_correctly(name) }
26
- end
27
-
28
- def test_no_update
29
- File.delete(tempfile_loc('basic'))
30
- assert Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
31
- Sass::Plugin.update_stylesheets
32
- assert !Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
33
- end
34
-
35
- def test_update_needed_when_modified
36
- sleep(1)
37
- FileUtils.touch(template_loc('basic'))
38
- assert Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
39
- Sass::Plugin.update_stylesheets
40
- assert !Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
41
- end
42
-
43
- def test_update_needed_when_dependency_modified
44
- sleep(1)
45
- FileUtils.touch(template_loc('basic'))
46
- assert Sass::Plugin.stylesheet_needs_update?('import', template_loc, tempfile_loc)
47
- Sass::Plugin.update_stylesheets
48
- assert !Sass::Plugin.stylesheet_needs_update?('import', template_loc, tempfile_loc)
49
- end
50
-
51
- def test_full_exception_handling
52
- File.delete(tempfile_loc('bork'))
53
- Sass::Plugin.update_stylesheets
54
- File.open(tempfile_loc('bork')) do |file|
55
- assert_equal("/*\nSass::SyntaxError: Undefined variable: \"!bork\".\non line 2 of #{template_loc('bork')}\n\n1: bork\n2: :bork= !bork", file.read.split("\n")[0...6].join("\n"))
56
- end
57
- File.delete(tempfile_loc('bork'))
58
- end
59
-
60
- def test_nonfull_exception_handling
61
- Sass::Plugin.options[:full_exception] = false
62
-
63
- File.delete(tempfile_loc('bork'))
64
- Sass::Plugin.update_stylesheets
65
- assert_equal("/* Internal stylesheet error */", File.read(tempfile_loc('bork')))
66
- File.delete(tempfile_loc('bork'))
67
-
68
- Sass::Plugin.options[:full_exception] = true
69
- end
70
-
71
- def test_two_template_directories
72
- set_plugin_opts :template_location => {
73
- template_loc => tempfile_loc,
74
- template_loc(nil,'more_') => tempfile_loc(nil,'more_')
75
- }
76
- Sass::Plugin.update_stylesheets
77
- ['more1', 'more_import'].each { |name| assert_renders_correctly(name, :prefix => 'more_') }
78
- end
79
-
80
- def test_two_template_directories_with_line_annotations
81
- set_plugin_opts :line_comments => true,
82
- :style => :nested,
83
- :template_location => {
84
- template_loc => tempfile_loc,
85
- template_loc(nil,'more_') => tempfile_loc(nil,'more_')
86
- }
87
- Sass::Plugin.update_stylesheets
88
- assert_renders_correctly('more1_with_line_comments', 'more1', :prefix => 'more_')
89
- end
90
-
91
- def test_rails_update
92
- File.delete(tempfile_loc('basic'))
93
- assert Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
94
-
95
- ActionController::Base.new.process
96
-
97
- assert !Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
98
- end
99
-
100
- def test_merb_update
101
- begin
102
- require 'merb'
103
- rescue LoadError
104
- puts "\nmerb couldn't be loaded, skipping a test"
105
- return
106
- end
107
-
108
- require 'sass/plugin/merb'
109
- if defined?(MerbHandler)
110
- MerbHandler.send(:define_method, :process_without_sass) { |*args| }
111
- else
112
- Merb::Rack::Application.send(:define_method, :call_without_sass) { |*args| }
113
- end
114
-
115
- set_plugin_opts
116
-
117
- File.delete(tempfile_loc('basic'))
118
- assert Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
119
-
120
- if defined?(MerbHandler)
121
- MerbHandler.new('.').process nil, nil
122
- else
123
- Merb::Rack::Application.new.call(::Rack::MockRequest.env_for('/'))
124
- end
125
-
126
- assert !Sass::Plugin.stylesheet_needs_update?('basic', template_loc, tempfile_loc)
127
- end
128
-
129
- def test_doesnt_render_partials
130
- assert !File.exists?(tempfile_loc('_partial'))
131
- end
132
-
133
- private
134
-
135
- def assert_renders_correctly(*arguments)
136
- options = arguments.last.is_a?(Hash) ? arguments.pop : {}
137
- prefix = options[:prefix]
138
- result_name = arguments.shift
139
- tempfile_name = arguments.shift || result_name
140
- expected_lines = File.read(result_loc(result_name, prefix)).split("\n")
141
- actual_lines = File.read(tempfile_loc(tempfile_name, prefix)).split("\n")
142
- expected_lines.zip(actual_lines).each_with_index do |pair, line|
143
- message = "template: #{result_name}\nline: #{line + 1}"
144
- assert_equal(pair.first, pair.last, message)
145
- end
146
- if expected_lines.size < actual_lines.size
147
- assert(false, "#{actual_lines.size - expected_lines.size} Trailing lines found in #{tempfile_name}.css: #{actual_lines[expected_lines.size..-1].join('\n')}")
148
- end
149
- end
150
-
151
- def template_loc(name = nil, prefix = nil)
152
- if name
153
- absolutize "#{prefix}templates/#{name}.sass"
154
- else
155
- absolutize "#{prefix}templates"
156
- end
157
- end
158
-
159
- def tempfile_loc(name = nil, prefix = nil)
160
- if name
161
- absolutize "#{prefix}tmp/#{name}.css"
162
- else
163
- absolutize "#{prefix}tmp"
164
- end
165
- end
166
-
167
- def result_loc(name = nil, prefix = nil)
168
- if name
169
- absolutize "#{prefix}results/#{name}.css"
170
- else
171
- absolutize "#{prefix}results"
172
- end
173
- end
174
-
175
- def absolutize(file)
176
- "#{File.dirname(__FILE__)}/#{file}"
177
- end
178
-
179
- def set_plugin_opts(overrides = {})
180
- Sass::Plugin.options = {
181
- :template_location => template_loc,
182
- :css_location => tempfile_loc,
183
- :style => :compact,
184
- :load_paths => [result_loc],
185
- :always_update => true,
186
- }.merge(overrides)
187
- end
188
- end
189
-
190
- module Sass::Plugin
191
- class << self
192
- public :stylesheet_needs_update?
193
- end
194
- end
195
-
196
- class Sass::Engine
197
- alias_method :old_render, :render
198
-
199
- def render
200
- raise "bork bork bork!" if @template[0] == "{bork now!}"
201
- old_render
202
- end
203
- end
204
-
205
- class ActionController::Base
206
- undef :sass_old_process
207
- def sass_old_process(*args); end
208
- end
@@ -1,4 +0,0 @@
1
- h1 { float: left; width: 274px; height: 75px; margin: 0; background-repeat: no-repeat; background-image: none; }
2
- h1 a:hover, h1 a:visited { color: green; }
3
- h1 b:hover { color: red; background-color: green; }
4
- h1 const { nosp: 3; sp: 3; }
@@ -1,9 +0,0 @@
1
- body { font: Arial; background: blue; }
2
-
3
- #page { width: 700px; height: 100; }
4
- #page #header { height: 300px; }
5
- #page #header h1 { font-size: 50px; color: blue; }
6
-
7
- #content.user.show #container.top #column.left { width: 100px; }
8
- #content.user.show #container.top #column.right { width: 600px; }
9
- #content.user.show #container.bottom { background: brown; }
@@ -1,5 +0,0 @@
1
- #main { width: 15em; color: #0000ff; }
2
- #main p { border-style: dotted; /* Nested comment More nested stuff */ border-width: 2px; }
3
- #main .cool { width: 100px; }
4
-
5
- #left { font-size: 2em; font-weight: bold; float: left; }
@@ -1,87 +0,0 @@
1
- body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: #fff; background: url(/images/global_bg.gif); }
2
-
3
- #page { width: 900px; margin: 0 auto; background: #440008; border-top-width: 5px; border-top-style: solid; border-top-color: #ff8500; }
4
-
5
- #header { height: 75px; padding: 0; }
6
- #header h1 { float: left; width: 274px; height: 75px; margin: 0; background-image: url(/images/global_logo.gif); /* Crazy nested comment */ background-repeat: no-repeat; text-indent: -9999px; }
7
- #header .status { float: right; padding-top: .5em; padding-left: .5em; padding-right: .5em; padding-bottom: 0; }
8
- #header .status p { float: left; margin-top: 0; margin-right: 0.5em; margin-bottom: 0; margin-left: 0; }
9
- #header .status ul { float: left; margin: 0; padding: 0; }
10
- #header .status li { list-style-type: none; display: inline; margin: 0 5px; }
11
- #header .status a:link, #header .status a:visited { color: #ff8500; text-decoration: none; }
12
- #header .status a:hover { text-decoration: underline; }
13
- #header .search { float: right; clear: right; margin: 12px 0 0 0; }
14
- #header .search form { margin: 0; }
15
- #header .search input { margin: 0 3px 0 0; padding: 2px; border: none; }
16
-
17
- #menu { clear: both; text-align: right; height: 20px; border-bottom: 5px solid #006b95; background: #00a4e4; }
18
- #menu .contests ul { margin: 0 5px 0 0; padding: 0; }
19
- #menu .contests ul li { list-style-type: none; margin: 0 5px; padding: 5px 5px 0 5px; display: inline; font-size: 1.1em; color: #fff; background: #00a4e4; }
20
- #menu .contests ul li / This rule isn't a comment! { red: green; }
21
- #menu .contests a:link, #menu .contests a:visited { color: #fff; text-decoration: none; font-weight: bold; }
22
- #menu .contests a:hover { text-decoration: underline; }
23
-
24
- #content { clear: both; }
25
- #content .container { clear: both; }
26
- #content .container .column { float: left; }
27
- #content .container .column .right { float: right; }
28
- #content a:link, #content a:visited { color: #93d700; text-decoration: none; }
29
- #content a:hover { text-decoration: underline; }
30
-
31
- #content p, #content div { width: 40em; }
32
- #content p li, #content p dt, #content p dd, #content div li, #content div dt, #content div dd { color: #ddffdd; background-color: #4792bb; }
33
- #content .container.video .column.left { width: 200px; }
34
- #content .container.video .column.left .box { margin-top: 10px; }
35
- #content .container.video .column.left .box p { margin: 0 1em auto 1em; }
36
- #content .container.video .column.left .box.participants img { float: left; margin: 0 1em auto 1em; border: 1px solid #6e000d; border-style: solid; }
37
- #content .container.video .column.left .box.participants h2 { margin: 0 0 10px 0; padding: 0.5em; /* The background image is a gif! */ background: #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat; /* Okay check this out Multiline comments Wow dude I mean seriously, WOW */ text-indent: -9999px; border-top-width: 5px; border-top-style: solid; border-top-color: #a20013; border-right-width: 1px; border-right-style: dotted; }
38
- #content .container.video .column.middle { width: 500px; }
39
- #content .container.video .column.right { width: 200px; }
40
- #content .container.video .column.right .box { margin-top: 0; }
41
- #content .container.video .column.right .box p { margin: 0 1em auto 1em; }
42
- #content .container.video .column p { margin-top: 0; }
43
-
44
- #content.contests .container.information .column.right .box { margin: 1em 0; }
45
- #content.contests .container.information .column.right .box.videos .thumbnail img { width: 200px; height: 150px; margin-bottom: 5px; }
46
- #content.contests .container.information .column.right .box.videos a:link, #content.contests .container.information .column.right .box.videos a:visited { color: #93d700; text-decoration: none; }
47
- #content.contests .container.information .column.right .box.videos a:hover { text-decoration: underline; }
48
- #content.contests .container.information .column.right .box.votes a { display: block; width: 200px; height: 60px; margin: 15px 0; background: url(/images/btn_votenow.gif) no-repeat; text-indent: -9999px; outline: none; border: none; }
49
- #content.contests .container.information .column.right .box.votes h2 { margin: 52px 0 10px 0; padding: 0.5em; background: #6e000d url(/images/hdr_videostats.gif) 2px 2px no-repeat; text-indent: -9999px; border-top: 5px solid #a20013; }
50
-
51
- #content.contests .container.video .box.videos h2 { margin: 0; padding: 0.5em; background: #6e000d url(/images/hdr_newestclips.gif) 2px 2px no-repeat; text-indent: -9999px; border-top: 5px solid #a20013; }
52
- #content.contests .container.video .box.videos table { width: 100; }
53
- #content.contests .container.video .box.videos table td { padding: 1em; width: 25; vertical-align: top; }
54
- #content.contests .container.video .box.videos table td p { margin: 0 0 5px 0; }
55
- #content.contests .container.video .box.videos table td a:link, #content.contests .container.video .box.videos table td a:visited { color: #93d700; text-decoration: none; }
56
- #content.contests .container.video .box.videos table td a:hover { text-decoration: underline; }
57
- #content.contests .container.video .box.videos .thumbnail { float: left; }
58
- #content.contests .container.video .box.videos .thumbnail img { width: 80px; height: 60px; margin: 0 10px 0 0; border: 1px solid #6e000d; }
59
-
60
- #content .container.comments .column { margin-top: 15px; }
61
- #content .container.comments .column.left { width: 600px; }
62
- #content .container.comments .column.left .box ol { margin: 0; padding: 0; }
63
- #content .container.comments .column.left .box li { list-style-type: none; padding: 10px; margin: 0 0 1em 0; background: #6e000d; border-top: 5px solid #a20013; }
64
- #content .container.comments .column.left .box li div { margin-bottom: 1em; }
65
- #content .container.comments .column.left .box li ul { text-align: right; }
66
- #content .container.comments .column.left .box li ul li { display: inline; border: none; padding: 0; }
67
- #content .container.comments .column.right { width: 290px; padding-left: 10px; }
68
- #content .container.comments .column.right h2 { margin: 0; padding: 0.5em; background: #6e000d url(/images/hdr_addcomment.gif) 2px 2px no-repeat; text-indent: -9999px; border-top: 5px solid #a20013; }
69
- #content .container.comments .column.right .box textarea { width: 290px; height: 100px; border: none; }
70
-
71
- #footer { margin-top: 10px; padding: 1.2em 1.5em; background: #ff8500; }
72
- #footer ul { margin: 0; padding: 0; list-style-type: none; }
73
- #footer ul li { display: inline; margin: 0 0.5em; color: #440008; }
74
- #footer ul.links { float: left; }
75
- #footer ul.links a:link, #footer ul.links a:visited { color: #440008; text-decoration: none; }
76
- #footer ul.links a:hover { text-decoration: underline; }
77
- #footer ul.copyright { float: right; }
78
-
79
- .clear { clear: both; }
80
-
81
- .centered { text-align: center; }
82
-
83
- img { border: none; }
84
-
85
- button.short { width: 60px; height: 22px; padding: 0 0 2px 0; color: #fff; border: none; background: url(/images/btn_short.gif) no-repeat; }
86
-
87
- table { border-collapse: collapse; }