sass4 4.0.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 (147) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +13 -0
  3. data/AGENTS.md +534 -0
  4. data/CODE_OF_CONDUCT.md +10 -0
  5. data/CONTRIBUTING.md +148 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +242 -0
  8. data/VERSION +1 -0
  9. data/VERSION_NAME +1 -0
  10. data/bin/sass +13 -0
  11. data/bin/sass-convert +12 -0
  12. data/bin/scss +13 -0
  13. data/extra/sass-spec-ref.sh +40 -0
  14. data/extra/update_watch.rb +13 -0
  15. data/init.rb +18 -0
  16. data/lib/sass/cache_stores/base.rb +88 -0
  17. data/lib/sass/cache_stores/chain.rb +34 -0
  18. data/lib/sass/cache_stores/filesystem.rb +60 -0
  19. data/lib/sass/cache_stores/memory.rb +46 -0
  20. data/lib/sass/cache_stores/null.rb +25 -0
  21. data/lib/sass/cache_stores.rb +15 -0
  22. data/lib/sass/callbacks.rb +67 -0
  23. data/lib/sass/css.rb +407 -0
  24. data/lib/sass/deprecation.rb +55 -0
  25. data/lib/sass/engine.rb +1236 -0
  26. data/lib/sass/environment.rb +236 -0
  27. data/lib/sass/error.rb +198 -0
  28. data/lib/sass/exec/base.rb +188 -0
  29. data/lib/sass/exec/sass_convert.rb +283 -0
  30. data/lib/sass/exec/sass_scss.rb +436 -0
  31. data/lib/sass/exec.rb +9 -0
  32. data/lib/sass/features.rb +48 -0
  33. data/lib/sass/importers/base.rb +182 -0
  34. data/lib/sass/importers/deprecated_path.rb +51 -0
  35. data/lib/sass/importers/filesystem.rb +221 -0
  36. data/lib/sass/importers.rb +23 -0
  37. data/lib/sass/logger/base.rb +47 -0
  38. data/lib/sass/logger/delayed.rb +50 -0
  39. data/lib/sass/logger/log_level.rb +45 -0
  40. data/lib/sass/logger.rb +17 -0
  41. data/lib/sass/media.rb +210 -0
  42. data/lib/sass/plugin/compiler.rb +552 -0
  43. data/lib/sass/plugin/configuration.rb +134 -0
  44. data/lib/sass/plugin/generic.rb +15 -0
  45. data/lib/sass/plugin/merb.rb +48 -0
  46. data/lib/sass/plugin/rack.rb +60 -0
  47. data/lib/sass/plugin/rails.rb +47 -0
  48. data/lib/sass/plugin/staleness_checker.rb +199 -0
  49. data/lib/sass/plugin.rb +134 -0
  50. data/lib/sass/railtie.rb +10 -0
  51. data/lib/sass/repl.rb +57 -0
  52. data/lib/sass/root.rb +7 -0
  53. data/lib/sass/script/css_lexer.rb +33 -0
  54. data/lib/sass/script/css_parser.rb +36 -0
  55. data/lib/sass/script/functions.rb +3103 -0
  56. data/lib/sass/script/lexer.rb +518 -0
  57. data/lib/sass/script/parser.rb +1164 -0
  58. data/lib/sass/script/tree/funcall.rb +314 -0
  59. data/lib/sass/script/tree/interpolation.rb +220 -0
  60. data/lib/sass/script/tree/list_literal.rb +119 -0
  61. data/lib/sass/script/tree/literal.rb +49 -0
  62. data/lib/sass/script/tree/map_literal.rb +64 -0
  63. data/lib/sass/script/tree/node.rb +119 -0
  64. data/lib/sass/script/tree/operation.rb +149 -0
  65. data/lib/sass/script/tree/selector.rb +26 -0
  66. data/lib/sass/script/tree/string_interpolation.rb +125 -0
  67. data/lib/sass/script/tree/unary_operation.rb +69 -0
  68. data/lib/sass/script/tree/variable.rb +57 -0
  69. data/lib/sass/script/tree.rb +16 -0
  70. data/lib/sass/script/value/arg_list.rb +36 -0
  71. data/lib/sass/script/value/base.rb +258 -0
  72. data/lib/sass/script/value/bool.rb +35 -0
  73. data/lib/sass/script/value/callable.rb +25 -0
  74. data/lib/sass/script/value/color.rb +704 -0
  75. data/lib/sass/script/value/function.rb +19 -0
  76. data/lib/sass/script/value/helpers.rb +298 -0
  77. data/lib/sass/script/value/list.rb +135 -0
  78. data/lib/sass/script/value/map.rb +70 -0
  79. data/lib/sass/script/value/null.rb +44 -0
  80. data/lib/sass/script/value/number.rb +564 -0
  81. data/lib/sass/script/value/string.rb +138 -0
  82. data/lib/sass/script/value.rb +13 -0
  83. data/lib/sass/script.rb +66 -0
  84. data/lib/sass/scss/css_parser.rb +61 -0
  85. data/lib/sass/scss/parser.rb +1343 -0
  86. data/lib/sass/scss/rx.rb +134 -0
  87. data/lib/sass/scss/static_parser.rb +351 -0
  88. data/lib/sass/scss.rb +14 -0
  89. data/lib/sass/selector/abstract_sequence.rb +112 -0
  90. data/lib/sass/selector/comma_sequence.rb +195 -0
  91. data/lib/sass/selector/pseudo.rb +291 -0
  92. data/lib/sass/selector/sequence.rb +661 -0
  93. data/lib/sass/selector/simple.rb +124 -0
  94. data/lib/sass/selector/simple_sequence.rb +348 -0
  95. data/lib/sass/selector.rb +327 -0
  96. data/lib/sass/shared.rb +76 -0
  97. data/lib/sass/source/map.rb +209 -0
  98. data/lib/sass/source/position.rb +39 -0
  99. data/lib/sass/source/range.rb +41 -0
  100. data/lib/sass/stack.rb +140 -0
  101. data/lib/sass/supports.rb +225 -0
  102. data/lib/sass/tree/at_root_node.rb +83 -0
  103. data/lib/sass/tree/charset_node.rb +22 -0
  104. data/lib/sass/tree/comment_node.rb +82 -0
  105. data/lib/sass/tree/content_node.rb +9 -0
  106. data/lib/sass/tree/css_import_node.rb +68 -0
  107. data/lib/sass/tree/debug_node.rb +18 -0
  108. data/lib/sass/tree/directive_node.rb +59 -0
  109. data/lib/sass/tree/each_node.rb +24 -0
  110. data/lib/sass/tree/error_node.rb +18 -0
  111. data/lib/sass/tree/extend_node.rb +43 -0
  112. data/lib/sass/tree/for_node.rb +36 -0
  113. data/lib/sass/tree/function_node.rb +44 -0
  114. data/lib/sass/tree/if_node.rb +52 -0
  115. data/lib/sass/tree/import_node.rb +75 -0
  116. data/lib/sass/tree/keyframe_rule_node.rb +15 -0
  117. data/lib/sass/tree/media_node.rb +48 -0
  118. data/lib/sass/tree/mixin_def_node.rb +38 -0
  119. data/lib/sass/tree/mixin_node.rb +52 -0
  120. data/lib/sass/tree/node.rb +240 -0
  121. data/lib/sass/tree/prop_node.rb +162 -0
  122. data/lib/sass/tree/return_node.rb +19 -0
  123. data/lib/sass/tree/root_node.rb +44 -0
  124. data/lib/sass/tree/rule_node.rb +153 -0
  125. data/lib/sass/tree/supports_node.rb +38 -0
  126. data/lib/sass/tree/trace_node.rb +33 -0
  127. data/lib/sass/tree/variable_node.rb +36 -0
  128. data/lib/sass/tree/visitors/base.rb +72 -0
  129. data/lib/sass/tree/visitors/check_nesting.rb +173 -0
  130. data/lib/sass/tree/visitors/convert.rb +350 -0
  131. data/lib/sass/tree/visitors/cssize.rb +362 -0
  132. data/lib/sass/tree/visitors/deep_copy.rb +107 -0
  133. data/lib/sass/tree/visitors/extend.rb +64 -0
  134. data/lib/sass/tree/visitors/perform.rb +572 -0
  135. data/lib/sass/tree/visitors/set_options.rb +139 -0
  136. data/lib/sass/tree/visitors/to_css.rb +440 -0
  137. data/lib/sass/tree/warn_node.rb +18 -0
  138. data/lib/sass/tree/while_node.rb +18 -0
  139. data/lib/sass/util/multibyte_string_scanner.rb +151 -0
  140. data/lib/sass/util/normalized_map.rb +122 -0
  141. data/lib/sass/util/subset_map.rb +109 -0
  142. data/lib/sass/util/test.rb +9 -0
  143. data/lib/sass/util.rb +1137 -0
  144. data/lib/sass/version.rb +120 -0
  145. data/lib/sass.rb +102 -0
  146. data/rails/init.rb +1 -0
  147. metadata +283 -0
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,148 @@
1
+ Contributions are welcomed. Please see the following site for guidelines:
2
+
3
+ [https://sass-lang.com/community#Contribute](https://sass-lang.com/community#Contribute)
4
+
5
+ * [Branches](#main-development-branches)
6
+ * [Feature Branches](#feature-branches)
7
+ * [Experimental Branches](#experimental-branches)
8
+ * [Old Stable Branches](#old-stable-branches)
9
+ * [Versioning](#versioning)
10
+ * [Making Breaking Changes](#making-breaking-changes)
11
+ * [Exceptional Breakages](#exceptional-breakages)
12
+
13
+ ## Branches
14
+
15
+ The Sass repository has three primary development branches, each of which tracks
16
+ a different line of releases (see [versioning](#versioning) below). Each branch
17
+ is regularly merged into the one below: `stable` into `next`, `next` into
18
+ `master`.
19
+
20
+ * The `stable` branch is the default—it's what GitHub shows if you go to
21
+ [sass/ruby-sass](https://github.com/sass/ruby-sass), and it's the default place for pull
22
+ requests to go. This branch is where we work on the next patch release. Bug
23
+ fixes and documentation improvements belong here, but not new features.
24
+
25
+ * The `next` branch is where we work on the next minor release. It's where most
26
+ new features go, as long as they're not breaking changes. Very occasionally
27
+ breaking changes will go here as well—see
28
+ [exceptional breakages](#exceptional-breakages) below for details.
29
+
30
+ * The `master` branch is where we work on the next major release. It's where
31
+ breaking changes go. We also occasionally decide that a non-breaking feature
32
+ is big enough to warrant saving until the next major release, in which case it
33
+ will also be developed here.
34
+
35
+ Ideally, pull requests would be made against the appropriate
36
+ branch, but don't worry about it too much; if you make a request against the
37
+ wrong branch, the maintainer will take responsibility for rebasing it before
38
+ merging.
39
+
40
+ ### Testing
41
+
42
+ Tests for changes to the Sass language go in
43
+ [sass-spec](https://github.com/sass/sass-spec) so that other
44
+ implementations (E.g. libSass) can be tested against the same test
45
+ suite. The sass-spec repo follows a "trunk development" model in that
46
+ the tests there test against different version of the Sass language (as
47
+ opposed to having branches that track different Sass versions). When
48
+ contributing changes to Sass, update the Gemfile to use sass-spec from a
49
+ branch or fork that has the new tests. When the feature lands in Sass,
50
+ the committer will also merge the corresponding sass-spec changes.
51
+
52
+ The [documentation of
53
+ sass-spec](https://github.com/sass/sass-spec/blob/master/README.md)
54
+ explains how to run sass-spec and contribute changes. In development,
55
+ Change the Gemfile(s) to use the `:path` option against the sass-spec gem
56
+ to link your local checkout of sass and sass-spec together in one or
57
+ both directions.
58
+
59
+ Changes to Sass internals or Ruby Sass specific features (E.g.
60
+ the `sass-convert` tool) should always have tests in the Sass `test`
61
+ directory following the conventions you see there.
62
+
63
+ ### Feature Branches
64
+
65
+ Sometimes it won't be possible to merge a new feature into `next` or `master`
66
+ immediately. It may require longer-term work before it's complete, or we may not
67
+ want to release it as part of any alpha releases of the branch in question.
68
+ Branches like this are labeled `feature.#{name}` and stay on GitHub until
69
+ they're ready to be merged.
70
+
71
+ ### Experimental Branches
72
+
73
+ Not all features pan out, and not all code is a good fit for merging into the
74
+ main codebase. Usually when this happens the code is just discarded, but every
75
+ so often it's interesting or promising enough that it's worth keeping around.
76
+ This is what experimental branches (labeled `experimental.#{name}`) are for.
77
+ While they're not currently in use, they contain code that might be useful in
78
+ the future.
79
+
80
+ ### Old Stable Branches
81
+
82
+ Usually Sass doesn't have the development time to do long-term maintenance of
83
+ old release. But occasionally, very rarely, it becomes necessary. In cases like
84
+ that, a branch named `stable_#{version}` will be created, starting from the last
85
+ tag in that version series.
86
+
87
+ ## Versioning
88
+
89
+ Starting with version 3.5.0, Sass uses [semantic versioning](http://semver.org/)
90
+ to indicate the evolution of its language semantics as much as possible. This
91
+ means that patch releases (such as 3.5.3) contain only bug fixes, minor releases
92
+ (such as 3.6.0) contain backwards-compatible features, and only major releases
93
+ (such as 4.0.0) are allowed to have backwards-incompatible behavior. There are
94
+ [exceptions](#exceptional-breakages), but we try to follow this rule as closely
95
+ as possible.
96
+
97
+ Note, however, that the semantic versioning applies only to the language's
98
+ semantics, not to the Ruby APIs. Although we try hard to keep widely-used APIs
99
+ like [`Sass::Engine`][Sass::Engine] stable, we don't have a strong distinction
100
+ between public and private APIs and we need to be able to freely refactor our
101
+ code.
102
+
103
+ [Sass::Engine]: https://sass-lang.com/documentation/Sass/Engine.html
104
+
105
+ ### Making Breaking Changes
106
+
107
+ Sometimes the old way of doing something just isn't going to work anymore, and
108
+ the new way just can't be made backwards-compatible. In that case, a breaking
109
+ change is necessary. These changes are rarely pleasant, but they contribute to
110
+ making the language better in the long term.
111
+
112
+ Our breaking change process tries to make such changes as clear to users and as
113
+ easy to adapt to as possible. We want to ensure that there's a clear path
114
+ forward for users using functionality that will no longer exist, and that they
115
+ are able to understand what's changing and what they need to do. We've developed
116
+ the following process for this:
117
+
118
+ 1. Deprecate the old behavior [in `stable`](#branches). At minimum, deprecating
119
+ some behavior involves printing a warning when that behavior is used
120
+ explaining that it's going to go away in the future. Ideally, this message
121
+ will also include code that will do the same thing in a non-deprecated way.
122
+ If there's a thorough prose explanation of the change available online, the
123
+ message should link to that as well.
124
+
125
+ 2. If possible, make `sass-convert` (also in `stable`) convert the deprecated
126
+ behavior into a non-deprecated form. This allows users to run `sass-convert
127
+ -R -i` to automatically update their stylesheets.
128
+
129
+ 3. Implement the new behavior in `master`. The sooner this happens, the better:
130
+ it may be unclear exactly what needs to be deprecated until the new
131
+ implementation exists.
132
+
133
+ 4. Release an alpha version of `master` that includes the new behavior. This
134
+ allows users who are dissatisfied with the workaround to use the new
135
+ behavior early. Normally a maintainer will take care of this.
136
+
137
+ ### Exceptional Breakages
138
+
139
+ Because Sass's syntax and semantics are closely tied to those of CSS, there are
140
+ occasionally times when CSS syntax is introduced that overlaps with
141
+ previously-valid Sass. In this case in particular, we may introduce a breaking
142
+ change in a minor version to get back to CSS compatibility as soon as possible.
143
+
144
+ Exceptional breakages still require the full deprecation process; the only
145
+ change is that the new behavior is implemented in `next` rather than `master`.
146
+ Because there are no minor releases between the deprecation and the removal of
147
+ the old behavior, the deprecation warning should be introduced soon as it
148
+ becomes clear that an exceptional breakage is necessary.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006-2016 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,242 @@
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
+ ## Requirements
10
+
11
+ - **Ruby**: >= 3.0.0 (recommended: Ruby 3.1.2+)
12
+ - **Bundler**: For dependency management
13
+
14
+ This project has been updated for compatibility with modern Ruby versions.
15
+
16
+ # 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)
17
+
18
+ **Sass makes CSS fun again**. Sass is an extension of CSS,
19
+ adding nested rules, variables, mixins, selector inheritance, and more.
20
+ It's translated to well-formatted, standard CSS
21
+ using the command line tool or a web-framework plugin.
22
+
23
+ Sass has two syntaxes. The new main syntax (as of Sass 3)
24
+ is known as "SCSS" (for "Sassy CSS"),
25
+ and is a superset of CSS's syntax.
26
+ This means that every valid CSS stylesheet is valid SCSS as well.
27
+ SCSS files use the extension `.scss`.
28
+
29
+ The second, older syntax is known as the indented syntax (or just "Sass").
30
+ Inspired by Haml's terseness, it's intended for people
31
+ who prefer conciseness over similarity to CSS.
32
+ Instead of brackets and semicolons,
33
+ it uses the indentation of lines to specify blocks.
34
+ Although no longer the primary syntax,
35
+ the indented syntax will continue to be supported.
36
+ Files in the indented syntax use the extension `.sass`.
37
+
38
+ ## Using
39
+
40
+ Sass can be used from the command line
41
+ or as part of a web framework.
42
+ The first step is to install the gem:
43
+
44
+ gem install sass
45
+
46
+ After you convert some CSS to Sass, you can run
47
+
48
+ sass style.scss
49
+
50
+ to compile it back to CSS.
51
+ For more information on these commands, check out
52
+
53
+ sass --help
54
+
55
+ To install Sass in Rails 2,
56
+ just add `config.gem "sass"` to `config/environment.rb`.
57
+ In Rails 3, add `gem "sass"` to your Gemfile instead.
58
+ `.sass` or `.scss` files should be placed in `public/stylesheets/sass`,
59
+ where they'll be automatically compiled
60
+ to corresponding CSS files in `public/stylesheets` when needed
61
+ (the Sass template directory is customizable...
62
+ see [the Sass reference](https://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
63
+
64
+ Sass can also be used with any Rack-enabled web framework.
65
+ To do so, just add
66
+
67
+ ```ruby
68
+ require 'sass/plugin/rack'
69
+ use Sass::Plugin::Rack
70
+ ```
71
+
72
+ to `config.ru`.
73
+ Then any Sass files in `public/stylesheets/sass`
74
+ will be compiled into CSS files in `public/stylesheets` on every request.
75
+
76
+ To use Sass programmatically,
77
+ check out the [YARD documentation](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
78
+
79
+ ## Formatting
80
+
81
+ Sass is an extension of CSS
82
+ that adds power and elegance to the basic language.
83
+ It allows you to use [variables][vars], [nested rules][nested],
84
+ [mixins][mixins], [inline imports][imports],
85
+ and more, all with a fully CSS-compatible syntax.
86
+ Sass helps keep large stylesheets well-organized,
87
+ and get small stylesheets up and running quickly,
88
+ particularly with the help of
89
+ [the Compass style library](http://compass-style.org).
90
+
91
+ [vars]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
92
+ [nested]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
93
+ [mixins]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
94
+ [imports]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
95
+
96
+ Sass has two syntaxes.
97
+ The one presented here, known as "SCSS" (for "Sassy CSS"),
98
+ is fully CSS-compatible.
99
+ The other (older) syntax, known as the indented syntax or just "Sass",
100
+ is whitespace-sensitive and indentation-based.
101
+ For more information, see the [reference documentation][syntax].
102
+
103
+ [syntax]: https://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
104
+
105
+ To run the following examples and see the CSS they produce,
106
+ put them in a file called `test.scss` and run `sass test.scss`.
107
+
108
+ ### Nesting
109
+
110
+ Sass avoids repetition by nesting selectors within one another.
111
+ The same thing works for properties.
112
+
113
+ ```scss
114
+ table.hl {
115
+ margin: 2em 0;
116
+ td.ln { text-align: right; }
117
+ }
118
+
119
+ li {
120
+ font: {
121
+ family: serif;
122
+ weight: bold;
123
+ size: 1.2em;
124
+ }
125
+ }
126
+ ```
127
+
128
+ ### Variables
129
+
130
+ Use the same color all over the place?
131
+ Need to do some math with height and width and text size?
132
+ Sass supports variables, math operations, and many useful functions.
133
+
134
+ ```scss
135
+ $blue: #3bbfce;
136
+ $margin: 16px;
137
+
138
+ .content_navigation {
139
+ border-color: $blue;
140
+ color: darken($blue, 10%);
141
+ }
142
+
143
+ .border {
144
+ padding: $margin / 2;
145
+ margin: $margin / 2;
146
+ border-color: $blue;
147
+ }
148
+ ```
149
+
150
+ ### Mixins
151
+
152
+ Even more powerful than variables,
153
+ mixins allow you to re-use whole chunks of CSS,
154
+ properties or selectors.
155
+ You can even give them arguments.
156
+
157
+ ```scss
158
+ @mixin table-scaffolding {
159
+ th {
160
+ text-align: center;
161
+ font-weight: bold;
162
+ }
163
+ td, th { padding: 2px; }
164
+ }
165
+
166
+ @mixin left($dist) {
167
+ float: left;
168
+ margin-left: $dist;
169
+ }
170
+
171
+ #data {
172
+ @include left(10px);
173
+ @include table-scaffolding;
174
+ }
175
+ ```
176
+
177
+ A comprehensive list of features is available
178
+ in the [Sass reference](https://sass-lang.com/documentation/file.SASS_REFERENCE.html).
179
+
180
+ ## Executables
181
+
182
+ The Sass gem includes several executables that are useful
183
+ for dealing with Sass from the command line.
184
+
185
+ ### `sass`
186
+
187
+ The `sass` executable transforms a source Sass file into CSS.
188
+ See `sass --help` for further information and options.
189
+
190
+ ### `sass-convert`
191
+
192
+ The `sass-convert` executable converts between CSS, Sass, and SCSS.
193
+ When converting from CSS to Sass or SCSS,
194
+ nesting is applied where appropriate.
195
+ See `sass-convert --help` for further information and options.
196
+
197
+ ### Running locally
198
+
199
+ To run the Sass executables from a source checkout instead of from rubygems:
200
+
201
+ ```
202
+ $ cd sass
203
+ $ bundle
204
+ $ bundle exec sass ...
205
+ $ bundle exec scss ...
206
+ $ bundle exec sass-convert ...
207
+ ```
208
+
209
+ ## Authors
210
+
211
+ Sass was envisioned by [Hampton Catlin](http://www.hamptoncatlin.com)
212
+ (@hcatlin). However, Hampton doesn't even know his way around the code anymore
213
+ and now occasionally consults on the language issues. Hampton lives in San
214
+ Francisco, California and works as VP of Technology
215
+ at [Moovweb](http://www.moovweb.com/).
216
+
217
+ [Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and
218
+ architect of Sass. Her hard work has kept the project alive by endlessly
219
+ answering forum posts, fixing bugs, refactoring, finding speed improvements,
220
+ writing documentation, implementing new features, and designing the language.
221
+ Natalie lives in Seattle, Washington and works on [Dart](http://dartlang.org)
222
+ application libraries at Google.
223
+
224
+ [Chris Eppstein](http://twitter.com/chriseppstein) is a core contributor to
225
+ Sass and the creator of [Compass](http://compass-style.org/), the first Sass-based framework, and
226
+ [Eyeglass](http://github.com/sass-eyeglass/eyeglass), a node-sass plugin ecosystem for NPM. Chris focuses
227
+ on making Sass more powerful, easy to use, and on ways to speed its adoption
228
+ through the web development community. Chris lives in San Jose, California with
229
+ his wife and two children. He is an Engineer for
230
+ [LinkedIn.com](http://linkedin.com), where his primary responsibility is to
231
+ maintain Sass and many other Sass-related open source projects.
232
+
233
+ If you use this software, we'd be truly honored if you'd make a
234
+ tax-deductible donation to a non-profit organization and then
235
+ [let us know on twitter](http://twitter.com/SassCSS), so that we can
236
+ thank you. Here's a few that we endorse:
237
+
238
+ * [Trans Justice Funding Project](http://www.transjusticefundingproject.org/)
239
+ * [United Mitochondrial Disease Foundation](http://umdf.org/compass)
240
+ * [Girl Develop It](https://www.girldevelopit.com/donate)
241
+
242
+ Sass is licensed under the MIT License.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 4.0.0
data/VERSION_NAME ADDED
@@ -0,0 +1 @@
1
+ Bleeding Edge
data/bin/sass ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # The command line Sass parser.
3
+
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
10
+ require 'sass/exec'
11
+
12
+ opts = Sass::Exec::SassScss.new(ARGV, :sass)
13
+ opts.parse!
data/bin/sass-convert ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
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
9
+ require 'sass/exec'
10
+
11
+ opts = Sass::Exec::SassConvert.new(ARGV)
12
+ opts.parse!
data/bin/scss ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # The command line Sass parser.
3
+
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
10
+ require 'sass/exec'
11
+
12
+ opts = Sass::Exec::SassScss.new(ARGV, :scss)
13
+ opts.parse!
@@ -0,0 +1,40 @@
1
+ #!/bin/bash -e
2
+ # Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
3
+ # license that can be found in the LICENSE file or at
4
+ # https://opensource.org/licenses/MIT.
5
+
6
+ # Echoes the sass-spec Git ref that should be checked out for the current Travis
7
+ # run. If we're running specs for a pull request which refers to a sass-spec
8
+ # pull request, we'll run against the latter rather than sass-spec master.
9
+
10
+ default=master
11
+
12
+ if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
13
+ >&2 echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST."
14
+ >&2 echo "Ref: $default."
15
+ echo "$default"
16
+ exit 0
17
+ fi
18
+
19
+ >&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..."
20
+
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"
30
+
31
+ RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
32
+
33
+ if [[ $JSON =~ $RE_SPEC_PR ]]; then
34
+ ref="pull/${BASH_REMATCH[2]}/head"
35
+ >&2 echo "Ref: $ref."
36
+ echo "$ref"
37
+ else
38
+ >&2 echo "Ref: $default."
39
+ echo "$default"
40
+ fi
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+ require 'sinatra'
3
+ require 'json'
4
+ set :port, 3124
5
+ set :environment, :production
6
+ enable :lock
7
+ Dir.chdir(File.dirname(__FILE__) + "/..")
8
+
9
+ post "/" do
10
+ puts "Received payload!"
11
+ puts "Rev: #{`git name-rev HEAD`.strip}"
12
+ system %{rake handle_update --trace REF=#{JSON.parse(params["payload"])["ref"].inspect}}
13
+ end
data/init.rb ADDED
@@ -0,0 +1,18 @@
1
+ begin
2
+ require File.join(File.dirname(__FILE__), 'lib', 'sass') # From here
3
+ rescue LoadError
4
+ begin
5
+ require 'sass' # From gem
6
+ rescue LoadError => e
7
+ # gems:install may be run to install Haml with the skeleton plugin
8
+ # but not the gem itself installed.
9
+ # Don't die if this is the case.
10
+ raise e unless defined?(Rake) &&
11
+ (Rake.application.top_level_tasks.include?('gems') ||
12
+ Rake.application.top_level_tasks.include?('gems:install'))
13
+ end
14
+ end
15
+
16
+ # Load Sass.
17
+ # Sass may be undefined if we're running gems:install.
18
+ require 'sass/plugin' if defined?(Sass)
@@ -0,0 +1,88 @@
1
+ module Sass
2
+ module CacheStores
3
+ # An abstract base class for backends for the Sass cache.
4
+ # Any key-value store can act as such a backend;
5
+ # it just needs to implement the
6
+ # \{#_store} and \{#_retrieve} methods.
7
+ #
8
+ # To use a cache store with Sass,
9
+ # use the {file:SASS_REFERENCE.md#cache_store-option `:cache_store` option}.
10
+ #
11
+ # @abstract
12
+ class Base
13
+ # Store cached contents for later retrieval
14
+ # Must be implemented by all CacheStore subclasses
15
+ #
16
+ # Note: cache contents contain binary data.
17
+ #
18
+ # @param key [String] The key to store the contents under
19
+ # @param version [String] The current sass version.
20
+ # Cached contents must not be retrieved across different versions of sass.
21
+ # @param sha [String] The sha of the sass source.
22
+ # Cached contents must not be retrieved if the sha has changed.
23
+ # @param contents [String] The contents to store.
24
+ def _store(key, version, sha, contents)
25
+ raise "#{self.class} must implement #_store."
26
+ end
27
+
28
+ # Retrieved cached contents.
29
+ # Must be implemented by all subclasses.
30
+ #
31
+ # Note: if the key exists but the sha or version have changed,
32
+ # then the key may be deleted by the cache store, if it wants to do so.
33
+ #
34
+ # @param key [String] The key to retrieve
35
+ # @param version [String] The current sass version.
36
+ # Cached contents must not be retrieved across different versions of sass.
37
+ # @param sha [String] The sha of the sass source.
38
+ # Cached contents must not be retrieved if the sha has changed.
39
+ # @return [String] The contents that were previously stored.
40
+ # @return [NilClass] when the cache key is not found or the version or sha have changed.
41
+ def _retrieve(key, version, sha)
42
+ raise "#{self.class} must implement #_retrieve."
43
+ end
44
+
45
+ # Store a {Sass::Tree::RootNode}.
46
+ #
47
+ # @param key [String] The key to store it under.
48
+ # @param sha [String] The checksum for the contents that are being stored.
49
+ # @param root [Object] The root node to cache.
50
+ def store(key, sha, root)
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
55
+ end
56
+
57
+ # Retrieve a {Sass::Tree::RootNode}.
58
+ #
59
+ # @param key [String] The key the root element was stored under.
60
+ # @param sha [String] The checksum of the root element's content.
61
+ # @return [Object] The cached object.
62
+ def retrieve(key, sha)
63
+ contents = _retrieve(key, Sass::VERSION, sha)
64
+ Marshal.load(contents) if contents
65
+ rescue EOFError, TypeError, ArgumentError, LoadError => e
66
+ Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
67
+ nil
68
+ end
69
+
70
+ # Return the key for the sass file.
71
+ #
72
+ # The `(sass_dirname, sass_basename)` pair
73
+ # should uniquely identify the Sass document,
74
+ # but otherwise there are no restrictions on their content.
75
+ #
76
+ # @param sass_dirname [String]
77
+ # The fully-expanded location of the Sass file.
78
+ # This corresponds to the directory name on a filesystem.
79
+ # @param sass_basename [String] The name of the Sass file that is being referenced.
80
+ # This corresponds to the basename on a filesystem.
81
+ def key(sass_dirname, sass_basename)
82
+ dir = Digest::SHA1.hexdigest(sass_dirname)
83
+ filename = "#{sass_basename}c"
84
+ "#{dir}/#{filename}"
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,34 @@
1
+ module Sass
2
+ module CacheStores
3
+ # A meta-cache that chains multiple caches together.
4
+ # Specifically:
5
+ #
6
+ # * All `#store`s are passed to all caches.
7
+ # * `#retrieve`s are passed to each cache until one has a hit.
8
+ # * When one cache has a hit, the value is `#store`d in all earlier caches.
9
+ class Chain < Base
10
+ # Create a new cache chaining the given caches.
11
+ #
12
+ # @param caches [Array<Sass::CacheStores::Base>] The caches to chain.
13
+ def initialize(*caches)
14
+ @caches = caches
15
+ end
16
+
17
+ # @see Base#store
18
+ def store(key, sha, obj)
19
+ @caches.each {|c| c.store(key, sha, obj)}
20
+ end
21
+
22
+ # @see Base#retrieve
23
+ def retrieve(key, sha)
24
+ @caches.each_with_index do |c, i|
25
+ obj = c.retrieve(key, sha)
26
+ next unless obj
27
+ @caches[0...i].each {|prev| prev.store(key, sha, obj)}
28
+ return obj
29
+ end
30
+ nil
31
+ end
32
+ end
33
+ end
34
+ end