oreorenasass 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +11 -0
  3. data/CONTRIBUTING +3 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +221 -0
  6. data/Rakefile +370 -0
  7. data/VERSION +1 -0
  8. data/VERSION_NAME +1 -0
  9. data/bin/sass +13 -0
  10. data/bin/sass-convert +12 -0
  11. data/bin/scss +13 -0
  12. data/extra/update_watch.rb +13 -0
  13. data/init.rb +18 -0
  14. data/lib/sass/cache_stores/base.rb +88 -0
  15. data/lib/sass/cache_stores/chain.rb +34 -0
  16. data/lib/sass/cache_stores/filesystem.rb +60 -0
  17. data/lib/sass/cache_stores/memory.rb +47 -0
  18. data/lib/sass/cache_stores/null.rb +25 -0
  19. data/lib/sass/cache_stores.rb +15 -0
  20. data/lib/sass/callbacks.rb +67 -0
  21. data/lib/sass/css.rb +407 -0
  22. data/lib/sass/engine.rb +1181 -0
  23. data/lib/sass/environment.rb +191 -0
  24. data/lib/sass/error.rb +198 -0
  25. data/lib/sass/exec/base.rb +187 -0
  26. data/lib/sass/exec/sass_convert.rb +264 -0
  27. data/lib/sass/exec/sass_scss.rb +424 -0
  28. data/lib/sass/exec.rb +9 -0
  29. data/lib/sass/features.rb +47 -0
  30. data/lib/sass/importers/base.rb +182 -0
  31. data/lib/sass/importers/filesystem.rb +211 -0
  32. data/lib/sass/importers.rb +22 -0
  33. data/lib/sass/logger/base.rb +30 -0
  34. data/lib/sass/logger/log_level.rb +45 -0
  35. data/lib/sass/logger.rb +12 -0
  36. data/lib/sass/media.rb +210 -0
  37. data/lib/sass/plugin/compiler.rb +565 -0
  38. data/lib/sass/plugin/configuration.rb +118 -0
  39. data/lib/sass/plugin/generic.rb +15 -0
  40. data/lib/sass/plugin/merb.rb +48 -0
  41. data/lib/sass/plugin/rack.rb +60 -0
  42. data/lib/sass/plugin/rails.rb +47 -0
  43. data/lib/sass/plugin/staleness_checker.rb +199 -0
  44. data/lib/sass/plugin.rb +133 -0
  45. data/lib/sass/railtie.rb +10 -0
  46. data/lib/sass/repl.rb +57 -0
  47. data/lib/sass/root.rb +7 -0
  48. data/lib/sass/script/css_lexer.rb +33 -0
  49. data/lib/sass/script/css_parser.rb +34 -0
  50. data/lib/sass/script/functions.rb +2626 -0
  51. data/lib/sass/script/lexer.rb +449 -0
  52. data/lib/sass/script/parser.rb +637 -0
  53. data/lib/sass/script/tree/funcall.rb +306 -0
  54. data/lib/sass/script/tree/interpolation.rb +118 -0
  55. data/lib/sass/script/tree/list_literal.rb +77 -0
  56. data/lib/sass/script/tree/literal.rb +45 -0
  57. data/lib/sass/script/tree/map_literal.rb +64 -0
  58. data/lib/sass/script/tree/node.rb +109 -0
  59. data/lib/sass/script/tree/operation.rb +103 -0
  60. data/lib/sass/script/tree/selector.rb +26 -0
  61. data/lib/sass/script/tree/string_interpolation.rb +104 -0
  62. data/lib/sass/script/tree/unary_operation.rb +69 -0
  63. data/lib/sass/script/tree/variable.rb +57 -0
  64. data/lib/sass/script/tree.rb +16 -0
  65. data/lib/sass/script/value/arg_list.rb +36 -0
  66. data/lib/sass/script/value/base.rb +240 -0
  67. data/lib/sass/script/value/bool.rb +35 -0
  68. data/lib/sass/script/value/color.rb +680 -0
  69. data/lib/sass/script/value/helpers.rb +262 -0
  70. data/lib/sass/script/value/list.rb +113 -0
  71. data/lib/sass/script/value/map.rb +70 -0
  72. data/lib/sass/script/value/null.rb +44 -0
  73. data/lib/sass/script/value/number.rb +530 -0
  74. data/lib/sass/script/value/string.rb +97 -0
  75. data/lib/sass/script/value.rb +11 -0
  76. data/lib/sass/script.rb +66 -0
  77. data/lib/sass/scss/css_parser.rb +42 -0
  78. data/lib/sass/scss/parser.rb +1209 -0
  79. data/lib/sass/scss/rx.rb +141 -0
  80. data/lib/sass/scss/script_lexer.rb +15 -0
  81. data/lib/sass/scss/script_parser.rb +25 -0
  82. data/lib/sass/scss/static_parser.rb +368 -0
  83. data/lib/sass/scss.rb +16 -0
  84. data/lib/sass/selector/abstract_sequence.rb +109 -0
  85. data/lib/sass/selector/comma_sequence.rb +175 -0
  86. data/lib/sass/selector/pseudo.rb +256 -0
  87. data/lib/sass/selector/sequence.rb +600 -0
  88. data/lib/sass/selector/simple.rb +117 -0
  89. data/lib/sass/selector/simple_sequence.rb +325 -0
  90. data/lib/sass/selector.rb +326 -0
  91. data/lib/sass/shared.rb +76 -0
  92. data/lib/sass/source/map.rb +210 -0
  93. data/lib/sass/source/position.rb +39 -0
  94. data/lib/sass/source/range.rb +41 -0
  95. data/lib/sass/stack.rb +120 -0
  96. data/lib/sass/supports.rb +227 -0
  97. data/lib/sass/tree/at_root_node.rb +83 -0
  98. data/lib/sass/tree/charset_node.rb +22 -0
  99. data/lib/sass/tree/comment_node.rb +82 -0
  100. data/lib/sass/tree/content_node.rb +9 -0
  101. data/lib/sass/tree/css_import_node.rb +60 -0
  102. data/lib/sass/tree/debug_node.rb +18 -0
  103. data/lib/sass/tree/directive_node.rb +59 -0
  104. data/lib/sass/tree/each_node.rb +24 -0
  105. data/lib/sass/tree/error_node.rb +18 -0
  106. data/lib/sass/tree/extend_node.rb +43 -0
  107. data/lib/sass/tree/for_node.rb +36 -0
  108. data/lib/sass/tree/function_node.rb +39 -0
  109. data/lib/sass/tree/if_node.rb +52 -0
  110. data/lib/sass/tree/import_node.rb +74 -0
  111. data/lib/sass/tree/keyframe_rule_node.rb +15 -0
  112. data/lib/sass/tree/media_node.rb +48 -0
  113. data/lib/sass/tree/mixin_def_node.rb +38 -0
  114. data/lib/sass/tree/mixin_node.rb +52 -0
  115. data/lib/sass/tree/node.rb +238 -0
  116. data/lib/sass/tree/prop_node.rb +171 -0
  117. data/lib/sass/tree/return_node.rb +19 -0
  118. data/lib/sass/tree/root_node.rb +44 -0
  119. data/lib/sass/tree/rule_node.rb +145 -0
  120. data/lib/sass/tree/supports_node.rb +38 -0
  121. data/lib/sass/tree/trace_node.rb +33 -0
  122. data/lib/sass/tree/variable_node.rb +36 -0
  123. data/lib/sass/tree/visitors/base.rb +72 -0
  124. data/lib/sass/tree/visitors/check_nesting.rb +177 -0
  125. data/lib/sass/tree/visitors/convert.rb +334 -0
  126. data/lib/sass/tree/visitors/cssize.rb +369 -0
  127. data/lib/sass/tree/visitors/deep_copy.rb +107 -0
  128. data/lib/sass/tree/visitors/extend.rb +68 -0
  129. data/lib/sass/tree/visitors/perform.rb +539 -0
  130. data/lib/sass/tree/visitors/set_options.rb +139 -0
  131. data/lib/sass/tree/visitors/to_css.rb +381 -0
  132. data/lib/sass/tree/warn_node.rb +18 -0
  133. data/lib/sass/tree/while_node.rb +18 -0
  134. data/lib/sass/util/cross_platform_random.rb +19 -0
  135. data/lib/sass/util/multibyte_string_scanner.rb +157 -0
  136. data/lib/sass/util/normalized_map.rb +130 -0
  137. data/lib/sass/util/ordered_hash.rb +192 -0
  138. data/lib/sass/util/subset_map.rb +110 -0
  139. data/lib/sass/util/test.rb +9 -0
  140. data/lib/sass/util.rb +1318 -0
  141. data/lib/sass/version.rb +124 -0
  142. data/lib/sass.rb +102 -0
  143. data/rails/init.rb +1 -0
  144. data/test/sass/cache_test.rb +131 -0
  145. data/test/sass/callbacks_test.rb +61 -0
  146. data/test/sass/compiler_test.rb +232 -0
  147. data/test/sass/conversion_test.rb +2054 -0
  148. data/test/sass/css2sass_test.rb +477 -0
  149. data/test/sass/data/hsl-rgb.txt +319 -0
  150. data/test/sass/encoding_test.rb +219 -0
  151. data/test/sass/engine_test.rb +3301 -0
  152. data/test/sass/exec_test.rb +86 -0
  153. data/test/sass/extend_test.rb +1661 -0
  154. data/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
  155. data/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
  156. data/test/sass/functions_test.rb +1926 -0
  157. data/test/sass/importer_test.rb +412 -0
  158. data/test/sass/logger_test.rb +58 -0
  159. data/test/sass/mock_importer.rb +49 -0
  160. data/test/sass/more_results/more1.css +9 -0
  161. data/test/sass/more_results/more1_with_line_comments.css +26 -0
  162. data/test/sass/more_results/more_import.css +29 -0
  163. data/test/sass/more_templates/_more_partial.sass +2 -0
  164. data/test/sass/more_templates/more1.sass +23 -0
  165. data/test/sass/more_templates/more_import.sass +11 -0
  166. data/test/sass/plugin_test.rb +554 -0
  167. data/test/sass/results/alt.css +4 -0
  168. data/test/sass/results/basic.css +9 -0
  169. data/test/sass/results/cached_import_option.css +3 -0
  170. data/test/sass/results/compact.css +5 -0
  171. data/test/sass/results/complex.css +86 -0
  172. data/test/sass/results/compressed.css +1 -0
  173. data/test/sass/results/expanded.css +19 -0
  174. data/test/sass/results/filename_fn.css +3 -0
  175. data/test/sass/results/if.css +3 -0
  176. data/test/sass/results/import.css +31 -0
  177. data/test/sass/results/import_charset.css +5 -0
  178. data/test/sass/results/import_charset_1_8.css +5 -0
  179. data/test/sass/results/import_charset_ibm866.css +5 -0
  180. data/test/sass/results/import_content.css +1 -0
  181. data/test/sass/results/line_numbers.css +49 -0
  182. data/test/sass/results/mixins.css +95 -0
  183. data/test/sass/results/multiline.css +24 -0
  184. data/test/sass/results/nested.css +22 -0
  185. data/test/sass/results/options.css +1 -0
  186. data/test/sass/results/parent_ref.css +13 -0
  187. data/test/sass/results/script.css +16 -0
  188. data/test/sass/results/scss_import.css +31 -0
  189. data/test/sass/results/scss_importee.css +2 -0
  190. data/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  191. data/test/sass/results/subdir/subdir.css +3 -0
  192. data/test/sass/results/units.css +11 -0
  193. data/test/sass/results/warn.css +0 -0
  194. data/test/sass/results/warn_imported.css +0 -0
  195. data/test/sass/script_conversion_test.rb +328 -0
  196. data/test/sass/script_test.rb +1054 -0
  197. data/test/sass/scss/css_test.rb +1215 -0
  198. data/test/sass/scss/rx_test.rb +156 -0
  199. data/test/sass/scss/scss_test.rb +3900 -0
  200. data/test/sass/scss/test_helper.rb +37 -0
  201. data/test/sass/source_map_test.rb +977 -0
  202. data/test/sass/superselector_test.rb +191 -0
  203. data/test/sass/templates/_cached_import_option_partial.scss +1 -0
  204. data/test/sass/templates/_double_import_loop2.sass +1 -0
  205. data/test/sass/templates/_filename_fn_import.scss +11 -0
  206. data/test/sass/templates/_imported_charset_ibm866.sass +4 -0
  207. data/test/sass/templates/_imported_charset_utf8.sass +4 -0
  208. data/test/sass/templates/_imported_content.sass +3 -0
  209. data/test/sass/templates/_partial.sass +2 -0
  210. data/test/sass/templates/_same_name_different_partiality.scss +1 -0
  211. data/test/sass/templates/alt.sass +16 -0
  212. data/test/sass/templates/basic.sass +23 -0
  213. data/test/sass/templates/bork1.sass +2 -0
  214. data/test/sass/templates/bork2.sass +2 -0
  215. data/test/sass/templates/bork3.sass +2 -0
  216. data/test/sass/templates/bork4.sass +2 -0
  217. data/test/sass/templates/bork5.sass +3 -0
  218. data/test/sass/templates/cached_import_option.scss +3 -0
  219. data/test/sass/templates/compact.sass +17 -0
  220. data/test/sass/templates/complex.sass +305 -0
  221. data/test/sass/templates/compressed.sass +15 -0
  222. data/test/sass/templates/double_import_loop1.sass +1 -0
  223. data/test/sass/templates/expanded.sass +17 -0
  224. data/test/sass/templates/filename_fn.scss +18 -0
  225. data/test/sass/templates/if.sass +11 -0
  226. data/test/sass/templates/import.sass +12 -0
  227. data/test/sass/templates/import_charset.sass +9 -0
  228. data/test/sass/templates/import_charset_1_8.sass +6 -0
  229. data/test/sass/templates/import_charset_ibm866.sass +11 -0
  230. data/test/sass/templates/import_content.sass +4 -0
  231. data/test/sass/templates/importee.less +2 -0
  232. data/test/sass/templates/importee.sass +19 -0
  233. data/test/sass/templates/line_numbers.sass +13 -0
  234. data/test/sass/templates/mixin_bork.sass +5 -0
  235. data/test/sass/templates/mixins.sass +76 -0
  236. data/test/sass/templates/multiline.sass +20 -0
  237. data/test/sass/templates/nested.sass +25 -0
  238. data/test/sass/templates/nested_bork1.sass +2 -0
  239. data/test/sass/templates/nested_bork2.sass +2 -0
  240. data/test/sass/templates/nested_bork3.sass +2 -0
  241. data/test/sass/templates/nested_bork4.sass +2 -0
  242. data/test/sass/templates/nested_import.sass +2 -0
  243. data/test/sass/templates/nested_mixin_bork.sass +6 -0
  244. data/test/sass/templates/options.sass +2 -0
  245. data/test/sass/templates/parent_ref.sass +25 -0
  246. data/test/sass/templates/same_name_different_ext.sass +2 -0
  247. data/test/sass/templates/same_name_different_ext.scss +1 -0
  248. data/test/sass/templates/same_name_different_partiality.scss +1 -0
  249. data/test/sass/templates/script.sass +101 -0
  250. data/test/sass/templates/scss_import.scss +12 -0
  251. data/test/sass/templates/scss_importee.scss +1 -0
  252. data/test/sass/templates/single_import_loop.sass +1 -0
  253. data/test/sass/templates/subdir/import_up1.scss +1 -0
  254. data/test/sass/templates/subdir/import_up2.scss +1 -0
  255. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
  256. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  257. data/test/sass/templates/subdir/subdir.sass +6 -0
  258. data/test/sass/templates/units.sass +11 -0
  259. data/test/sass/templates/warn.sass +3 -0
  260. data/test/sass/templates/warn_imported.sass +4 -0
  261. data/test/sass/test_helper.rb +8 -0
  262. data/test/sass/util/multibyte_string_scanner_test.rb +147 -0
  263. data/test/sass/util/normalized_map_test.rb +51 -0
  264. data/test/sass/util/subset_map_test.rb +91 -0
  265. data/test/sass/util_test.rb +467 -0
  266. data/test/sass/value_helpers_test.rb +179 -0
  267. data/test/test_helper.rb +109 -0
  268. metadata +386 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c45a2353be93853dd5bf2c241541ab2f2133dbc8
4
+ data.tar.gz: defd7035171dfaf77faf915ac96539ae66b7c49b
5
+ SHA512:
6
+ metadata.gz: e6a56e92d7f0798e19da84368eb26845e826023ca99e2a686a965794e374f1e102d6466328d7b1e1a7f29f6b7a4e049c5b3cb8fc85c5ab7c2b99111f214ab249
7
+ data.tar.gz: 7c831863fb91a39d560fe46da5c320ef8e4e8d83c9a08f38946a7c78d10f94013fe5ebf6923d76d1b3b71e6753742dd4b8f8d19de512e02be38c42282597a709
data/.yardopts ADDED
@@ -0,0 +1,11 @@
1
+ --readme README.md
2
+ --markup markdown
3
+ --markup-provider maruku
4
+ --default-return ""
5
+ --title "Sass Documentation"
6
+ --query 'object.type != :classvariable'
7
+ --query 'object.type != :constant || @api && @api.text == "public"'
8
+ --hide-void-return
9
+ --protected
10
+ --no-private
11
+ --no-highlight
data/CONTRIBUTING ADDED
@@ -0,0 +1,3 @@
1
+ Contributions are welcomed. Please see the following sites for guidelines:
2
+
3
+ http://sass-lang.com/community#Contribute
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006-2014 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,221 @@
1
+ # Sass [![Gem Version](https://badge.fury.io/rb/sass.png)](http://badge.fury.io/rb/sass)
2
+
3
+ **Sass makes CSS fun again**. Sass is an extension of CSS3,
4
+ adding nested rules, variables, mixins, selector inheritance, and more.
5
+ It's translated to well-formatted, standard CSS
6
+ using the command line tool or a web-framework plugin.
7
+
8
+ Sass has two syntaxes. The new main syntax (as of Sass 3)
9
+ is known as "SCSS" (for "Sassy CSS"),
10
+ and is a superset of CSS3's syntax.
11
+ This means that every valid CSS3 stylesheet is valid SCSS as well.
12
+ SCSS files use the extension `.scss`.
13
+
14
+ The second, older syntax is known as the indented syntax (or just "Sass").
15
+ Inspired by Haml's terseness, it's intended for people
16
+ who prefer conciseness over similarity to CSS.
17
+ Instead of brackets and semicolons,
18
+ it uses the indentation of lines to specify blocks.
19
+ Although no longer the primary syntax,
20
+ the indented syntax will continue to be supported.
21
+ Files in the indented syntax use the extension `.sass`.
22
+
23
+ ## Using
24
+
25
+ Sass can be used from the command line
26
+ or as part of a web framework.
27
+ The first step is to install the gem:
28
+
29
+ gem install sass
30
+
31
+ After you convert some CSS to Sass, you can run
32
+
33
+ sass style.scss
34
+
35
+ to compile it back to CSS.
36
+ For more information on these commands, check out
37
+
38
+ sass --help
39
+
40
+ To install Sass in Rails 2,
41
+ just add `config.gem "sass"` to `config/environment.rb`.
42
+ In Rails 3, add `gem "sass"` to your Gemfile instead.
43
+ `.sass` or `.scss` files should be placed in `public/stylesheets/sass`,
44
+ where they'll be automatically compiled
45
+ to corresponding CSS files in `public/stylesheets` when needed
46
+ (the Sass template directory is customizable...
47
+ see [the Sass reference](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
48
+
49
+ Sass can also be used with any Rack-enabled web framework.
50
+ To do so, just add
51
+
52
+ ```ruby
53
+ require 'sass/plugin/rack'
54
+ use Sass::Plugin::Rack
55
+ ```
56
+
57
+ to `config.ru`.
58
+ Then any Sass files in `public/stylesheets/sass`
59
+ will be compiled into CSS files in `public/stylesheets` on every request.
60
+
61
+ To use Sass programmatically,
62
+ check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
63
+
64
+ ## Formatting
65
+
66
+ Sass is an extension of CSS
67
+ that adds power and elegance to the basic language.
68
+ It allows you to use [variables][vars], [nested rules][nested],
69
+ [mixins][mixins], [inline imports][imports],
70
+ and more, all with a fully CSS-compatible syntax.
71
+ Sass helps keep large stylesheets well-organized,
72
+ and get small stylesheets up and running quickly,
73
+ particularly with the help of
74
+ [the Compass style library](http://compass-style.org).
75
+
76
+ [vars]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
77
+ [nested]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
78
+ [mixins]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
79
+ [imports]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
80
+
81
+ Sass has two syntaxes.
82
+ The one presented here, known as "SCSS" (for "Sassy CSS"),
83
+ is fully CSS-compatible.
84
+ The other (older) syntax, known as the indented syntax or just "Sass",
85
+ is whitespace-sensitive and indentation-based.
86
+ For more information, see the [reference documentation][syntax].
87
+
88
+ [syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
89
+
90
+ To run the following examples and see the CSS they produce,
91
+ put them in a file called `test.scss` and run `sass test.scss`.
92
+
93
+ ### Nesting
94
+
95
+ Sass avoids repetition by nesting selectors within one another.
96
+ The same thing works for properties.
97
+
98
+ ```scss
99
+ table.hl {
100
+ margin: 2em 0;
101
+ td.ln { text-align: right; }
102
+ }
103
+
104
+ li {
105
+ font: {
106
+ family: serif;
107
+ weight: bold;
108
+ size: 1.2em;
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Variables
114
+
115
+ Use the same color all over the place?
116
+ Need to do some math with height and width and text size?
117
+ Sass supports variables, math operations, and many useful functions.
118
+
119
+ ```scss
120
+ $blue: #3bbfce;
121
+ $margin: 16px;
122
+
123
+ .content_navigation {
124
+ border-color: $blue;
125
+ color: darken($blue, 10%);
126
+ }
127
+
128
+ .border {
129
+ padding: $margin / 2;
130
+ margin: $margin / 2;
131
+ border-color: $blue;
132
+ }
133
+ ```
134
+
135
+ ### Mixins
136
+
137
+ Even more powerful than variables,
138
+ mixins allow you to re-use whole chunks of CSS,
139
+ properties or selectors.
140
+ You can even give them arguments.
141
+
142
+ ```scss
143
+ @mixin table-scaffolding {
144
+ th {
145
+ text-align: center;
146
+ font-weight: bold;
147
+ }
148
+ td, th { padding: 2px; }
149
+ }
150
+
151
+ @mixin left($dist) {
152
+ float: left;
153
+ margin-left: $dist;
154
+ }
155
+
156
+ #data {
157
+ @include left(10px);
158
+ @include table-scaffolding;
159
+ }
160
+ ```
161
+
162
+ A comprehensive list of features is available
163
+ in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
164
+
165
+ ## Executables
166
+
167
+ The Sass gem includes several executables that are useful
168
+ for dealing with Sass from the command line.
169
+
170
+ ### `sass`
171
+
172
+ The `sass` executable transforms a source Sass file into CSS.
173
+ See `sass --help` for further information and options.
174
+
175
+ ### `sass-convert`
176
+
177
+ The `sass-convert` executable converts between CSS, Sass, and SCSS.
178
+ When converting from CSS to Sass or SCSS,
179
+ nesting is applied where appropriate.
180
+ See `sass-convert --help` for further information and options.
181
+
182
+ ### Running locally
183
+
184
+ To run the Sass executables from a source checkout instead of from rubygems:
185
+
186
+ ```
187
+ $ cd <SASS_CHECKOUT_DIRECTORY>
188
+ $ bundle
189
+ $ bundle exec sass ...
190
+ $ bundle exec scss ...
191
+ $ bundle exec sass-convert ...
192
+ ```
193
+
194
+ ## Authors
195
+
196
+ Sass was envisioned by [Hampton Catlin](http://www.hamptoncatlin.com)
197
+ (@hcatlin). However, Hampton doesn't even know his way around the code anymore
198
+ and now occasionally consults on the language issues. Hampton lives in San
199
+ Francisco, California and works as VP of Technology
200
+ at [Moovweb](http://www.moovweb.com/).
201
+
202
+ [Natalie Weizenbaum](http://nex-3.com) is the primary developer and architect of
203
+ Sass. Her hard work has kept the project alive by endlessly answering forum
204
+ posts, fixing bugs, refactoring, finding speed improvements, writing
205
+ documentation, implementing new features, and getting Hampton coffee (a fitting
206
+ task for a girl genius). Natalie lives in Seattle, Washington and works on
207
+ [Dart](http://dartlang.org) application libraries at Google.
208
+
209
+ [Chris Eppstein](http://acts-as-architect.blogspot.com) is a core contributor to
210
+ Sass and the creator of Compass, the first Sass-based framework. Chris focuses
211
+ on making Sass more powerful, easy to use, and on ways to speed its adoption
212
+ through the web development community. Chris lives in San Jose, California with
213
+ his wife and daughter. He is an Engineer for
214
+ [LinkedIn.com](http://linkedin.com), where one of his responsibilities is to
215
+ maintain Sass & Compass.
216
+
217
+ If you use this software, you must pay Hampton a compliment. And buy Natalie
218
+ some candy. Maybe pet a kitten. Yeah. Pet that kitty.
219
+
220
+ Beyond that, the implementation is licensed under the MIT License.
221
+ Okay, fine, I guess that means compliments aren't __required__.
data/Rakefile ADDED
@@ -0,0 +1,370 @@
1
+ require 'rubygems/package'
2
+
3
+ # ----- Utility Functions -----
4
+
5
+ def scope(path)
6
+ File.join(File.dirname(__FILE__), path)
7
+ end
8
+
9
+ # ----- Default: Testing ------
10
+
11
+ task :default => :test
12
+
13
+ require 'rake/testtask'
14
+
15
+ Rake::TestTask.new do |t|
16
+ t.libs << 'test'
17
+ test_files = FileList[scope('test/**/*_test.rb')]
18
+ test_files.exclude(scope('test/rails/*'))
19
+ test_files.exclude(scope('test/plugins/*'))
20
+ t.test_files = test_files
21
+ t.verbose = true
22
+ end
23
+
24
+ # ----- Code Style Enforcement -----
25
+
26
+ if RUBY_VERSION !~ /^(1\.8)/ && (ENV.has_key?("RUBOCOP") && ENV["RUBOCOP"] == "true" || !(ENV.has_key?("RUBOCOP") || ENV.has_key?("TEST")))
27
+ require 'rubocop/rake_task'
28
+ Rubocop::RakeTask.new do |t|
29
+ t.patterns = FileList["lib/**/*"]
30
+ end
31
+ else
32
+ task :rubocop do
33
+ puts "Skipping rubocop style check."
34
+ if !ENV.has_key?("RUBOCOP")
35
+ puts "Passing this check is required in order for your patch to be accepted."
36
+ puts "Use ruby 1.9 or greater and then run the style check with: rake rubocop"
37
+ end
38
+ end
39
+ end
40
+
41
+ task :test => :rubocop
42
+
43
+ # ----- Packaging -----
44
+
45
+ # Don't use Rake::GemPackageTast because we want prerequisites to run
46
+ # before we load the gemspec.
47
+ desc "Build all the packages."
48
+ task :package => [:revision_file, :date_file, :submodules, :permissions] do
49
+ version = get_version
50
+ File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
51
+ load scope('sass.gemspec')
52
+ Gem::Package.build(SASS_GEMSPEC)
53
+ sh %{git checkout VERSION}
54
+
55
+ pkg = "#{SASS_GEMSPEC.name}-#{SASS_GEMSPEC.version}"
56
+ mkdir_p "pkg"
57
+ verbose(true) {mv "#{pkg}.gem", "pkg/#{pkg}.gem"}
58
+
59
+ sh %{rm -f pkg/#{pkg}.tar.gz}
60
+ verbose(false) {SASS_GEMSPEC.files.each {|f| sh %{tar rf pkg/#{pkg}.tar #{f}}}}
61
+ sh %{gzip pkg/#{pkg}.tar}
62
+ end
63
+
64
+ task :permissions do
65
+ sh %{chmod -R a+rx bin}
66
+ sh %{chmod -R a+r .}
67
+ require 'shellwords'
68
+ Dir.glob('test/**/*_test.rb') do |file|
69
+ next if file =~ %r{^test/haml/spec/}
70
+ sh %{chmod a+rx #{file}}
71
+ end
72
+ end
73
+
74
+ task :revision_file do
75
+ require scope('lib/sass')
76
+
77
+ release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
78
+ if Sass.version[:rev] && !release
79
+ File.open(scope('REVISION'), 'w') { |f| f.puts Sass.version[:rev] }
80
+ elsif release
81
+ File.open(scope('REVISION'), 'w') { |f| f.puts "(release)" }
82
+ else
83
+ File.open(scope('REVISION'), 'w') { |f| f.puts "(unknown)" }
84
+ end
85
+ end
86
+
87
+ task :date_file do
88
+ File.open(scope('VERSION_DATE'), 'w') do |f|
89
+ f.puts Time.now.utc.strftime('%d %B %Y %T %Z')
90
+ end
91
+ end
92
+
93
+ # We also need to get rid of this file after packaging.
94
+ at_exit do
95
+ File.delete(scope('REVISION')) rescue nil
96
+ File.delete(scope('VERSION_DATE')) rescue nil
97
+ end
98
+
99
+ desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
100
+ task :install => [:package] do
101
+ gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
102
+ sh %{#{'sudo ' if ENV["SUDO"]}#{gem} install --no-ri pkg/sass-#{get_version}}
103
+ end
104
+
105
+ desc "Release a new Sass package to RubyGems.org."
106
+ task :release => [:check_release, :package] do
107
+ name = File.read(scope("VERSION_NAME")).strip
108
+ version = File.read(scope("VERSION")).strip
109
+ sh %{gem push pkg/sass-#{version}.gem}
110
+ end
111
+
112
+ # Ensures that the VERSION file has been updated for a new release.
113
+ task :check_release do
114
+ version = File.read(scope("VERSION")).strip
115
+ raise "There have been changes since current version (#{version})" if changed_since?(version)
116
+ raise "VERSION_NAME must not be 'Bleeding Edge'" if File.read(scope("VERSION_NAME")) == "Bleeding Edge"
117
+ end
118
+
119
+ # Reads a password from the command line.
120
+ #
121
+ # @param name [String] The prompt to use to read the password
122
+ def read_password(prompt)
123
+ require 'readline'
124
+ system "stty -echo"
125
+ Readline.readline("#{prompt}: ").strip
126
+ ensure
127
+ system "stty echo"
128
+ puts
129
+ end
130
+
131
+ # Returns whether or not the repository, or specific files,
132
+ # has/have changed since a given revision.
133
+ #
134
+ # @param rev [String] The revision to check against
135
+ # @param files [Array<String>] The files to check.
136
+ # If this is empty, checks the entire repository
137
+ def changed_since?(rev, *files)
138
+ IO.popen("git diff --exit-code #{rev} #{files.join(' ')}") {}
139
+ return !$?.success?
140
+ end
141
+
142
+ task :submodules do
143
+ if File.exist?(File.dirname(__FILE__) + "/.git")
144
+ sh %{git submodule sync}
145
+ sh %{git submodule update --init}
146
+ elsif !File.exist?(File.dirname(__FILE__) + "/vendor/listen/lib")
147
+ warn <<WARN
148
+ WARNING: vendor/listen doesn't exist, and this isn't a git repository so
149
+ I can't get it automatically!
150
+ WARN
151
+ end
152
+ end
153
+
154
+ task :release_edge do
155
+ ensure_git_cleanup do
156
+ puts "#{'=' * 50} Running rake release_edge"
157
+
158
+ sh %{git checkout master}
159
+ sh %{git reset --hard origin/master}
160
+ sh %{rake package}
161
+ version = get_version
162
+ if version.include?('.rc.')
163
+ puts "#{'=' * 20} Not releasing edge gem for RC version"
164
+ next
165
+ end
166
+
167
+ sh %{gem push pkg/sass-#{version}.gem}
168
+ end
169
+ end
170
+
171
+ # Get the version string. If this is being installed from Git,
172
+ # this includes the proper prerelease version.
173
+ def get_version
174
+ written_version = File.read(scope('VERSION').strip)
175
+ return written_version unless File.exist?(scope('.git'))
176
+
177
+ # Get the current master branch version
178
+ version = written_version.split('.')
179
+ version.map! {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
180
+ return written_version unless version.size == 5 && version[3] == "alpha" # prerelease
181
+
182
+ return written_version if (commit_count = `git log --pretty=oneline HEAD ^stable | wc -l`).empty?
183
+ version[4] = commit_count.strip
184
+ version.join('.')
185
+ end
186
+
187
+ task :watch_for_update do
188
+ sh %{ruby extra/update_watch.rb}
189
+ end
190
+
191
+ # ----- Documentation -----
192
+
193
+ task :rdoc do
194
+ puts '=' * 100, <<END, '=' * 100
195
+ Sass uses the YARD documentation system (http://github.com/lsegal/yard).
196
+ Install the yard gem and then run "rake doc".
197
+ END
198
+ end
199
+
200
+ begin
201
+ require 'yard'
202
+
203
+ namespace :doc do
204
+ task :sass do
205
+ require scope('lib/sass')
206
+ Dir[scope("yard/default/**/*.sass")].each do |sass|
207
+ File.open(sass.gsub(/sass$/, 'css'), 'w') do |f|
208
+ f.write(Sass::Engine.new(File.read(sass)).render)
209
+ end
210
+ end
211
+ end
212
+
213
+ desc "List all undocumented methods and classes."
214
+ task :undocumented do
215
+ opts = ENV["YARD_OPTS"] || ""
216
+ ENV["YARD_OPTS"] = opts.dup + <<OPTS
217
+ --list --tag comment --hide-tag comment --query "
218
+ object.docstring.blank? &&
219
+ !(object.type == :method && object.is_alias?)"
220
+ OPTS
221
+ Rake::Task['yard'].execute
222
+ end
223
+ end
224
+
225
+ YARD::Rake::YardocTask.new do |t|
226
+ t.files = FileList.new(scope('lib/**/*.rb')) do |list|
227
+ list.exclude('lib/sass/plugin/merb.rb')
228
+ list.exclude('lib/sass/plugin/rails.rb')
229
+ end.to_a
230
+ t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
231
+ t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
232
+ files = FileList.new(scope('doc-src/*')).to_a.sort_by {|s| s.size} + %w[MIT-LICENSE VERSION]
233
+ t.options << '--files' << files.join(',')
234
+ t.options << '--template-path' << scope('yard')
235
+ t.options << '--title' << ENV["YARD_TITLE"] if ENV["YARD_TITLE"]
236
+
237
+ t.before = lambda do
238
+ if ENV["YARD_OPTS"]
239
+ require 'shellwords'
240
+ t.options.concat(Shellwords.shellwords(ENV["YARD_OPTS"]))
241
+ end
242
+ end
243
+ end
244
+ Rake::Task['yard'].prerequisites.insert(0, 'doc:sass')
245
+ Rake::Task['yard'].instance_variable_set('@comment', nil)
246
+
247
+ desc "Generate Documentation"
248
+ task :doc => :yard
249
+ task :redoc => :yard
250
+ rescue LoadError
251
+ desc "Generate Documentation"
252
+ task :doc => :rdoc
253
+ task :yard => :rdoc
254
+ end
255
+
256
+ task :pages do
257
+ ensure_git_cleanup do
258
+ puts "#{'=' * 50} Running rake pages"
259
+ sh %{git checkout sass-pages}
260
+ sh %{git reset --hard origin/sass-pages}
261
+
262
+ Dir.chdir("/var/www/sass-pages") do
263
+ sh %{git fetch origin}
264
+
265
+ sh %{git checkout stable}
266
+ sh %{git reset --hard origin/stable}
267
+
268
+ sh %{git checkout sass-pages}
269
+ sh %{git reset --hard origin/sass-pages}
270
+ sh %{rake build --trace}
271
+ sh %{mkdir -p tmp}
272
+ sh %{touch tmp/restart.txt}
273
+ end
274
+ end
275
+ end
276
+
277
+ # ----- Coverage -----
278
+
279
+ begin
280
+ require 'rcov/rcovtask'
281
+
282
+ Rcov::RcovTask.new do |t|
283
+ t.test_files = FileList[scope('test/**/*_test.rb')]
284
+ t.rcov_opts << '-x' << '"^\/"'
285
+ if ENV['NON_NATIVE']
286
+ t.rcov_opts << "--no-rcovrt"
287
+ end
288
+ t.verbose = true
289
+ end
290
+ rescue LoadError; end
291
+
292
+ # ----- Profiling -----
293
+
294
+ begin
295
+ require 'ruby-prof'
296
+
297
+ desc <<END
298
+ Run a profile of sass.
299
+ TIMES=n sets the number of runs. Defaults to 1000.
300
+ FILE=str sets the file to profile. Defaults to 'complex'.
301
+ OUTPUT=str sets the ruby-prof output format.
302
+ Can be Flat, CallInfo, or Graph. Defaults to Flat. Defaults to Flat.
303
+ END
304
+ task :profile do
305
+ times = (ENV['TIMES'] || '1000').to_i
306
+ file = ENV['FILE']
307
+
308
+ require 'lib/sass'
309
+
310
+ file = File.read(scope("test/sass/templates/#{file || 'complex'}.sass"))
311
+ result = RubyProf.profile { times.times { Sass::Engine.new(file).render } }
312
+
313
+ RubyProf.const_get("#{(ENV['OUTPUT'] || 'Flat').capitalize}Printer").new(result).print
314
+ end
315
+ rescue LoadError; end
316
+
317
+ # ----- Handling Updates -----
318
+
319
+ def email_on_error
320
+ yield
321
+ rescue Exception => e
322
+ IO.popen("sendmail nex342@gmail.com", "w") do |sm|
323
+ sm << "From: nex3@nex-3.com\n" <<
324
+ "To: nex342@gmail.com\n" <<
325
+ "Subject: Exception when running rake #{Rake.application.top_level_tasks.join(', ')}\n" <<
326
+ e.message << "\n\n" <<
327
+ e.backtrace.join("\n")
328
+ end
329
+ ensure
330
+ raise e if e
331
+ end
332
+
333
+ def ensure_git_cleanup
334
+ email_on_error {yield}
335
+ ensure
336
+ sh %{git reset --hard HEAD}
337
+ sh %{git clean -xdf}
338
+ sh %{git checkout master}
339
+ end
340
+
341
+ task :handle_update do
342
+ email_on_error do
343
+ unless ENV["REF"] =~ %r{^refs/heads/(master|stable|sass-pages)$}
344
+ puts "#{'=' * 20} Ignoring rake handle_update REF=#{ENV["REF"].inspect}"
345
+ next
346
+ end
347
+ branch = $1
348
+
349
+ puts
350
+ puts
351
+ puts '=' * 150
352
+ puts "Running rake handle_update REF=#{ENV["REF"].inspect}"
353
+
354
+ sh %{git fetch origin}
355
+ sh %{git checkout stable}
356
+ sh %{git reset --hard origin/stable}
357
+ sh %{git checkout master}
358
+ sh %{git reset --hard origin/master}
359
+
360
+ case branch
361
+ when "master"
362
+ sh %{rake release_edge --trace}
363
+ when "stable", "sass-pages"
364
+ sh %{rake pages --trace}
365
+ end
366
+
367
+ puts 'Done running handle_update'
368
+ puts '=' * 150
369
+ end
370
+ end