sass 3.7.4 → 4.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.yardopts +1 -1
- data/CODE_OF_CONDUCT.md +1 -1
- data/CONTRIBUTING.md +1 -146
- data/MIT-LICENSE +1 -1
- data/README.md +25 -39
- data/Rakefile +274 -0
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass.rb +3 -3
- data/lib/sass/cache_stores/filesystem.rb +2 -2
- data/lib/sass/cache_stores/memory.rb +5 -4
- data/lib/sass/callbacks.rb +2 -2
- data/lib/sass/css.rb +12 -12
- data/lib/sass/engine.rb +44 -62
- data/lib/sass/environment.rb +7 -35
- data/lib/sass/error.rb +14 -14
- data/lib/sass/exec/base.rb +14 -3
- data/lib/sass/exec/sass_convert.rb +6 -20
- data/lib/sass/exec/sass_scss.rb +29 -5
- data/lib/sass/features.rb +2 -3
- data/lib/sass/importers/filesystem.rb +6 -11
- data/lib/sass/logger.rb +3 -8
- data/lib/sass/logger/base.rb +2 -19
- data/lib/sass/plugin.rb +2 -3
- data/lib/sass/plugin/compiler.rb +67 -48
- data/lib/sass/plugin/configuration.rb +3 -3
- data/lib/sass/plugin/merb.rb +1 -1
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/css_parser.rb +15 -5
- data/lib/sass/script/functions.rb +121 -337
- data/lib/sass/script/lexer.rb +36 -102
- data/lib/sass/script/parser.rb +153 -529
- data/lib/sass/script/tree/funcall.rb +34 -42
- data/lib/sass/script/tree/interpolation.rb +26 -171
- data/lib/sass/script/tree/list_literal.rb +8 -23
- data/lib/sass/script/tree/map_literal.rb +2 -2
- data/lib/sass/script/tree/node.rb +3 -3
- data/lib/sass/script/tree/operation.rb +16 -43
- data/lib/sass/script/tree/string_interpolation.rb +43 -64
- data/lib/sass/script/tree/variable.rb +1 -1
- data/lib/sass/script/value.rb +0 -2
- data/lib/sass/script/value/arg_list.rb +1 -1
- data/lib/sass/script/value/base.rb +9 -27
- data/lib/sass/script/value/color.rb +18 -26
- data/lib/sass/script/value/helpers.rb +18 -44
- data/lib/sass/script/value/list.rb +14 -35
- data/lib/sass/script/value/map.rb +2 -2
- data/lib/sass/script/value/number.rb +16 -26
- data/lib/sass/script/value/string.rb +1 -30
- data/lib/sass/scss.rb +2 -0
- data/lib/sass/scss/css_parser.rb +3 -7
- data/lib/sass/scss/parser.rb +78 -196
- data/lib/sass/scss/rx.rb +14 -7
- data/lib/sass/scss/script_lexer.rb +15 -0
- data/lib/sass/scss/script_parser.rb +25 -0
- data/lib/sass/scss/static_parser.rb +55 -38
- data/lib/sass/selector.rb +10 -7
- data/lib/sass/selector/abstract_sequence.rb +12 -15
- data/lib/sass/selector/comma_sequence.rb +6 -24
- data/lib/sass/selector/pseudo.rb +6 -19
- data/lib/sass/selector/sequence.rb +16 -14
- data/lib/sass/selector/simple.rb +7 -9
- data/lib/sass/selector/simple_sequence.rb +12 -16
- data/lib/sass/shared.rb +1 -1
- data/lib/sass/source/map.rb +9 -7
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +3 -23
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/function_node.rb +3 -2
- data/lib/sass/tree/node.rb +3 -5
- data/lib/sass/tree/prop_node.rb +58 -49
- data/lib/sass/tree/rule_node.rb +8 -15
- data/lib/sass/tree/visitors/check_nesting.rb +23 -19
- data/lib/sass/tree/visitors/convert.rb +13 -15
- data/lib/sass/tree/visitors/cssize.rb +15 -4
- data/lib/sass/tree/visitors/deep_copy.rb +2 -2
- data/lib/sass/tree/visitors/extend.rb +14 -10
- data/lib/sass/tree/visitors/perform.rb +18 -29
- data/lib/sass/tree/visitors/set_options.rb +2 -2
- data/lib/sass/tree/visitors/to_css.rb +47 -77
- data/lib/sass/util.rb +311 -98
- data/lib/sass/util/cross_platform_random.rb +19 -0
- data/lib/sass/util/multibyte_string_scanner.rb +133 -127
- data/lib/sass/util/normalized_map.rb +8 -1
- data/lib/sass/util/ordered_hash.rb +192 -0
- data/lib/sass/version.rb +6 -2
- data/test/sass/cache_test.rb +131 -0
- data/test/sass/callbacks_test.rb +61 -0
- data/test/sass/compiler_test.rb +236 -0
- data/test/sass/conversion_test.rb +2171 -0
- data/test/sass/css2sass_test.rb +526 -0
- data/test/sass/data/hsl-rgb.txt +319 -0
- data/test/sass/encoding_test.rb +219 -0
- data/test/sass/engine_test.rb +3400 -0
- data/test/sass/exec_test.rb +86 -0
- data/test/sass/extend_test.rb +1719 -0
- data/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/test/sass/functions_test.rb +1984 -0
- data/test/sass/importer_test.rb +421 -0
- data/test/sass/logger_test.rb +58 -0
- data/test/sass/mock_importer.rb +49 -0
- data/test/sass/more_results/more1.css +9 -0
- data/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/test/sass/more_results/more_import.css +29 -0
- data/test/sass/more_templates/_more_partial.sass +2 -0
- data/test/sass/more_templates/more1.sass +23 -0
- data/test/sass/more_templates/more_import.sass +11 -0
- data/test/sass/plugin_test.rb +556 -0
- data/test/sass/results/alt.css +4 -0
- data/test/sass/results/basic.css +9 -0
- data/test/sass/results/cached_import_option.css +3 -0
- data/test/sass/results/compact.css +5 -0
- data/test/sass/results/complex.css +86 -0
- data/test/sass/results/compressed.css +1 -0
- data/test/sass/results/expanded.css +19 -0
- data/test/sass/results/filename_fn.css +3 -0
- data/test/sass/results/if.css +3 -0
- data/test/sass/results/import.css +31 -0
- data/test/sass/results/import_charset.css +5 -0
- data/test/sass/results/import_charset_1_8.css +5 -0
- data/test/sass/results/import_charset_ibm866.css +5 -0
- data/test/sass/results/import_content.css +1 -0
- data/test/sass/results/line_numbers.css +49 -0
- data/test/sass/results/mixins.css +95 -0
- data/test/sass/results/multiline.css +24 -0
- data/test/sass/results/nested.css +22 -0
- data/test/sass/results/options.css +1 -0
- data/test/sass/results/parent_ref.css +13 -0
- data/test/sass/results/script.css +16 -0
- data/test/sass/results/scss_import.css +31 -0
- data/test/sass/results/scss_importee.css +2 -0
- data/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/test/sass/results/subdir/subdir.css +3 -0
- data/test/sass/results/units.css +11 -0
- data/test/sass/results/warn.css +0 -0
- data/test/sass/results/warn_imported.css +0 -0
- data/test/sass/script_conversion_test.rb +306 -0
- data/test/sass/script_test.rb +1206 -0
- data/test/sass/scss/css_test.rb +1281 -0
- data/test/sass/scss/rx_test.rb +160 -0
- data/test/sass/scss/scss_test.rb +4147 -0
- data/test/sass/scss/test_helper.rb +37 -0
- data/test/sass/source_map_test.rb +1055 -0
- data/test/sass/superselector_test.rb +210 -0
- data/test/sass/templates/_cached_import_option_partial.scss +1 -0
- data/test/sass/templates/_double_import_loop2.sass +1 -0
- data/test/sass/templates/_filename_fn_import.scss +11 -0
- data/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/test/sass/templates/_imported_content.sass +3 -0
- data/test/sass/templates/_partial.sass +2 -0
- data/test/sass/templates/_same_name_different_partiality.scss +1 -0
- data/test/sass/templates/alt.sass +16 -0
- data/test/sass/templates/basic.sass +23 -0
- data/test/sass/templates/bork1.sass +2 -0
- data/test/sass/templates/bork2.sass +2 -0
- data/test/sass/templates/bork3.sass +2 -0
- data/test/sass/templates/bork4.sass +2 -0
- data/test/sass/templates/bork5.sass +3 -0
- data/test/sass/templates/cached_import_option.scss +3 -0
- data/test/sass/templates/compact.sass +17 -0
- data/test/sass/templates/complex.sass +305 -0
- data/test/sass/templates/compressed.sass +15 -0
- data/test/sass/templates/double_import_loop1.sass +1 -0
- data/test/sass/templates/expanded.sass +17 -0
- data/test/sass/templates/filename_fn.scss +18 -0
- data/test/sass/templates/if.sass +11 -0
- data/test/sass/templates/import.sass +12 -0
- data/test/sass/templates/import_charset.sass +9 -0
- data/test/sass/templates/import_charset_1_8.sass +6 -0
- data/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/test/sass/templates/import_content.sass +4 -0
- data/test/sass/templates/importee.less +2 -0
- data/test/sass/templates/importee.sass +19 -0
- data/test/sass/templates/line_numbers.sass +13 -0
- data/test/sass/templates/mixin_bork.sass +5 -0
- data/test/sass/templates/mixins.sass +76 -0
- data/test/sass/templates/multiline.sass +20 -0
- data/test/sass/templates/nested.sass +25 -0
- data/test/sass/templates/nested_bork1.sass +2 -0
- data/test/sass/templates/nested_bork2.sass +2 -0
- data/test/sass/templates/nested_bork3.sass +2 -0
- data/test/sass/templates/nested_bork4.sass +2 -0
- data/test/sass/templates/nested_import.sass +2 -0
- data/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/test/sass/templates/options.sass +2 -0
- data/test/sass/templates/parent_ref.sass +25 -0
- data/test/sass/templates/same_name_different_ext.sass +2 -0
- data/test/sass/templates/same_name_different_ext.scss +1 -0
- data/test/sass/templates/same_name_different_partiality.scss +1 -0
- data/test/sass/templates/script.sass +101 -0
- data/test/sass/templates/scss_import.scss +12 -0
- data/test/sass/templates/scss_importee.scss +1 -0
- data/test/sass/templates/single_import_loop.sass +1 -0
- data/test/sass/templates/subdir/import_up1.scss +1 -0
- data/test/sass/templates/subdir/import_up2.scss +1 -0
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/test/sass/templates/subdir/subdir.sass +6 -0
- data/test/sass/templates/units.sass +11 -0
- data/test/sass/templates/warn.sass +3 -0
- data/test/sass/templates/warn_imported.sass +4 -0
- data/test/sass/test_helper.rb +8 -0
- data/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/test/sass/util/normalized_map_test.rb +51 -0
- data/test/sass/util/subset_map_test.rb +91 -0
- data/test/sass/util_test.rb +438 -0
- data/test/sass/value_helpers_test.rb +179 -0
- data/test/test_helper.rb +110 -0
- data/vendor/listen/CHANGELOG.md +1 -0
- data/vendor/listen/CONTRIBUTING.md +38 -0
- data/vendor/listen/Gemfile +20 -0
- data/vendor/listen/Guardfile +8 -0
- data/vendor/listen/LICENSE +20 -0
- data/vendor/listen/README.md +349 -0
- data/vendor/listen/Rakefile +5 -0
- data/vendor/listen/Vagrantfile +96 -0
- data/vendor/listen/lib/listen.rb +54 -0
- data/vendor/listen/lib/listen/adapter.rb +327 -0
- data/vendor/listen/lib/listen/adapters/bsd.rb +75 -0
- data/vendor/listen/lib/listen/adapters/darwin.rb +48 -0
- data/vendor/listen/lib/listen/adapters/linux.rb +81 -0
- data/vendor/listen/lib/listen/adapters/polling.rb +58 -0
- data/vendor/listen/lib/listen/adapters/windows.rb +91 -0
- data/vendor/listen/lib/listen/directory_record.rb +406 -0
- data/vendor/listen/lib/listen/listener.rb +323 -0
- data/vendor/listen/lib/listen/turnstile.rb +32 -0
- data/vendor/listen/lib/listen/version.rb +3 -0
- data/vendor/listen/listen.gemspec +28 -0
- data/vendor/listen/spec/listen/adapter_spec.rb +149 -0
- data/vendor/listen/spec/listen/adapters/bsd_spec.rb +36 -0
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +37 -0
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +47 -0
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +30 -0
- data/vendor/listen/spec/listen/directory_record_spec.rb +1250 -0
- data/vendor/listen/spec/listen/listener_spec.rb +258 -0
- data/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/vendor/listen/spec/listen_spec.rb +67 -0
- data/vendor/listen/spec/spec_helper.rb +25 -0
- data/vendor/listen/spec/support/adapter_helper.rb +666 -0
- data/vendor/listen/spec/support/directory_record_helper.rb +57 -0
- data/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/vendor/listen/spec/support/listeners_helper.rb +179 -0
- data/vendor/listen/spec/support/platform_helper.rb +15 -0
- metadata +217 -76
- data/extra/sass-spec-ref.sh +0 -40
- data/lib/sass/deprecation.rb +0 -55
- data/lib/sass/logger/delayed.rb +0 -50
- data/lib/sass/script/value/callable.rb +0 -25
- data/lib/sass/script/value/function.rb +0 -19
data/extra/sass-spec-ref.sh
DELETED
@@ -1,40 +0,0 @@
|
|
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
|
data/lib/sass/deprecation.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
# A deprecation warning that should only be printed once for a given line in a
|
3
|
-
# given file.
|
4
|
-
#
|
5
|
-
# A global Deprecation instance should be created for each type of deprecation
|
6
|
-
# warning, and `warn` should be called each time a warning is needed.
|
7
|
-
class Deprecation
|
8
|
-
@@allow_double_warnings = false
|
9
|
-
|
10
|
-
# Runs a block in which double deprecation warnings for the same location
|
11
|
-
# are allowed.
|
12
|
-
def self.allow_double_warnings
|
13
|
-
old_allow_double_warnings = @@allow_double_warnings
|
14
|
-
@@allow_double_warnings = true
|
15
|
-
yield
|
16
|
-
ensure
|
17
|
-
@@allow_double_warnings = old_allow_double_warnings
|
18
|
-
end
|
19
|
-
|
20
|
-
def initialize
|
21
|
-
# A set of filename, line pairs for which warnings have been emitted.
|
22
|
-
@seen = Set.new
|
23
|
-
end
|
24
|
-
|
25
|
-
# Prints `message` as a deprecation warning associated with `filename`,
|
26
|
-
# `line`, and optionally `column`.
|
27
|
-
#
|
28
|
-
# This ensures that only one message will be printed for each line of a
|
29
|
-
# given file.
|
30
|
-
#
|
31
|
-
# @overload warn(filename, line, message)
|
32
|
-
# @param filename [String, nil]
|
33
|
-
# @param line [Number]
|
34
|
-
# @param message [String]
|
35
|
-
# @overload warn(filename, line, column, message)
|
36
|
-
# @param filename [String, nil]
|
37
|
-
# @param line [Number]
|
38
|
-
# @param column [Number]
|
39
|
-
# @param message [String]
|
40
|
-
def warn(filename, line, column_or_message, message = nil)
|
41
|
-
return if !@@allow_double_warnings && @seen.add?([filename, line]).nil?
|
42
|
-
if message
|
43
|
-
column = column_or_message
|
44
|
-
else
|
45
|
-
message = column_or_message
|
46
|
-
end
|
47
|
-
|
48
|
-
location = "line #{line}"
|
49
|
-
location << ", column #{column}" if column
|
50
|
-
location << " of #{filename}" if filename
|
51
|
-
|
52
|
-
Sass::Util.sass_warn("DEPRECATION WARNING on #{location}:\n#{message}")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
data/lib/sass/logger/delayed.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'sass/logger/log_level'
|
2
|
-
|
3
|
-
# A logger that delays messages until they're explicitly flushed to an inner
|
4
|
-
# logger.
|
5
|
-
#
|
6
|
-
# This can be installed around the current logger by calling \{#install!}, and
|
7
|
-
# the original logger can be replaced by calling \{#uninstall!}. The log
|
8
|
-
# messages can be flushed by calling \{#flush}.
|
9
|
-
class Sass::Logger::Delayed < Sass::Logger::Base
|
10
|
-
# Installs a new delayed logger as the current Sass logger, wrapping the
|
11
|
-
# original logger.
|
12
|
-
#
|
13
|
-
# This can be undone by calling \{#uninstall!}.
|
14
|
-
#
|
15
|
-
# @return [Sass::Logger::Delayed] The newly-created logger.
|
16
|
-
def self.install!
|
17
|
-
logger = Sass::Logger::Delayed.new(Sass.logger)
|
18
|
-
Sass.logger = logger
|
19
|
-
logger
|
20
|
-
end
|
21
|
-
|
22
|
-
# Creates a delayed logger wrapping `inner`.
|
23
|
-
#
|
24
|
-
# @param inner [Sass::Logger::Base] The wrapped logger.
|
25
|
-
def initialize(inner)
|
26
|
-
self.log_level = inner.log_level
|
27
|
-
@inner = inner
|
28
|
-
@messages = []
|
29
|
-
end
|
30
|
-
|
31
|
-
# Flushes all queued logs to the wrapped logger.
|
32
|
-
def flush
|
33
|
-
@messages.each {|(l, m)| @inner.log(l, m)}
|
34
|
-
end
|
35
|
-
|
36
|
-
# Uninstalls this logger from \{Sass.logger\}. This should only be called if
|
37
|
-
# the logger was installed using \{#install!}
|
38
|
-
def uninstall!
|
39
|
-
if Sass.logger != self
|
40
|
-
throw Exception.new("Can't uninstall a logger that's not currently installed.")
|
41
|
-
end
|
42
|
-
|
43
|
-
@inner.log_level = log_level
|
44
|
-
Sass.logger = @inner
|
45
|
-
end
|
46
|
-
|
47
|
-
def _log(level, message)
|
48
|
-
@messages << [level, message]
|
49
|
-
end
|
50
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Sass::Script::Value
|
2
|
-
# A SassScript object representing a null value.
|
3
|
-
class Callable < Base
|
4
|
-
# Constructs a Callable value for use in SassScript.
|
5
|
-
#
|
6
|
-
# @param callable [Sass::Callable] The callable to be used when the
|
7
|
-
# callable is called.
|
8
|
-
def initialize(callable)
|
9
|
-
super(callable)
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_s(opts = {})
|
13
|
-
raise Sass::SyntaxError.new("#{to_sass} isn't a valid CSS value.")
|
14
|
-
end
|
15
|
-
|
16
|
-
def inspect
|
17
|
-
to_sass
|
18
|
-
end
|
19
|
-
|
20
|
-
# @abstract
|
21
|
-
def to_sass
|
22
|
-
Sass::Util.abstract(self)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Sass::Script::Value
|
2
|
-
# A SassScript object representing a function.
|
3
|
-
class Function < Callable
|
4
|
-
# Constructs a Function value for use in SassScript.
|
5
|
-
#
|
6
|
-
# @param function [Sass::Callable] The callable to be used when the
|
7
|
-
# function is invoked.
|
8
|
-
def initialize(function)
|
9
|
-
unless function.type == "function"
|
10
|
-
raise ArgumentError.new("A callable of type function was expected.")
|
11
|
-
end
|
12
|
-
super
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_sass
|
16
|
-
%{get-function("#{value.name}")}
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|