sass 3.4.25 → 3.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +1 -1
  3. data/CONTRIBUTING.md +3 -3
  4. data/README.md +17 -9
  5. data/VERSION +1 -1
  6. data/VERSION_DATE +1 -1
  7. data/VERSION_NAME +1 -1
  8. data/extra/sass-spec-ref.sh +9 -1
  9. data/lib/sass.rb +0 -7
  10. data/lib/sass/cache_stores/filesystem.rb +1 -1
  11. data/lib/sass/css.rb +1 -2
  12. data/lib/sass/engine.rb +39 -29
  13. data/lib/sass/environment.rb +26 -5
  14. data/lib/sass/error.rb +2 -2
  15. data/lib/sass/exec/base.rb +2 -13
  16. data/lib/sass/exec/sass_scss.rb +1 -5
  17. data/lib/sass/features.rb +1 -0
  18. data/lib/sass/importers/filesystem.rb +6 -4
  19. data/lib/sass/logger/base.rb +11 -0
  20. data/lib/sass/plugin/compiler.rb +20 -50
  21. data/lib/sass/plugin/configuration.rb +2 -2
  22. data/lib/sass/railtie.rb +1 -1
  23. data/lib/sass/script/css_parser.rb +4 -1
  24. data/lib/sass/script/functions.rb +308 -81
  25. data/lib/sass/script/lexer.rb +63 -9
  26. data/lib/sass/script/parser.rb +287 -118
  27. data/lib/sass/script/tree/funcall.rb +35 -34
  28. data/lib/sass/script/tree/interpolation.rb +0 -3
  29. data/lib/sass/script/tree/list_literal.rb +23 -8
  30. data/lib/sass/script/tree/map_literal.rb +2 -2
  31. data/lib/sass/script/tree/node.rb +0 -8
  32. data/lib/sass/script/tree/operation.rb +1 -8
  33. data/lib/sass/script/value.rb +2 -0
  34. data/lib/sass/script/value/arg_list.rb +1 -1
  35. data/lib/sass/script/value/base.rb +17 -0
  36. data/lib/sass/script/value/callable.rb +25 -0
  37. data/lib/sass/script/value/color.rb +8 -2
  38. data/lib/sass/script/value/function.rb +19 -0
  39. data/lib/sass/script/value/helpers.rb +37 -11
  40. data/lib/sass/script/value/list.rb +35 -14
  41. data/lib/sass/script/value/map.rb +2 -2
  42. data/lib/sass/script/value/number.rb +3 -2
  43. data/lib/sass/scss/css_parser.rb +6 -1
  44. data/lib/sass/scss/parser.rb +145 -56
  45. data/lib/sass/scss/rx.rb +5 -11
  46. data/lib/sass/scss/static_parser.rb +20 -42
  47. data/lib/sass/selector.rb +4 -0
  48. data/lib/sass/selector/abstract_sequence.rb +7 -6
  49. data/lib/sass/selector/comma_sequence.rb +9 -5
  50. data/lib/sass/selector/pseudo.rb +20 -3
  51. data/lib/sass/selector/sequence.rb +35 -10
  52. data/lib/sass/selector/simple.rb +9 -2
  53. data/lib/sass/selector/simple_sequence.rb +8 -4
  54. data/lib/sass/source/map.rb +2 -6
  55. data/lib/sass/stack.rb +21 -1
  56. data/lib/sass/tree/charset_node.rb +1 -1
  57. data/lib/sass/tree/prop_node.rb +45 -53
  58. data/lib/sass/tree/rule_node.rb +6 -8
  59. data/lib/sass/tree/visitors/check_nesting.rb +1 -1
  60. data/lib/sass/tree/visitors/convert.rb +2 -3
  61. data/lib/sass/tree/visitors/cssize.rb +4 -15
  62. data/lib/sass/tree/visitors/deep_copy.rb +1 -1
  63. data/lib/sass/tree/visitors/extend.rb +2 -8
  64. data/lib/sass/tree/visitors/perform.rb +23 -15
  65. data/lib/sass/tree/visitors/set_options.rb +1 -1
  66. data/lib/sass/tree/visitors/to_css.rb +49 -22
  67. data/lib/sass/util.rb +72 -310
  68. data/lib/sass/util/multibyte_string_scanner.rb +127 -131
  69. data/lib/sass/util/normalized_map.rb +1 -8
  70. data/lib/sass/version.rb +0 -4
  71. metadata +55 -202
  72. data/Rakefile +0 -453
  73. data/lib/sass/script/css_variable_warning.rb +0 -52
  74. data/lib/sass/util/cross_platform_random.rb +0 -19
  75. data/lib/sass/util/ordered_hash.rb +0 -192
  76. data/test/sass-spec.yml +0 -3
  77. data/test/sass/cache_test.rb +0 -131
  78. data/test/sass/callbacks_test.rb +0 -61
  79. data/test/sass/compiler_test.rb +0 -236
  80. data/test/sass/conversion_test.rb +0 -2188
  81. data/test/sass/css2sass_test.rb +0 -526
  82. data/test/sass/css_variable_test.rb +0 -132
  83. data/test/sass/data/hsl-rgb.txt +0 -319
  84. data/test/sass/encoding_test.rb +0 -219
  85. data/test/sass/engine_test.rb +0 -3447
  86. data/test/sass/exec_test.rb +0 -96
  87. data/test/sass/extend_test.rb +0 -1733
  88. data/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
  89. data/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
  90. data/test/sass/functions_test.rb +0 -1977
  91. data/test/sass/importer_test.rb +0 -421
  92. data/test/sass/logger_test.rb +0 -58
  93. data/test/sass/mock_importer.rb +0 -49
  94. data/test/sass/more_results/more1.css +0 -9
  95. data/test/sass/more_results/more1_with_line_comments.css +0 -26
  96. data/test/sass/more_results/more_import.css +0 -29
  97. data/test/sass/more_templates/_more_partial.sass +0 -2
  98. data/test/sass/more_templates/more1.sass +0 -23
  99. data/test/sass/more_templates/more_import.sass +0 -11
  100. data/test/sass/plugin_test.rb +0 -556
  101. data/test/sass/results/alt.css +0 -4
  102. data/test/sass/results/basic.css +0 -9
  103. data/test/sass/results/cached_import_option.css +0 -3
  104. data/test/sass/results/compact.css +0 -5
  105. data/test/sass/results/complex.css +0 -86
  106. data/test/sass/results/compressed.css +0 -1
  107. data/test/sass/results/expanded.css +0 -19
  108. data/test/sass/results/filename_fn.css +0 -3
  109. data/test/sass/results/if.css +0 -3
  110. data/test/sass/results/import.css +0 -31
  111. data/test/sass/results/import_charset.css +0 -5
  112. data/test/sass/results/import_charset_1_8.css +0 -5
  113. data/test/sass/results/import_charset_ibm866.css +0 -5
  114. data/test/sass/results/import_content.css +0 -1
  115. data/test/sass/results/line_numbers.css +0 -49
  116. data/test/sass/results/mixins.css +0 -95
  117. data/test/sass/results/multiline.css +0 -24
  118. data/test/sass/results/nested.css +0 -22
  119. data/test/sass/results/options.css +0 -1
  120. data/test/sass/results/parent_ref.css +0 -13
  121. data/test/sass/results/script.css +0 -16
  122. data/test/sass/results/scss_import.css +0 -31
  123. data/test/sass/results/scss_importee.css +0 -2
  124. data/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
  125. data/test/sass/results/subdir/subdir.css +0 -3
  126. data/test/sass/results/units.css +0 -11
  127. data/test/sass/results/warn.css +0 -0
  128. data/test/sass/results/warn_imported.css +0 -0
  129. data/test/sass/script_conversion_test.rb +0 -357
  130. data/test/sass/script_test.rb +0 -1431
  131. data/test/sass/scss/css_test.rb +0 -1281
  132. data/test/sass/scss/rx_test.rb +0 -160
  133. data/test/sass/scss/scss_test.rb +0 -4205
  134. data/test/sass/scss/test_helper.rb +0 -37
  135. data/test/sass/source_map_test.rb +0 -1055
  136. data/test/sass/superselector_test.rb +0 -210
  137. data/test/sass/templates/_cached_import_option_partial.scss +0 -1
  138. data/test/sass/templates/_double_import_loop2.sass +0 -1
  139. data/test/sass/templates/_filename_fn_import.scss +0 -11
  140. data/test/sass/templates/_imported_charset_ibm866.sass +0 -4
  141. data/test/sass/templates/_imported_charset_utf8.sass +0 -4
  142. data/test/sass/templates/_imported_content.sass +0 -3
  143. data/test/sass/templates/_partial.sass +0 -2
  144. data/test/sass/templates/_same_name_different_partiality.scss +0 -1
  145. data/test/sass/templates/alt.sass +0 -16
  146. data/test/sass/templates/basic.sass +0 -23
  147. data/test/sass/templates/bork1.sass +0 -2
  148. data/test/sass/templates/bork2.sass +0 -2
  149. data/test/sass/templates/bork3.sass +0 -2
  150. data/test/sass/templates/bork4.sass +0 -2
  151. data/test/sass/templates/bork5.sass +0 -3
  152. data/test/sass/templates/cached_import_option.scss +0 -3
  153. data/test/sass/templates/compact.sass +0 -17
  154. data/test/sass/templates/complex.sass +0 -305
  155. data/test/sass/templates/compressed.sass +0 -15
  156. data/test/sass/templates/double_import_loop1.sass +0 -1
  157. data/test/sass/templates/expanded.sass +0 -17
  158. data/test/sass/templates/filename_fn.scss +0 -18
  159. data/test/sass/templates/if.sass +0 -11
  160. data/test/sass/templates/import.sass +0 -12
  161. data/test/sass/templates/import_charset.sass +0 -9
  162. data/test/sass/templates/import_charset_1_8.sass +0 -6
  163. data/test/sass/templates/import_charset_ibm866.sass +0 -11
  164. data/test/sass/templates/import_content.sass +0 -4
  165. data/test/sass/templates/importee.less +0 -2
  166. data/test/sass/templates/importee.sass +0 -19
  167. data/test/sass/templates/line_numbers.sass +0 -13
  168. data/test/sass/templates/mixin_bork.sass +0 -5
  169. data/test/sass/templates/mixins.sass +0 -76
  170. data/test/sass/templates/multiline.sass +0 -20
  171. data/test/sass/templates/nested.sass +0 -25
  172. data/test/sass/templates/nested_bork1.sass +0 -2
  173. data/test/sass/templates/nested_bork2.sass +0 -2
  174. data/test/sass/templates/nested_bork3.sass +0 -2
  175. data/test/sass/templates/nested_bork4.sass +0 -2
  176. data/test/sass/templates/nested_import.sass +0 -2
  177. data/test/sass/templates/nested_mixin_bork.sass +0 -6
  178. data/test/sass/templates/options.sass +0 -2
  179. data/test/sass/templates/parent_ref.sass +0 -25
  180. data/test/sass/templates/same_name_different_ext.sass +0 -2
  181. data/test/sass/templates/same_name_different_ext.scss +0 -1
  182. data/test/sass/templates/same_name_different_partiality.scss +0 -1
  183. data/test/sass/templates/script.sass +0 -101
  184. data/test/sass/templates/scss_import.scss +0 -12
  185. data/test/sass/templates/scss_importee.scss +0 -1
  186. data/test/sass/templates/single_import_loop.sass +0 -1
  187. data/test/sass/templates/subdir/import_up1.scss +0 -1
  188. data/test/sass/templates/subdir/import_up2.scss +0 -1
  189. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
  190. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
  191. data/test/sass/templates/subdir/subdir.sass +0 -6
  192. data/test/sass/templates/units.sass +0 -11
  193. data/test/sass/templates/warn.sass +0 -3
  194. data/test/sass/templates/warn_imported.sass +0 -4
  195. data/test/sass/test_helper.rb +0 -8
  196. data/test/sass/util/multibyte_string_scanner_test.rb +0 -155
  197. data/test/sass/util/normalized_map_test.rb +0 -51
  198. data/test/sass/util/subset_map_test.rb +0 -91
  199. data/test/sass/util_test.rb +0 -438
  200. data/test/sass/value_helpers_test.rb +0 -179
  201. data/test/test_helper.rb +0 -110
  202. data/vendor/listen/CHANGELOG.md +0 -1
  203. data/vendor/listen/CONTRIBUTING.md +0 -38
  204. data/vendor/listen/Gemfile +0 -20
  205. data/vendor/listen/Guardfile +0 -8
  206. data/vendor/listen/LICENSE +0 -20
  207. data/vendor/listen/README.md +0 -349
  208. data/vendor/listen/Rakefile +0 -5
  209. data/vendor/listen/Vagrantfile +0 -96
  210. data/vendor/listen/lib/listen.rb +0 -54
  211. data/vendor/listen/lib/listen/adapter.rb +0 -327
  212. data/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
  213. data/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
  214. data/vendor/listen/lib/listen/adapters/linux.rb +0 -81
  215. data/vendor/listen/lib/listen/adapters/polling.rb +0 -58
  216. data/vendor/listen/lib/listen/adapters/windows.rb +0 -91
  217. data/vendor/listen/lib/listen/directory_record.rb +0 -406
  218. data/vendor/listen/lib/listen/listener.rb +0 -323
  219. data/vendor/listen/lib/listen/turnstile.rb +0 -32
  220. data/vendor/listen/lib/listen/version.rb +0 -3
  221. data/vendor/listen/listen.gemspec +0 -28
  222. data/vendor/listen/spec/listen/adapter_spec.rb +0 -149
  223. data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
  224. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
  225. data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
  226. data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
  227. data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
  228. data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
  229. data/vendor/listen/spec/listen/listener_spec.rb +0 -258
  230. data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
  231. data/vendor/listen/spec/listen_spec.rb +0 -67
  232. data/vendor/listen/spec/spec_helper.rb +0 -25
  233. data/vendor/listen/spec/support/adapter_helper.rb +0 -666
  234. data/vendor/listen/spec/support/directory_record_helper.rb +0 -57
  235. data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
  236. data/vendor/listen/spec/support/listeners_helper.rb +0 -179
  237. data/vendor/listen/spec/support/platform_helper.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8b2d6c079c8e8aec59e0dd45294419919f88239
4
- data.tar.gz: 5e31ebbe100aa0b066d414ee32e3f29d792907f6
3
+ metadata.gz: 6442c161b5fc7709753d4bdc2a134f340af6d908
4
+ data.tar.gz: '0946cacd17612b438ce689b86cce9fa6a90bc208'
5
5
  SHA512:
6
- metadata.gz: 1782f895c1aaeef19491dfb41434ca10a60d28395f53a3ec19f8a65ec21c97625db3325732007fbc3155821c53adf9bcd00ced70e9fe3c1c935295b34f3dfdaf
7
- data.tar.gz: 39578a844dd4d6e381cb10ced82d5c6782ddd042c79cc5c4c9cc6a69163badbf1ce368526987447b955d44a3d20470ea5e4eae481ea9359d63eea09cab94ca70
6
+ metadata.gz: 87b7eb8440a85957deaf8b83549d60fdb86f8c5f865aab9db67bee7ba8cd5c0985f05018c9a7ff18e1ea514aa2beb8dbca238257f76e6db14b9f6b1793bf4388
7
+ data.tar.gz: 5c786b64db488ba61d018257943aeb1ab9365c2e7069201ae0a5759fdbe6576f36d57a885ea690824d15d398d2c8c656fb21be0460ca5f6b088f2e10cfd1edee
@@ -7,4 +7,4 @@ fair place to play.
7
7
 
8
8
  [The full community guidelines can be found on the Sass website.][link]
9
9
 
10
- [link]: http://sass-lang.com/community-guidelines
10
+ [link]: https://sass-lang.com/community-guidelines
@@ -1,6 +1,6 @@
1
1
  Contributions are welcomed. Please see the following site for guidelines:
2
2
 
3
- [http://sass-lang.com/community#Contribute](http://sass-lang.com/community#Contribute)
3
+ [https://sass-lang.com/community#Contribute](https://sass-lang.com/community#Contribute)
4
4
 
5
5
  * [Branches](#main-development-branches)
6
6
  * [Feature Branches](#feature-branches)
@@ -18,7 +18,7 @@ is regularly merged into the one below: `stable` into `next`, `next` into
18
18
  `master`.
19
19
 
20
20
  * The `stable` branch is the default—it's what GitHub shows if you go to
21
- [sass/sass](https://github.com/sass/sass), and it's the default place for pull
21
+ [sass/ruby-sass](https://github.com/sass/ruby-sass), and it's the default place for pull
22
22
  requests to go. This branch is where we work on the next patch release. Bug
23
23
  fixes and documentation improvements belong here, but not new features.
24
24
 
@@ -100,7 +100,7 @@ like [`Sass::Engine`][Sass::Engine] stable, we don't have a strong distinction
100
100
  between public and private APIs and we need to be able to freely refactor our
101
101
  code.
102
102
 
103
- [Sass::Engine]: http://sass-lang.com/documentation/Sass/Engine.html
103
+ [Sass::Engine]: https://sass-lang.com/documentation/Sass/Engine.html
104
104
 
105
105
  ### Making Breaking Changes
106
106
 
data/README.md CHANGED
@@ -1,4 +1,12 @@
1
- # Sass [![Gem Version](https://badge.fury.io/rb/sass.svg)](http://badge.fury.io/rb/sass) [![Inline docs](http://inch-ci.org/github/sass/sass.svg)](http://inch-ci.org/github/sass/sass)
1
+ ## Ruby Sass Has Reached End-of-Life
2
+
3
+ Ruby Sass should no longer be used, and will no longer be receiving any updates.
4
+ See [the Sass blog][], and consider switching to the [`sassc` gem].
5
+
6
+ [the Sass blog]: https://sass-lang.com/blog/posts/7828841
7
+ [`sassc` gem]: https://rubygems.org/gems/sassc
8
+
9
+ # Sass [![Travis Build Status](https://travis-ci.org/sass/ruby-sass.svg?branch=next)](https://travis-ci.org/sass/ruby-sass) [![Gem Version](https://badge.fury.io/rb/sass.svg)](http://badge.fury.io/rb/sass) [![Inline docs](http://inch-ci.org/github/sass/sass.svg)](http://inch-ci.org/github/sass/sass)
2
10
 
3
11
  **Sass makes CSS fun again**. Sass is an extension of CSS,
4
12
  adding nested rules, variables, mixins, selector inheritance, and more.
@@ -44,7 +52,7 @@ In Rails 3, add `gem "sass"` to your Gemfile instead.
44
52
  where they'll be automatically compiled
45
53
  to corresponding CSS files in `public/stylesheets` when needed
46
54
  (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).
55
+ see [the Sass reference](https://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
48
56
 
49
57
  Sass can also be used with any Rack-enabled web framework.
50
58
  To do so, just add
@@ -59,7 +67,7 @@ Then any Sass files in `public/stylesheets/sass`
59
67
  will be compiled into CSS files in `public/stylesheets` on every request.
60
68
 
61
69
  To use Sass programmatically,
62
- check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
70
+ check out the [YARD documentation](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
63
71
 
64
72
  ## Formatting
65
73
 
@@ -73,10 +81,10 @@ and get small stylesheets up and running quickly,
73
81
  particularly with the help of
74
82
  [the Compass style library](http://compass-style.org).
75
83
 
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
84
+ [vars]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
85
+ [nested]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
86
+ [mixins]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
87
+ [imports]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
80
88
 
81
89
  Sass has two syntaxes.
82
90
  The one presented here, known as "SCSS" (for "Sassy CSS"),
@@ -85,7 +93,7 @@ The other (older) syntax, known as the indented syntax or just "Sass",
85
93
  is whitespace-sensitive and indentation-based.
86
94
  For more information, see the [reference documentation][syntax].
87
95
 
88
- [syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
96
+ [syntax]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
89
97
 
90
98
  To run the following examples and see the CSS they produce,
91
99
  put them in a file called `test.scss` and run `sass test.scss`.
@@ -160,7 +168,7 @@ You can even give them arguments.
160
168
  ```
161
169
 
162
170
  A comprehensive list of features is available
163
- in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
171
+ in the [Sass reference](https://sass-lang.com/documentation/file.SASS_REFERENCE.html).
164
172
 
165
173
  ## Executables
166
174
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.25
1
+ 3.7.4
@@ -1 +1 @@
1
- 07 July 2017 22:00:34 UTC
1
+ 04 April 2019 00:49:58 UTC
@@ -1 +1 @@
1
- Selective Steve
1
+ Bleeding Edge
@@ -18,7 +18,15 @@ fi
18
18
 
19
19
  >&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..."
20
20
 
21
- JSON=$(curl -L -sS https://api.github.com/repos/sass/sass/pulls/$TRAVIS_PULL_REQUEST)
21
+ url=https://api.github.com/repos/sass/ruby-sass/pulls/$TRAVIS_PULL_REQUEST
22
+ if [ -z "$GITHUB_AUTH" ]; then
23
+ >&2 echo "Fetching pull request info without authentication"
24
+ JSON=$(curl -L -sS $url)
25
+ else
26
+ >&2 echo "Fetching pull request info as sassbot"
27
+ JSON=$(curl -u "sassbot:$GITHUB_AUTH" -L -sS $url)
28
+ fi
29
+ >&2 echo "$JSON"
22
30
 
23
31
  RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
24
32
 
@@ -100,10 +100,3 @@ require 'sass/engine'
100
100
  require 'sass/plugin' if defined?(Merb::Plugins)
101
101
  require 'sass/railtie'
102
102
  require 'sass/features'
103
-
104
- if Sass::Util.ruby1?
105
- Sass::Util.sass_warn(
106
- "DEPRECATION WARNING:\n" +
107
- "Sass 3.5 will no longer support Ruby #{RUBY_VERSION}.\n" +
108
- "Please upgrade to Ruby 2.0.0 or greater as soon as possible.\n")
109
- end
@@ -52,7 +52,7 @@ module Sass
52
52
  # @param key [String]
53
53
  # @return [String] The path to the cache file.
54
54
  def path_to(key)
55
- key = key.gsub(/[<>:\\|?*%]/) {|c| "%%%03d" % (Sass::Util.ord(c))}
55
+ key = key.gsub(/[<>:\\|?*%]/) {|c| "%%%03d" % c.ord}
56
56
  File.join(cache_location, key)
57
57
  end
58
58
  end
@@ -51,8 +51,7 @@ module Sass
51
51
  raise err
52
52
  end
53
53
 
54
- # Returns the original encoding of the document,
55
- # or `nil` under Ruby 1.8.
54
+ # Returns the original encoding of the document.
56
55
  #
57
56
  # @return [Encoding, nil]
58
57
  # @raise [Encoding::UndefinedConversionError] if the source encoding
@@ -80,7 +80,13 @@ module Sass
80
80
  #
81
81
  # `type`: `String`
82
82
  # : The user-friendly name of the type of the callable.
83
- Callable = Struct.new(:name, :args, :splat, :environment, :tree, :has_content, :type)
83
+ #
84
+ # `origin`: `Symbol`
85
+ # : From whence comes the callable: `:stylesheet`, `:builtin`, `:css`
86
+ # A callable with an origin of `:stylesheet` was defined in the stylesheet itself.
87
+ # A callable with an origin of `:builtin` was defined in ruby.
88
+ # A callable (function) with an origin of `:css` returns a function call with arguments to CSS.
89
+ Callable = Struct.new(:name, :args, :splat, :environment, :tree, :has_content, :type, :origin)
84
90
 
85
91
  # This class handles the parsing and compilation of the Sass template.
86
92
  # Example usage:
@@ -316,8 +322,7 @@ module Sass
316
322
  end
317
323
  end
318
324
 
319
- # Returns the original encoding of the document,
320
- # or `nil` under Ruby 1.8.
325
+ # Returns the original encoding of the document.
321
326
  #
322
327
  # @return [Encoding, nil]
323
328
  # @raise [Encoding::UndefinedConversionError] if the source encoding
@@ -370,7 +375,7 @@ Error generating source map: couldn't determine public URL for "#{filename}".
370
375
  Without a public URL, there's nothing for the source map to link to.
371
376
  An importer was not set for this file.
372
377
  ERR
373
- elsif Sass::Util.silence_warnings do
378
+ elsif Sass::Util.silence_sass_warnings do
374
379
  sourcemap_dir = nil if @options[:sourcemap] == :file
375
380
  importer.public_url(filename, sourcemap_dir).nil?
376
381
  end
@@ -386,7 +391,7 @@ ERR
386
391
  rendered << "\n" if rendered[-1] != ?\n
387
392
  rendered << "\n" unless compressed
388
393
  rendered << "/*# sourceMappingURL="
389
- rendered << Sass::Util.escape_uri(sourcemap_uri)
394
+ rendered << URI::DEFAULT_PARSER.escape(sourcemap_uri)
390
395
  rendered << " */\n"
391
396
  return rendered, sourcemap
392
397
  end
@@ -494,7 +499,6 @@ END
494
499
  lines
495
500
  end
496
501
 
497
- # @comment
498
502
  def try_comment(line, last, tab_str, comment_tab_str, index)
499
503
  return unless last && last.comment?
500
504
  # Nested comment stuff must be at least one whitespace char deeper
@@ -520,10 +524,6 @@ MSG
520
524
  nodes = []
521
525
  while (line = arr[i]) && line.tabs >= base
522
526
  if line.tabs > base
523
- raise SyntaxError.new(
524
- "The line was indented #{line.tabs - base} levels deeper than the previous line.",
525
- :line => line.index) if line.tabs > base + 1
526
-
527
527
  nodes.last.children, i = tree(arr, i)
528
528
  else
529
529
  nodes << line
@@ -695,7 +695,14 @@ WARNING
695
695
  end
696
696
 
697
697
  name = line.text[0...scanner.pos]
698
- if (scanned = scanner.scan(/\s*:(?:\s+|$)/)) # test for a property
698
+ could_be_property =
699
+ if name.start_with?('--')
700
+ (scanned = scanner.scan(/\s*:/))
701
+ else
702
+ (scanned = scanner.scan(/\s*:(?:\s+|$)/))
703
+ end
704
+
705
+ if could_be_property # test for a property
699
706
  offset += scanned.length
700
707
  property = parse_property(name, res, scanner.rest, :new, line, offset)
701
708
  property.name_source_range = ident_range
@@ -718,26 +725,33 @@ WARNING
718
725
  end
719
726
  end
720
727
 
721
- # @comment
722
- # rubocop:disable ParameterLists
723
728
  def parse_property(name, parsed_name, value, prop, line, start_offset)
724
- # rubocop:enable ParameterLists
725
- if value.strip.empty?
726
- expr = Sass::Script::Tree::Literal.new(Sass::Script::Value::String.new(""))
729
+
730
+ if name.start_with?('--')
731
+ unless line.children.empty?
732
+ raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath custom properties.",
733
+ :line => @line + 1)
734
+ end
735
+
736
+ parser = Sass::SCSS::Parser.new(value,
737
+ @options[:filename], @options[:importer],
738
+ @line, to_parser_offset(@offset))
739
+ parsed_value = parser.parse_declaration_value
740
+ end_offset = start_offset + value.length
741
+ elsif value.strip.empty?
742
+ parsed_value = [Sass::Script::Tree::Literal.new(Sass::Script::Value::String.new(""))]
727
743
  end_offset = start_offset
728
744
  else
729
- expr = parse_script(value,
730
- :offset => to_parser_offset(start_offset),
731
- :css_variable => name.start_with?("--"))
745
+ expr = parse_script(value, :offset => to_parser_offset(start_offset))
732
746
  end_offset = expr.source_range.end_pos.offset - 1
747
+ parsed_value = [expr]
733
748
  end
734
-
735
- node = Tree::PropNode.new(parse_interp(name), expr, prop)
749
+ node = Tree::PropNode.new(parse_interp(name), parsed_value, prop)
736
750
  node.value_source_range = Sass::Source::Range.new(
737
751
  Sass::Source::Position.new(line.index, to_parser_offset(start_offset)),
738
752
  Sass::Source::Position.new(line.index, to_parser_offset(end_offset)),
739
753
  @options[:filename], @options[:importer])
740
- if value.strip.empty? && line.children.empty?
754
+ if !node.custom_property? && value.strip.empty? && line.children.empty?
741
755
  raise SyntaxError.new(
742
756
  "Invalid property: \"#{node.declaration}\" (no value)." +
743
757
  node.pseudo_class_selector_message)
@@ -1020,8 +1034,6 @@ WARNING
1020
1034
  values
1021
1035
  end
1022
1036
 
1023
- # @comment
1024
- # rubocop:disable MethodLength
1025
1037
  def parse_import_arg(scanner, offset)
1026
1038
  return if scanner.eos?
1027
1039
 
@@ -1096,8 +1108,6 @@ WARNING
1096
1108
  end
1097
1109
  node
1098
1110
  end
1099
- # @comment
1100
- # rubocop:enable MethodLength
1101
1111
 
1102
1112
  def parse_mixin_directive(parent, line, root, value, offset)
1103
1113
  parse_mixin_definition(line)
@@ -1154,9 +1164,9 @@ WARNING
1154
1164
  end
1155
1165
 
1156
1166
  def parse_script(script, options = {})
1157
- line = options.delete(:line) || @line
1158
- offset = options.delete(:offset) || @offset + 1
1159
- Script.parse(script, line, offset, @options.merge(options))
1167
+ line = options[:line] || @line
1168
+ offset = options[:offset] || @offset + 1
1169
+ Script.parse(script, line, offset, @options)
1160
1170
  end
1161
1171
 
1162
1172
  def format_comment_text(text, silent)
@@ -175,6 +175,10 @@ module Sass
175
175
 
176
176
  # A read-only wrapper for a lexical environment for SassScript.
177
177
  class ReadOnlyEnvironment < BaseEnvironment
178
+ def initialize(parent = nil, options = nil)
179
+ super
180
+ @content_cached = nil
181
+ end
178
182
  # The read-only environment of the caller of this environment's mixin or function.
179
183
  #
180
184
  # @see BaseEnvironment#caller
@@ -185,14 +189,31 @@ module Sass
185
189
  @caller ||= env.is_a?(ReadOnlyEnvironment) ? env : ReadOnlyEnvironment.new(env, env.options)
186
190
  end
187
191
 
188
- # The read-only content passed to this environment.
192
+ # The content passed to this environment. If the content's environment isn't already
193
+ # read-only, it's made read-only.
189
194
  #
190
195
  # @see BaseEnvironment#content
191
- # @return {ReadOnlyEnvironment}
196
+ #
197
+ # @return {[Array<Sass::Tree::Node>, ReadOnlyEnvironment]?} The content nodes and
198
+ # the lexical environment of the content block.
199
+ # Returns `nil` when there is no content in this environment.
192
200
  def content
193
- return @content if @content
194
- env = super
195
- @content ||= env.is_a?(ReadOnlyEnvironment) ? env : ReadOnlyEnvironment.new(env, env.options)
201
+ # Return the cached content from a previous invocation if any
202
+ return @content if @content_cached
203
+ # get the content with a read-write environment from the superclass
204
+ read_write_content = super
205
+ if read_write_content
206
+ tree, env = read_write_content
207
+ # make the content's environment read-only
208
+ if env && !env.is_a?(ReadOnlyEnvironment)
209
+ env = ReadOnlyEnvironment.new(env, env.options)
210
+ end
211
+ @content_cached = true
212
+ @content = [tree, env]
213
+ else
214
+ @content_cached = true
215
+ @content = nil
216
+ end
196
217
  end
197
218
  end
198
219
 
@@ -142,7 +142,7 @@ module Sass
142
142
  msg = lines[0] + lines[1..-1].
143
143
  map {|l| "\n" + (" " * "Error: ".size) + l}.join
144
144
  "Error: #{msg}" +
145
- Sass::Util.enum_with_index(sass_backtrace).map do |entry, i|
145
+ sass_backtrace.each_with_index.map do |entry, i|
146
146
  "\n #{i == 0 ? 'on' : 'from'} line #{entry[:line]}" +
147
147
  " of #{entry[:filename] || default_filename}" +
148
148
  (entry[:mixin] ? ", in `#{entry[:mixin]}'" : "")
@@ -186,7 +186,7 @@ END
186
186
  section = e.sass_template.rstrip.split("\n")[min...line_num + 5]
187
187
  return e.sass_backtrace_str if section.nil? || section.empty?
188
188
 
189
- e.sass_backtrace_str + "\n\n" + Sass::Util.enum_with_index(section).
189
+ e.sass_backtrace_str + "\n\n" + section.each_with_index.
190
190
  map {|line, i| "#{line_offset + min + i}: #{line}"}.join("\n")
191
191
  end
192
192
  end
@@ -14,7 +14,6 @@ module Sass::Exec
14
14
  #
15
15
  # @see #parse
16
16
  def parse!
17
- # rubocop:disable RescueException
18
17
  begin
19
18
  parse
20
19
  rescue Exception => e
@@ -38,7 +37,6 @@ module Sass::Exec
38
37
  exit 1
39
38
  end
40
39
  exit 0
41
- # rubocop:enable RescueException
42
40
  end
43
41
 
44
42
  # Parses the command-line arguments and runs the executable.
@@ -90,18 +88,9 @@ module Sass::Exec
90
88
  #
91
89
  # @param opts [OptionParser]
92
90
  def encoding_option(opts)
93
- encoding_desc = if Sass::Util.ruby1_8?
94
- 'Does not work in Ruby 1.8.'
95
- else
96
- 'Specify the default encoding for input files.'
97
- end
91
+ encoding_desc = 'Specify the default encoding for input files.'
98
92
  opts.on('-E', '--default-encoding ENCODING', encoding_desc) do |encoding|
99
- if Sass::Util.ruby1_8?
100
- $stderr.puts "Specifying the encoding is not supported in ruby 1.8."
101
- exit 1
102
- else
103
- Encoding.default_external = encoding
104
- end
93
+ Encoding.default_external = encoding
105
94
  end
106
95
  end
107
96
 
@@ -92,7 +92,7 @@ END
92
92
  end
93
93
 
94
94
  opts.on("-v", "--version", "Print the Sass version.") do
95
- puts("Sass #{Sass.version[:string]}")
95
+ puts("Ruby Sass #{Sass.version[:string]}")
96
96
  exit
97
97
  end
98
98
  end
@@ -256,8 +256,6 @@ MESSAGE
256
256
  Sass::Repl.new(@options).run
257
257
  end
258
258
 
259
- # @comment
260
- # rubocop:disable MethodLength
261
259
  def watch_or_update
262
260
  require 'sass/plugin'
263
261
  Sass::Plugin.options.merge! @options[:for_engine]
@@ -359,8 +357,6 @@ WARNING
359
357
 
360
358
  Sass::Plugin.watch(files)
361
359
  end
362
- # @comment
363
- # rubocop:enable MethodLength
364
360
 
365
361
  def run
366
362
  input = @options[:input]