sass 3.1.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING +1 -1
  3. data/MIT-LICENSE +2 -2
  4. data/README.md +29 -17
  5. data/Rakefile +43 -9
  6. data/VERSION +1 -1
  7. data/VERSION_DATE +1 -0
  8. data/VERSION_NAME +1 -1
  9. data/bin/sass +6 -1
  10. data/bin/sass-convert +6 -1
  11. data/bin/scss +6 -1
  12. data/ext/mkrf_conf.rb +27 -0
  13. data/lib/sass/cache_stores/base.rb +7 -3
  14. data/lib/sass/cache_stores/chain.rb +3 -2
  15. data/lib/sass/cache_stores/filesystem.rb +5 -7
  16. data/lib/sass/cache_stores/memory.rb +1 -1
  17. data/lib/sass/cache_stores/null.rb +2 -2
  18. data/lib/sass/callbacks.rb +2 -1
  19. data/lib/sass/css.rb +168 -53
  20. data/lib/sass/engine.rb +502 -174
  21. data/lib/sass/environment.rb +151 -111
  22. data/lib/sass/error.rb +7 -7
  23. data/lib/sass/exec.rb +176 -60
  24. data/lib/sass/features.rb +40 -0
  25. data/lib/sass/importers/base.rb +46 -7
  26. data/lib/sass/importers/deprecated_path.rb +51 -0
  27. data/lib/sass/importers/filesystem.rb +113 -30
  28. data/lib/sass/importers.rb +1 -0
  29. data/lib/sass/logger/base.rb +30 -0
  30. data/lib/sass/logger/log_level.rb +45 -0
  31. data/lib/sass/logger.rb +12 -0
  32. data/lib/sass/media.rb +213 -0
  33. data/lib/sass/plugin/compiler.rb +194 -104
  34. data/lib/sass/plugin/configuration.rb +18 -25
  35. data/lib/sass/plugin/merb.rb +1 -1
  36. data/lib/sass/plugin/staleness_checker.rb +37 -11
  37. data/lib/sass/plugin.rb +10 -13
  38. data/lib/sass/railtie.rb +2 -1
  39. data/lib/sass/repl.rb +5 -6
  40. data/lib/sass/script/css_lexer.rb +8 -4
  41. data/lib/sass/script/css_parser.rb +5 -2
  42. data/lib/sass/script/functions.rb +1547 -618
  43. data/lib/sass/script/lexer.rb +122 -72
  44. data/lib/sass/script/parser.rb +304 -135
  45. data/lib/sass/script/tree/funcall.rb +306 -0
  46. data/lib/sass/script/{interpolation.rb → tree/interpolation.rb} +43 -13
  47. data/lib/sass/script/tree/list_literal.rb +77 -0
  48. data/lib/sass/script/tree/literal.rb +45 -0
  49. data/lib/sass/script/tree/map_literal.rb +64 -0
  50. data/lib/sass/script/{node.rb → tree/node.rb} +30 -12
  51. data/lib/sass/script/{operation.rb → tree/operation.rb} +33 -21
  52. data/lib/sass/script/{string_interpolation.rb → tree/string_interpolation.rb} +14 -4
  53. data/lib/sass/script/{unary_operation.rb → tree/unary_operation.rb} +21 -9
  54. data/lib/sass/script/tree/variable.rb +57 -0
  55. data/lib/sass/script/tree.rb +15 -0
  56. data/lib/sass/script/value/arg_list.rb +36 -0
  57. data/lib/sass/script/value/base.rb +238 -0
  58. data/lib/sass/script/value/bool.rb +40 -0
  59. data/lib/sass/script/{color.rb → value/color.rb} +256 -74
  60. data/lib/sass/script/value/deprecated_false.rb +55 -0
  61. data/lib/sass/script/value/helpers.rb +155 -0
  62. data/lib/sass/script/value/list.rb +128 -0
  63. data/lib/sass/script/value/map.rb +70 -0
  64. data/lib/sass/script/value/null.rb +49 -0
  65. data/lib/sass/script/{number.rb → value/number.rb} +115 -62
  66. data/lib/sass/script/{string.rb → value/string.rb} +9 -11
  67. data/lib/sass/script/value.rb +12 -0
  68. data/lib/sass/script.rb +35 -9
  69. data/lib/sass/scss/css_parser.rb +2 -12
  70. data/lib/sass/scss/parser.rb +657 -230
  71. data/lib/sass/scss/rx.rb +17 -12
  72. data/lib/sass/scss/static_parser.rb +37 -6
  73. data/lib/sass/scss.rb +0 -1
  74. data/lib/sass/selector/abstract_sequence.rb +35 -3
  75. data/lib/sass/selector/comma_sequence.rb +29 -14
  76. data/lib/sass/selector/sequence.rb +371 -74
  77. data/lib/sass/selector/simple.rb +28 -13
  78. data/lib/sass/selector/simple_sequence.rb +163 -36
  79. data/lib/sass/selector.rb +138 -36
  80. data/lib/sass/shared.rb +3 -5
  81. data/lib/sass/source/map.rb +196 -0
  82. data/lib/sass/source/position.rb +39 -0
  83. data/lib/sass/source/range.rb +41 -0
  84. data/lib/sass/stack.rb +126 -0
  85. data/lib/sass/supports.rb +228 -0
  86. data/lib/sass/tree/at_root_node.rb +82 -0
  87. data/lib/sass/tree/comment_node.rb +34 -29
  88. data/lib/sass/tree/content_node.rb +9 -0
  89. data/lib/sass/tree/css_import_node.rb +60 -0
  90. data/lib/sass/tree/debug_node.rb +3 -3
  91. data/lib/sass/tree/directive_node.rb +33 -3
  92. data/lib/sass/tree/each_node.rb +9 -9
  93. data/lib/sass/tree/extend_node.rb +20 -6
  94. data/lib/sass/tree/for_node.rb +6 -6
  95. data/lib/sass/tree/function_node.rb +12 -4
  96. data/lib/sass/tree/if_node.rb +2 -15
  97. data/lib/sass/tree/import_node.rb +11 -5
  98. data/lib/sass/tree/media_node.rb +27 -11
  99. data/lib/sass/tree/mixin_def_node.rb +15 -4
  100. data/lib/sass/tree/mixin_node.rb +27 -7
  101. data/lib/sass/tree/node.rb +69 -35
  102. data/lib/sass/tree/prop_node.rb +47 -31
  103. data/lib/sass/tree/return_node.rb +4 -3
  104. data/lib/sass/tree/root_node.rb +20 -4
  105. data/lib/sass/tree/rule_node.rb +37 -26
  106. data/lib/sass/tree/supports_node.rb +38 -0
  107. data/lib/sass/tree/trace_node.rb +33 -0
  108. data/lib/sass/tree/variable_node.rb +10 -4
  109. data/lib/sass/tree/visitors/base.rb +5 -8
  110. data/lib/sass/tree/visitors/check_nesting.rb +67 -52
  111. data/lib/sass/tree/visitors/convert.rb +134 -53
  112. data/lib/sass/tree/visitors/cssize.rb +245 -51
  113. data/lib/sass/tree/visitors/deep_copy.rb +102 -0
  114. data/lib/sass/tree/visitors/extend.rb +68 -0
  115. data/lib/sass/tree/visitors/perform.rb +331 -105
  116. data/lib/sass/tree/visitors/set_options.rb +125 -0
  117. data/lib/sass/tree/visitors/to_css.rb +259 -95
  118. data/lib/sass/tree/warn_node.rb +3 -3
  119. data/lib/sass/tree/while_node.rb +3 -3
  120. data/lib/sass/util/cross_platform_random.rb +19 -0
  121. data/lib/sass/util/multibyte_string_scanner.rb +157 -0
  122. data/lib/sass/util/normalized_map.rb +130 -0
  123. data/lib/sass/util/ordered_hash.rb +192 -0
  124. data/lib/sass/util/subset_map.rb +11 -2
  125. data/lib/sass/util/test.rb +9 -0
  126. data/lib/sass/util.rb +565 -39
  127. data/lib/sass/version.rb +27 -15
  128. data/lib/sass.rb +39 -4
  129. data/test/sass/cache_test.rb +15 -0
  130. data/test/sass/compiler_test.rb +223 -0
  131. data/test/sass/conversion_test.rb +901 -107
  132. data/test/sass/css2sass_test.rb +94 -0
  133. data/test/sass/engine_test.rb +1059 -164
  134. data/test/sass/exec_test.rb +86 -0
  135. data/test/sass/extend_test.rb +933 -837
  136. data/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
  137. data/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
  138. data/test/sass/functions_test.rb +995 -136
  139. data/test/sass/importer_test.rb +338 -18
  140. data/test/sass/logger_test.rb +58 -0
  141. data/test/sass/more_results/more_import.css +2 -2
  142. data/test/sass/plugin_test.rb +114 -30
  143. data/test/sass/results/cached_import_option.css +3 -0
  144. data/test/sass/results/filename_fn.css +3 -0
  145. data/test/sass/results/import.css +2 -2
  146. data/test/sass/results/import_charset.css +1 -0
  147. data/test/sass/results/import_charset_1_8.css +1 -0
  148. data/test/sass/results/import_charset_ibm866.css +1 -0
  149. data/test/sass/results/import_content.css +1 -0
  150. data/test/sass/results/script.css +1 -1
  151. data/test/sass/results/scss_import.css +2 -2
  152. data/test/sass/results/units.css +2 -2
  153. data/test/sass/script_conversion_test.rb +43 -1
  154. data/test/sass/script_test.rb +380 -36
  155. data/test/sass/scss/css_test.rb +257 -75
  156. data/test/sass/scss/scss_test.rb +2322 -110
  157. data/test/sass/source_map_test.rb +887 -0
  158. data/test/sass/templates/_cached_import_option_partial.scss +1 -0
  159. data/test/sass/templates/_double_import_loop2.sass +1 -0
  160. data/test/sass/templates/_filename_fn_import.scss +11 -0
  161. data/test/sass/templates/_imported_content.sass +3 -0
  162. data/test/sass/templates/_same_name_different_partiality.scss +1 -0
  163. data/test/sass/templates/bork5.sass +3 -0
  164. data/test/sass/templates/cached_import_option.scss +3 -0
  165. data/test/sass/templates/double_import_loop1.sass +1 -0
  166. data/test/sass/templates/filename_fn.scss +18 -0
  167. data/test/sass/templates/import_charset.sass +2 -0
  168. data/test/sass/templates/import_charset_1_8.sass +2 -0
  169. data/test/sass/templates/import_charset_ibm866.sass +2 -0
  170. data/test/sass/templates/import_content.sass +4 -0
  171. data/test/sass/templates/same_name_different_ext.sass +2 -0
  172. data/test/sass/templates/same_name_different_ext.scss +1 -0
  173. data/test/sass/templates/same_name_different_partiality.scss +1 -0
  174. data/test/sass/templates/single_import_loop.sass +1 -0
  175. data/test/sass/templates/subdir/import_up1.scss +1 -0
  176. data/test/sass/templates/subdir/import_up2.scss +1 -0
  177. data/test/sass/test_helper.rb +1 -1
  178. data/test/sass/util/multibyte_string_scanner_test.rb +147 -0
  179. data/test/sass/util/normalized_map_test.rb +51 -0
  180. data/test/sass/util_test.rb +183 -0
  181. data/test/sass/value_helpers_test.rb +181 -0
  182. data/test/test_helper.rb +45 -5
  183. data/vendor/listen/CHANGELOG.md +228 -0
  184. data/vendor/listen/CONTRIBUTING.md +38 -0
  185. data/vendor/listen/Gemfile +30 -0
  186. data/vendor/listen/Guardfile +8 -0
  187. data/vendor/{fssm → listen}/LICENSE +1 -1
  188. data/vendor/listen/README.md +315 -0
  189. data/vendor/listen/Rakefile +47 -0
  190. data/vendor/listen/Vagrantfile +96 -0
  191. data/vendor/listen/lib/listen/adapter.rb +214 -0
  192. data/vendor/listen/lib/listen/adapters/bsd.rb +112 -0
  193. data/vendor/listen/lib/listen/adapters/darwin.rb +85 -0
  194. data/vendor/listen/lib/listen/adapters/linux.rb +113 -0
  195. data/vendor/listen/lib/listen/adapters/polling.rb +67 -0
  196. data/vendor/listen/lib/listen/adapters/windows.rb +87 -0
  197. data/vendor/listen/lib/listen/dependency_manager.rb +126 -0
  198. data/vendor/listen/lib/listen/directory_record.rb +371 -0
  199. data/vendor/listen/lib/listen/listener.rb +225 -0
  200. data/vendor/listen/lib/listen/multi_listener.rb +143 -0
  201. data/vendor/listen/lib/listen/turnstile.rb +28 -0
  202. data/vendor/listen/lib/listen/version.rb +3 -0
  203. data/vendor/listen/lib/listen.rb +40 -0
  204. data/vendor/listen/listen.gemspec +22 -0
  205. data/vendor/listen/spec/listen/adapter_spec.rb +183 -0
  206. data/vendor/listen/spec/listen/adapters/bsd_spec.rb +36 -0
  207. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +37 -0
  208. data/vendor/listen/spec/listen/adapters/linux_spec.rb +47 -0
  209. data/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
  210. data/vendor/listen/spec/listen/adapters/windows_spec.rb +30 -0
  211. data/vendor/listen/spec/listen/dependency_manager_spec.rb +107 -0
  212. data/vendor/listen/spec/listen/directory_record_spec.rb +1225 -0
  213. data/vendor/listen/spec/listen/listener_spec.rb +169 -0
  214. data/vendor/listen/spec/listen/multi_listener_spec.rb +174 -0
  215. data/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
  216. data/vendor/listen/spec/listen_spec.rb +73 -0
  217. data/vendor/listen/spec/spec_helper.rb +21 -0
  218. data/vendor/listen/spec/support/adapter_helper.rb +629 -0
  219. data/vendor/listen/spec/support/directory_record_helper.rb +55 -0
  220. data/vendor/listen/spec/support/fixtures_helper.rb +29 -0
  221. data/vendor/listen/spec/support/listeners_helper.rb +156 -0
  222. data/vendor/listen/spec/support/platform_helper.rb +15 -0
  223. metadata +344 -271
  224. data/lib/sass/less.rb +0 -382
  225. data/lib/sass/script/bool.rb +0 -18
  226. data/lib/sass/script/funcall.rb +0 -162
  227. data/lib/sass/script/list.rb +0 -76
  228. data/lib/sass/script/literal.rb +0 -245
  229. data/lib/sass/script/variable.rb +0 -54
  230. data/lib/sass/scss/sass_parser.rb +0 -11
  231. data/test/sass/less_conversion_test.rb +0 -653
  232. data/vendor/fssm/README.markdown +0 -55
  233. data/vendor/fssm/Rakefile +0 -59
  234. data/vendor/fssm/VERSION.yml +0 -5
  235. data/vendor/fssm/example.rb +0 -9
  236. data/vendor/fssm/fssm.gemspec +0 -77
  237. data/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
  238. data/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
  239. data/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
  240. data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
  241. data/vendor/fssm/lib/fssm/monitor.rb +0 -26
  242. data/vendor/fssm/lib/fssm/path.rb +0 -91
  243. data/vendor/fssm/lib/fssm/pathname.rb +0 -502
  244. data/vendor/fssm/lib/fssm/state/directory.rb +0 -57
  245. data/vendor/fssm/lib/fssm/state/file.rb +0 -24
  246. data/vendor/fssm/lib/fssm/support.rb +0 -63
  247. data/vendor/fssm/lib/fssm/tree.rb +0 -176
  248. data/vendor/fssm/lib/fssm.rb +0 -33
  249. data/vendor/fssm/profile/prof-cache.rb +0 -40
  250. data/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
  251. data/vendor/fssm/profile/prof-pathname.rb +0 -68
  252. data/vendor/fssm/profile/prof-plain-pathname.html +0 -988
  253. data/vendor/fssm/profile/prof.html +0 -2379
  254. data/vendor/fssm/spec/path_spec.rb +0 -75
  255. data/vendor/fssm/spec/root/duck/quack.txt +0 -0
  256. data/vendor/fssm/spec/root/file.css +0 -0
  257. data/vendor/fssm/spec/root/file.rb +0 -0
  258. data/vendor/fssm/spec/root/file.yml +0 -0
  259. data/vendor/fssm/spec/root/moo/cow.txt +0 -0
  260. data/vendor/fssm/spec/spec_helper.rb +0 -14
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 93af5ba687645339e994ee22f0322a8da0cd8921
4
+ data.tar.gz: 585b6cdaf03b5bad3ba5efcac0c2245d8b438768
5
+ SHA512:
6
+ metadata.gz: 6ee387ccbac66719ae087dd483a5e39746a8998f33e2f8b76194c1cb3bf32c2346a52b651eb0b45527b2e13abc03819f6a7923134f94c154530d19ae35a35120
7
+ data.tar.gz: 654f947e96a308f21a82be0534ec7a17f6a3d84bdf5bab1228357cc411a7b8d5db7b52aff449026a6e172ea1b52f5c25c28a8a4ee1f597fab8cf9bb8c5753395
data/CONTRIBUTING CHANGED
@@ -1,3 +1,3 @@
1
1
  Contributions are welcomed. Please see the following sites for guidelines:
2
2
 
3
- http://sass-lang.com/development.html#contributing
3
+ http://sass-lang.com/community#Contribute
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
1
+ Copyright (c) 2006-2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
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.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Sass
1
+ # Sass [![Gem Version](https://badge.fury.io/rb/sass.png)](http://badge.fury.io/rb/sass)
2
2
 
3
3
  **Sass makes CSS fun again**. Sass is an extension of CSS3,
4
4
  adding nested rules, variables, mixins, selector inheritance, and more.
@@ -54,10 +54,10 @@ To do so, just add
54
54
 
55
55
  to `config.ru`.
56
56
  Then any Sass files in `public/stylesheets/sass`
57
- will be compiled CSS files in `public/stylesheets` on every request.
57
+ will be compiled into CSS files in `public/stylesheets` on every request.
58
58
 
59
- To use Sass programatically,
60
- check out the [YARD documentation](http://sass-lang.com/docs/yardoc/).
59
+ To use Sass programmatically,
60
+ check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
61
61
 
62
62
  ## Formatting
63
63
 
@@ -71,10 +71,10 @@ and get small stylesheets up and running quickly,
71
71
  particularly with the help of
72
72
  [the Compass style library](http://compass-style.org).
73
73
 
74
- [vars]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_
75
- [nested]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#nested_rules_
76
- [mixins]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins
77
- [imports]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import
74
+ [vars]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
75
+ [nested]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
76
+ [mixins]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
77
+ [imports]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
78
78
 
79
79
  Sass has two syntaxes.
80
80
  The one presented here, known as "SCSS" (for "Sassy CSS"),
@@ -83,7 +83,7 @@ The other (older) syntax, known as the indented syntax or just "Sass",
83
83
  is whitespace-sensitive and indentation-based.
84
84
  For more information, see the [reference documentation][syntax].
85
85
 
86
- [syntax]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#syntax
86
+ [syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
87
87
 
88
88
  To run the following examples and see the CSS they produce,
89
89
  put them in a file called `test.scss` and run `sass test.scss`.
@@ -152,7 +152,7 @@ You can even give them arguments.
152
152
  }
153
153
 
154
154
  A comprehensive list of features is available
155
- in the [Sass reference](http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html).
155
+ in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
156
156
 
157
157
  ## Executables
158
158
 
@@ -171,20 +171,32 @@ When converting from CSS to Sass or SCSS,
171
171
  nesting is applied where appropriate.
172
172
  See `sass-convert --help` for further information and options.
173
173
 
174
+ ### Running locally
175
+
176
+ To run the Sass executables from a source checkout instead of from rubygems:
177
+
178
+ ```
179
+ $ cd <SASS_CHECKOUT_DIRECTORY>
180
+ $ bundle
181
+ $ bundle exec sass ...
182
+ $ bundle exec scss ...
183
+ $ bundle exec sass-convert ...
184
+ ```
185
+
174
186
  ## Authors
175
187
 
176
- Sass was envisioned by [Hampton Catlin](http://hamptoncatlin.com) (hcatlin).
177
- However, Hampton doesn't even know his way around the code anymore and now
178
- occasionally consults on the language issues. Hampton lives in Jacksonville,
179
- Florida and is the lead mobile developer for Wikimedia.
188
+ Sass was envisioned by [Hampton Catlin](http://www.hamptoncatlin.com)
189
+ (@hcatlin). However, Hampton doesn't even know his way around the code anymore
190
+ and now occasionally consults on the language issues. Hampton lives in San
191
+ Francisco, California and works as VP of Technology
192
+ at [Moovweb](http://www.moovweb.com/).
180
193
 
181
194
  [Nathan Weizenbaum](http://nex-3.com) is the primary developer and architect of
182
195
  Sass. His hard work has kept the project alive by endlessly answering forum
183
196
  posts, fixing bugs, refactoring, finding speed improvements, writing
184
197
  documentation, implementing new features, and getting Hampton coffee (a fitting
185
- task for a boy-genius). Nathan lives in Seattle, Washington and while not being
186
- a student at the University of Washington or working at an internship, he
187
- consults for Unspace Interactive.
198
+ task for a boy-genius). Nathan lives in Seattle, Washington and works on
199
+ [Dart](http://dartlang.org) application libraries at Google.
188
200
 
189
201
  [Chris Eppstein](http://acts-as-architect.blogspot.com) is a core contributor to
190
202
  Sass and the creator of Compass, the first Sass-based framework. Chris focuses
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ require 'rubygems/package'
2
+
1
3
  # ----- Utility Functions -----
2
4
 
3
5
  def scope(path)
@@ -19,16 +21,35 @@ Rake::TestTask.new do |t|
19
21
  t.verbose = true
20
22
  end
21
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
+
22
43
  # ----- Packaging -----
23
44
 
24
45
  # Don't use Rake::GemPackageTast because we want prerequisites to run
25
46
  # before we load the gemspec.
26
47
  desc "Build all the packages."
27
- task :package => [:revision_file, :submodules, :permissions] do
48
+ task :package => [:revision_file, :date_file, :submodules, :permissions] do
28
49
  version = get_version
29
50
  File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
30
51
  load scope('sass.gemspec')
31
- Gem::Builder.new(SASS_GEMSPEC).build
52
+ Gem::Package.build(SASS_GEMSPEC)
32
53
  sh %{git checkout VERSION}
33
54
 
34
55
  pkg = "#{SASS_GEMSPEC.name}-#{SASS_GEMSPEC.version}"
@@ -51,7 +72,7 @@ task :permissions do
51
72
  end
52
73
 
53
74
  task :revision_file do
54
- require 'lib/sass'
75
+ require scope('lib/sass')
55
76
 
56
77
  release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
57
78
  if Sass.version[:rev] && !release
@@ -63,8 +84,17 @@ task :revision_file do
63
84
  end
64
85
  end
65
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
+
66
93
  # We also need to get rid of this file after packaging.
67
- at_exit { File.delete(scope('REVISION')) rescue nil }
94
+ at_exit do
95
+ File.delete(scope('REVISION')) rescue nil
96
+ File.delete(scope('VERSION_DATE')) rescue nil
97
+ end
68
98
 
69
99
  desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
70
100
  task :install => [:package] do
@@ -115,9 +145,9 @@ task :submodules do
115
145
  if File.exist?(File.dirname(__FILE__) + "/.git")
116
146
  sh %{git submodule sync}
117
147
  sh %{git submodule update --init}
118
- elsif !File.exist?(File.dirname(__FILE__) + "/vendor/fssm/lib")
148
+ elsif !File.exist?(File.dirname(__FILE__) + "/vendor/listen/lib")
119
149
  warn <<WARN
120
- WARNING: vendor/fssm doesn't exist, and this isn't a git repository so
150
+ WARNING: vendor/listen doesn't exist, and this isn't a git repository so
121
151
  I can't get it automatically!
122
152
  WARN
123
153
  end
@@ -131,6 +161,11 @@ task :release_edge do
131
161
  sh %{git reset --hard origin/master}
132
162
  sh %{rake package}
133
163
  version = get_version
164
+ if version.include?('.rc.')
165
+ puts "#{'=' * 20} Not releasing edge gem for RC version"
166
+ next
167
+ end
168
+
134
169
  sh %{rubyforge add_release sass sass "Bleeding Edge (v#{version})" pkg/sass-#{version}.gem}
135
170
  sh %{gem push pkg/sass-#{version}.gem}
136
171
  end
@@ -147,7 +182,7 @@ def get_version
147
182
  version.map! {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
148
183
  return written_version unless version.size == 5 && version[3] == "alpha" # prerelease
149
184
 
150
- return written_version if (commit_count = `git log --pretty=oneline --first-parent stable.. | wc -l`).empty?
185
+ return written_version if (commit_count = `git log --pretty=oneline HEAD ^stable | wc -l`).empty?
151
186
  version[4] = commit_count.strip
152
187
  version.join('.')
153
188
  end
@@ -182,7 +217,7 @@ begin
182
217
  task :undocumented do
183
218
  opts = ENV["YARD_OPTS"] || ""
184
219
  ENV["YARD_OPTS"] = opts.dup + <<OPTS
185
- --list --query "
220
+ --list --tag comment --hide-tag comment --query "
186
221
  object.docstring.blank? &&
187
222
  !(object.type == :method && object.is_alias?)"
188
223
  OPTS
@@ -194,7 +229,6 @@ OPTS
194
229
  t.files = FileList.new(scope('lib/**/*.rb')) do |list|
195
230
  list.exclude('lib/sass/plugin/merb.rb')
196
231
  list.exclude('lib/sass/plugin/rails.rb')
197
- list.exclude('lib/sass/less.rb')
198
232
  end.to_a
199
233
  t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
200
234
  t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.3.0
data/VERSION_DATE ADDED
@@ -0,0 +1 @@
1
+ 08 March 2014 02:21:08 UTC
data/VERSION_NAME CHANGED
@@ -1 +1 @@
1
- Brainy Betty
1
+ Maptastic Maple
data/bin/sass CHANGED
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
  # The command line Sass parser.
3
3
 
4
- require File.dirname(__FILE__) + '/../lib/sass'
4
+ THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
5
+ begin
6
+ require File.dirname(THIS_FILE) + '/../lib/sass'
7
+ rescue LoadError
8
+ require 'sass'
9
+ end
5
10
  require 'sass/exec'
6
11
 
7
12
  opts = Sass::Exec::Sass.new(ARGV)
data/bin/sass-convert CHANGED
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require File.dirname(__FILE__) + '/../lib/sass'
3
+ THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
4
+ begin
5
+ require File.dirname(THIS_FILE) + '/../lib/sass'
6
+ rescue LoadError
7
+ require 'sass'
8
+ end
4
9
  require 'sass/exec'
5
10
 
6
11
  opts = Sass::Exec::SassConvert.new(ARGV)
data/bin/scss CHANGED
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
  # The command line Sass parser.
3
3
 
4
- require File.dirname(__FILE__) + '/../lib/sass'
4
+ THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
5
+ begin
6
+ require File.dirname(THIS_FILE) + '/../lib/sass'
7
+ rescue LoadError
8
+ require 'sass'
9
+ end
5
10
  require 'sass/exec'
6
11
 
7
12
  opts = Sass::Exec::Scss.new(ARGV)
data/ext/mkrf_conf.rb ADDED
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'rubygems/command.rb'
3
+ require 'rubygems/dependency_installer.rb'
4
+
5
+ require '../lib/sass'
6
+
7
+ # This script installs the correct version of listen. Listen versions
8
+ # beyond 1.1 don't support Ruby 1.8, any RubyGems isn't clever enough
9
+ # to install the most recent version that works, so we have to do it
10
+ # manually.
11
+
12
+ puts "Ensuring you have the right version of listen installed."
13
+
14
+ Gem::Command.build_args = ARGV
15
+ inst = Gem::DependencyInstaller.new
16
+ if Sass::Util.version_geq(RUBY_VERSION, "1.9.3")
17
+ puts "Installing listen >= 1.1.0, < 3.0.0"
18
+ inst.install "listen", Gem::Requirement.new(">= 1.1.0", "< 3.0.0")
19
+ else
20
+ puts "Installing listen ~> 1.1.0"
21
+ inst.install "listen", "~> 1.1.0"
22
+ end
23
+
24
+ # Create a dummy rakefile to indicate success.
25
+ f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w")
26
+ f.write("task :default\n")
27
+ f.close
@@ -27,7 +27,7 @@ module Sass
27
27
 
28
28
  # Retrieved cached contents.
29
29
  # Must be implemented by all subclasses.
30
- #
30
+ #
31
31
  # Note: if the key exists but the sha or version have changed,
32
32
  # then the key may be deleted by the cache store, if it wants to do so.
33
33
  #
@@ -46,9 +46,12 @@ module Sass
46
46
  #
47
47
  # @param key [String] The key to store it under.
48
48
  # @param sha [String] The checksum for the contents that are being stored.
49
- # @param obj [Object] The object to cache.
49
+ # @param root [Object] The root node to cache.
50
50
  def store(key, sha, root)
51
51
  _store(key, Sass::VERSION, sha, Marshal.dump(root))
52
+ rescue TypeError, LoadError => e
53
+ Sass::Util.sass_warn "Warning. Error encountered while saving cache #{path_to(key)}: #{e}"
54
+ nil
52
55
  end
53
56
 
54
57
  # Retrieve a {Sass::Tree::RootNode}.
@@ -59,8 +62,9 @@ module Sass
59
62
  def retrieve(key, sha)
60
63
  contents = _retrieve(key, Sass::VERSION, sha)
61
64
  Marshal.load(contents) if contents
62
- rescue EOFError, TypeError, ArgumentError => e
65
+ rescue EOFError, TypeError, ArgumentError, LoadError => e
63
66
  Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
67
+ nil
64
68
  end
65
69
 
66
70
  # Return the key for the sass file.
@@ -22,8 +22,9 @@ module Sass
22
22
  # @see Base#retrieve
23
23
  def retrieve(key, sha)
24
24
  @caches.each_with_index do |c, i|
25
- next unless obj = c.retrieve(key, sha)
26
- @caches[0...i].each {|c| c.store(key, sha, obj)}
25
+ obj = c.retrieve(key, sha)
26
+ next unless obj
27
+ @caches[0...i].each {|prev| prev.store(key, sha, obj)}
27
28
  return obj
28
29
  end
29
30
  nil
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module Sass
2
4
  module CacheStores
3
5
  # A backend for the Sass cache using the filesystem.
@@ -15,7 +17,6 @@ module Sass
15
17
  # @see Base#\_retrieve
16
18
  def _retrieve(key, version, sha)
17
19
  return unless File.readable?(path_to(key))
18
- contents = nil
19
20
  File.open(path_to(key), "rb") do |f|
20
21
  if f.readline("\n").strip == version && f.readline("\n").strip == sha
21
22
  return f.read
@@ -29,19 +30,15 @@ module Sass
29
30
 
30
31
  # @see Base#\_store
31
32
  def _store(key, version, sha, contents)
32
- # return unless File.writable?(File.dirname(@cache_location))
33
- # return if File.exists?(@cache_location) && !File.writable?(@cache_location)
34
33
  compiled_filename = path_to(key)
35
- # return if File.exists?(File.dirname(compiled_filename)) && !File.writable?(File.dirname(compiled_filename))
36
- # return if File.exists?(compiled_filename) && !File.writable?(compiled_filename)
37
34
  FileUtils.mkdir_p(File.dirname(compiled_filename))
38
- File.open(compiled_filename, "wb") do |f|
35
+ Sass::Util.atomic_create_and_write_file(compiled_filename) do |f|
39
36
  f.puts(version)
40
37
  f.puts(sha)
41
38
  f.write(contents)
42
39
  end
43
40
  rescue Errno::EACCES
44
- #pass
41
+ # pass
45
42
  end
46
43
 
47
44
  private
@@ -51,6 +48,7 @@ module Sass
51
48
  # @param key [String]
52
49
  # @return [String] The path to the cache file.
53
50
  def path_to(key)
51
+ key = key.gsub(/[<>:\\|?*%]/) {|c| "%%%03d" % Sass::Util.ord(c)}
54
52
  File.join(cache_location, key)
55
53
  end
56
54
  end
@@ -37,7 +37,7 @@ module Sass
37
37
  def store(key, sha, obj)
38
38
  @contents[key] = {:sha => sha, :obj => obj}
39
39
  end
40
-
40
+
41
41
  # Destructively clear the cache.
42
42
  def reset!
43
43
  @contents = {}
@@ -12,11 +12,11 @@ module Sass
12
12
  def _retrieve(key, version, sha)
13
13
  nil
14
14
  end
15
-
15
+
16
16
  def _store(key, version, sha, contents)
17
17
  @keys[key] = true
18
18
  end
19
-
19
+
20
20
  def was_set?(key)
21
21
  @keys[key]
22
22
  end
@@ -30,6 +30,7 @@ module Sass
30
30
  def self.extended(base)
31
31
  base.send(:include, InstanceMethods)
32
32
  end
33
+
33
34
  protected
34
35
 
35
36
  module InstanceMethods
@@ -48,7 +49,7 @@ module Sass
48
49
  # @param name [Symbol] The name of the callback
49
50
  # @return [void]
50
51
  def define_callback(name)
51
- class_eval <<RUBY
52
+ class_eval <<RUBY, __FILE__, __LINE__ + 1
52
53
  def on_#{name}(&block)
53
54
  @_sass_callbacks ||= {}
54
55
  (@_sass_callbacks[#{name.inspect}] ||= []) << block