sass 3.5.0.pre.rc.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/README.md +1 -1
- data/Rakefile +40 -11
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/extra/sass-spec-ref.sh +32 -0
- data/lib/sass.rb +3 -3
- data/lib/sass/css.rb +1 -1
- data/lib/sass/deprecation.rb +55 -0
- data/lib/sass/engine.rb +16 -12
- data/lib/sass/environment.rb +1 -1
- data/lib/sass/error.rb +3 -3
- data/lib/sass/exec/base.rb +1 -1
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +1 -1
- data/lib/sass/plugin/configuration.rb +2 -2
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/functions.rb +23 -22
- data/lib/sass/script/lexer.rb +17 -8
- data/lib/sass/script/parser.rb +8 -7
- data/lib/sass/script/tree/node.rb +2 -2
- data/lib/sass/script/tree/operation.rb +43 -16
- data/lib/sass/script/value/base.rb +3 -3
- data/lib/sass/script/value/color.rb +15 -10
- data/lib/sass/script/value/helpers.rb +13 -2
- data/lib/sass/script/value/list.rb +2 -2
- data/lib/sass/script/value/number.rb +4 -4
- data/lib/sass/script/value/string.rb +5 -12
- data/lib/sass/scss/parser.rb +7 -4
- data/lib/sass/scss/rx.rb +1 -1
- data/lib/sass/scss/static_parser.rb +12 -24
- data/lib/sass/selector/abstract_sequence.rb +12 -11
- data/lib/sass/selector/comma_sequence.rb +18 -3
- data/lib/sass/selector/pseudo.rb +15 -2
- data/lib/sass/selector/sequence.rb +9 -7
- data/lib/sass/selector/simple.rb +5 -4
- data/lib/sass/selector/simple_sequence.rb +7 -3
- data/lib/sass/shared.rb +5 -3
- data/lib/sass/source/map.rb +2 -2
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/node.rb +3 -3
- data/lib/sass/tree/prop_node.rb +1 -1
- data/lib/sass/tree/rule_node.rb +15 -6
- data/lib/sass/tree/visitors/cssize.rb +3 -5
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/extend.rb +2 -8
- data/lib/sass/tree/visitors/perform.rb +3 -2
- data/lib/sass/tree/visitors/to_css.rb +3 -3
- data/lib/sass/util.rb +32 -5
- data/lib/sass/version.rb +2 -4
- data/test/sass/cache_test.rb +0 -1
- data/test/sass/callbacks_test.rb +0 -1
- data/test/sass/compiler_test.rb +0 -1
- data/test/sass/conversion_test.rb +3 -4
- data/test/sass/css2sass_test.rb +1 -2
- data/test/sass/css_variable_test.rb +0 -1
- data/test/sass/encoding_test.rb +0 -1
- data/test/sass/engine_test.rb +63 -60
- data/test/sass/exec_test.rb +0 -1
- data/test/sass/extend_test.rb +40 -81
- data/test/sass/functions_test.rb +8 -6
- data/test/sass/importer_test.rb +0 -1
- data/test/sass/logger_test.rb +0 -1
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +3 -4
- data/test/sass/results/script.css +1 -1
- data/test/sass/results/units.css +2 -2
- data/test/sass/script_conversion_test.rb +1 -2
- data/test/sass/script_test.rb +55 -47
- data/test/sass/scss/css_test.rb +2 -3
- data/test/sass/scss/rx_test.rb +0 -1
- data/test/sass/scss/scss_test.rb +26 -12
- data/test/sass/source_map_test.rb +13 -14
- data/test/sass/superselector_test.rb +0 -1
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +10 -3
- data/test/sass/util/normalized_map_test.rb +0 -1
- data/test/sass/util/subset_map_test.rb +0 -1
- data/test/sass/util_test.rb +4 -3
- data/test/sass/value_helpers_test.rb +0 -1
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62b8871bca68353a37c0dc60b2cfeb65ee14eb8d
|
4
|
+
data.tar.gz: 901579162ee8f9f1490124807d81b8a79e9955b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c07e35a2c6f913e2a5041439b7886ba02d071af3da200e0eca1cc8a8a2c2b38edf4f9ffb2cd7b45757b2d611fdbec4189820cd3368f25adc782da4c7479b24
|
7
|
+
data.tar.gz: 5f2967d0a40103afdf2209af7c8fac2eccf065fccb536f864ad89369547f87db5c1b204ffd37da03e8a9bc7bad994abb77a3d1d42890a25c1ba111a39a18bf4c
|
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Sass [![Gem Version](https://badge.fury.io/rb/sass.
|
1
|
+
# Sass [![Travis Build Status](https://travis-ci.org/sass/sass.svg?branch=next)](https://travis-ci.org/sass/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
2
|
|
3
3
|
**Sass makes CSS fun again**. Sass is an extension of CSS,
|
4
4
|
adding nested rules, variables, mixins, selector inheritance, and more.
|
data/Rakefile
CHANGED
@@ -12,8 +12,42 @@ task :default => :test
|
|
12
12
|
|
13
13
|
require 'rake/testtask'
|
14
14
|
|
15
|
+
LINE_SIZE = 80
|
16
|
+
DECORATION_CHAR = '#'
|
17
|
+
|
18
|
+
def print_header(string)
|
19
|
+
length = string.length
|
20
|
+
puts DECORATION_CHAR * LINE_SIZE
|
21
|
+
puts string.center(length + 2, ' ').center(LINE_SIZE, DECORATION_CHAR)
|
22
|
+
puts DECORATION_CHAR * LINE_SIZE
|
23
|
+
end
|
24
|
+
|
15
25
|
desc "Run all tests"
|
16
|
-
task :test
|
26
|
+
task :test do
|
27
|
+
test_cases = [
|
28
|
+
{
|
29
|
+
'env' => {'MATHN' => 'true'},
|
30
|
+
'tasks' => ['test:ruby', 'test:spec', :rubocop]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
'env' => {'MATHN' => 'false'},
|
34
|
+
'tasks' => ['test:ruby']
|
35
|
+
}
|
36
|
+
]
|
37
|
+
|
38
|
+
test_cases.each do |test_case|
|
39
|
+
env = test_case['env']
|
40
|
+
tasks = test_case['tasks']
|
41
|
+
|
42
|
+
env.each do |key, value|
|
43
|
+
ENV[key] = value
|
44
|
+
end
|
45
|
+
tasks.each do |task|
|
46
|
+
print_header("Running task: #{task}, env: #{env}")
|
47
|
+
Rake::Task[task].execute
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
17
51
|
|
18
52
|
namespace :test do
|
19
53
|
desc "Run the ruby tests (without sass-spec)"
|
@@ -48,7 +82,7 @@ namespace :test do
|
|
48
82
|
end
|
49
83
|
default_options = {
|
50
84
|
:spec_directory => SassSpec::SPEC_DIR,
|
51
|
-
:engine_adapter => SassEngineAdapter.new
|
85
|
+
:engine_adapter => SassEngineAdapter.new,
|
52
86
|
:generate => false,
|
53
87
|
:tap => false,
|
54
88
|
:skip => false,
|
@@ -76,25 +110,20 @@ def ruby_version_at_least?(version_string)
|
|
76
110
|
ruby_version >= version
|
77
111
|
end
|
78
112
|
|
79
|
-
|
80
|
-
(ENV.has_key?("RUBOCOP") && ENV["RUBOCOP"] == "true" ||
|
81
|
-
!(ENV.has_key?("RUBOCOP") || ENV.has_key?("TEST")))
|
113
|
+
begin
|
82
114
|
require 'rubocop/rake_task'
|
83
115
|
RuboCop = Rubocop unless defined?(RuboCop)
|
84
116
|
RuboCop::RakeTask.new do |t|
|
85
117
|
t.patterns = FileList["lib/**/*"]
|
86
118
|
end
|
87
|
-
|
119
|
+
rescue LoadError
|
88
120
|
task :rubocop do
|
89
|
-
puts "
|
90
|
-
next if ENV.has_key?("RUBOCOP") && ENV["RUBOCOP"] != "true"
|
121
|
+
puts "Rubocop is disabled."
|
91
122
|
puts "Passing this check is required in order for your patch to be accepted."
|
92
|
-
puts "
|
123
|
+
puts "Install Rubocop and then run the style check with: rake rubocop."
|
93
124
|
end
|
94
125
|
end
|
95
126
|
|
96
|
-
task :test => :rubocop
|
97
|
-
|
98
127
|
# ----- Packaging -----
|
99
128
|
|
100
129
|
# Don't use Rake::GemPackageTast because we want prerequisites to run
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.5.0
|
1
|
+
3.5.0
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
12 July 2017 23:31:42 UTC
|
@@ -0,0 +1,32 @@
|
|
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
|
+
JSON=$(curl -L -sS https://api.github.com/repos/sass/sass/pulls/$TRAVIS_PULL_REQUEST)
|
22
|
+
|
23
|
+
RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
|
24
|
+
|
25
|
+
if [[ $JSON =~ $RE_SPEC_PR ]]; then
|
26
|
+
ref="pull/${BASH_REMATCH[2]}/head"
|
27
|
+
>&2 echo "Ref: $ref."
|
28
|
+
echo "$ref"
|
29
|
+
else
|
30
|
+
>&2 echo "Ref: $default."
|
31
|
+
echo "$default"
|
32
|
+
fi
|
data/lib/sass.rb
CHANGED
@@ -47,7 +47,7 @@ module Sass
|
|
47
47
|
#
|
48
48
|
# @param contents [String] The contents of the Sass file.
|
49
49
|
# @param options [{Symbol => Object}] An options hash;
|
50
|
-
# see {file:SASS_REFERENCE.md#
|
50
|
+
# see {file:SASS_REFERENCE.md#Options the Sass options documentation}
|
51
51
|
# @raise [Sass::SyntaxError] if there's an error in the document
|
52
52
|
# @raise [Encoding::UndefinedConversionError] if the source encoding
|
53
53
|
# cannot be converted to UTF-8
|
@@ -69,7 +69,7 @@ module Sass
|
|
69
69
|
#
|
70
70
|
# @param filename [String] The path to the Sass, SCSS, or CSS file on disk.
|
71
71
|
# @param options [{Symbol => Object}] An options hash;
|
72
|
-
# see {file:SASS_REFERENCE.md#
|
72
|
+
# see {file:SASS_REFERENCE.md#Options the Sass options documentation}
|
73
73
|
# @return [String] The compiled CSS.
|
74
74
|
#
|
75
75
|
# @overload compile_file(filename, css_filename, options = {})
|
@@ -77,7 +77,7 @@ module Sass
|
|
77
77
|
#
|
78
78
|
# @param filename [String] The path to the Sass, SCSS, or CSS file on disk.
|
79
79
|
# @param options [{Symbol => Object}] An options hash;
|
80
|
-
# see {file:SASS_REFERENCE.md#
|
80
|
+
# see {file:SASS_REFERENCE.md#Options the Sass options documentation}
|
81
81
|
# @param css_filename [String] The location to which to write the compiled CSS.
|
82
82
|
def self.compile_file(filename, *args)
|
83
83
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
data/lib/sass/css.rb
CHANGED
@@ -18,7 +18,7 @@ module Sass
|
|
18
18
|
# that can be converted to Unicode.
|
19
19
|
# If the stylesheet contains an `@charset` declaration,
|
20
20
|
# that overrides the Ruby encoding
|
21
|
-
# (see {file:SASS_REFERENCE.md#
|
21
|
+
# (see {file:SASS_REFERENCE.md#Encodings the encoding documentation})
|
22
22
|
# @option options :old [Boolean] (false)
|
23
23
|
# Whether or not to output old property syntax
|
24
24
|
# (`:color blue` as opposed to `color: blue`).
|
@@ -0,0 +1,55 @@
|
|
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/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'set'
|
2
2
|
require 'digest/sha1'
|
3
3
|
require 'sass/cache_stores'
|
4
|
+
require 'sass/deprecation'
|
4
5
|
require 'sass/source/position'
|
5
6
|
require 'sass/source/range'
|
6
7
|
require 'sass/source/map'
|
@@ -95,18 +96,20 @@ module Sass
|
|
95
96
|
# output = sass_engine.render
|
96
97
|
# puts output
|
97
98
|
class Engine
|
99
|
+
@@old_property_deprecation = Deprecation.new
|
100
|
+
|
98
101
|
# A line of Sass code.
|
99
102
|
#
|
100
103
|
# `text`: `String`
|
101
104
|
# : The text in the line, without any whitespace at the beginning or end.
|
102
105
|
#
|
103
|
-
# `tabs`: `
|
106
|
+
# `tabs`: `Integer`
|
104
107
|
# : The level of indentation of the line.
|
105
108
|
#
|
106
|
-
# `index`: `
|
109
|
+
# `index`: `Integer`
|
107
110
|
# : The line number in the original document.
|
108
111
|
#
|
109
|
-
# `offset`: `
|
112
|
+
# `offset`: `Integer`
|
110
113
|
# : The number of bytes in on the line that the text begins.
|
111
114
|
# This ends up being the number of bytes of leading whitespace.
|
112
115
|
#
|
@@ -174,7 +177,7 @@ module Sass
|
|
174
177
|
# default values and resolving aliases.
|
175
178
|
#
|
176
179
|
# @param options [{Symbol => Object}] The options hash;
|
177
|
-
# see {file:SASS_REFERENCE.md#
|
180
|
+
# see {file:SASS_REFERENCE.md#Options the Sass options documentation}
|
178
181
|
# @return [{Symbol => Object}] The normalized options hash.
|
179
182
|
# @private
|
180
183
|
def self.normalize_options(options)
|
@@ -228,7 +231,7 @@ module Sass
|
|
228
231
|
#
|
229
232
|
# @param filename [String] The path to the Sass or SCSS file
|
230
233
|
# @param options [{Symbol => Object}] The options hash;
|
231
|
-
# See {file:SASS_REFERENCE.md#
|
234
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
232
235
|
# @return [Sass::Engine] The Engine for the given Sass or SCSS file.
|
233
236
|
# @raise [Sass::SyntaxError] if there's an error in the document.
|
234
237
|
def self.for_file(filename, options)
|
@@ -246,7 +249,7 @@ module Sass
|
|
246
249
|
end
|
247
250
|
|
248
251
|
# The options for the Sass engine.
|
249
|
-
# See {file:SASS_REFERENCE.md#
|
252
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
250
253
|
#
|
251
254
|
# @return [{Symbol => Object}]
|
252
255
|
attr_reader :options
|
@@ -263,9 +266,9 @@ module Sass
|
|
263
266
|
# that can be converted to Unicode.
|
264
267
|
# If the template contains an `@charset` declaration,
|
265
268
|
# that overrides the Ruby encoding
|
266
|
-
# (see {file:SASS_REFERENCE.md#
|
269
|
+
# (see {file:SASS_REFERENCE.md#Encodings the encoding documentation})
|
267
270
|
# @param options [{Symbol => Object}] An options hash.
|
268
|
-
# See {file:SASS_REFERENCE.md#
|
271
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
269
272
|
# @see {Sass::Engine.for_file}
|
270
273
|
# @see {Sass::Plugin}
|
271
274
|
def initialize(template, options = {})
|
@@ -522,10 +525,6 @@ MSG
|
|
522
525
|
nodes = []
|
523
526
|
while (line = arr[i]) && line.tabs >= base
|
524
527
|
if line.tabs > base
|
525
|
-
raise SyntaxError.new(
|
526
|
-
"The line was indented #{line.tabs - base} levels deeper than the previous line.",
|
527
|
-
:line => line.index) if line.tabs > base + 1
|
528
|
-
|
529
528
|
nodes.last.children, i = tree(arr, i)
|
530
529
|
else
|
531
530
|
nodes << line
|
@@ -630,6 +629,11 @@ WARNING
|
|
630
629
|
raise SyntaxError.new("Invalid property: \"#{line.text}\".",
|
631
630
|
:line => @line) if name.nil? || value.nil?
|
632
631
|
|
632
|
+
@@old_property_deprecation.warn(@options[:filename], @line, <<WARNING)
|
633
|
+
Old-style properties like "#{line.text}" are deprecated and will be an error in future versions of Sass.
|
634
|
+
Use "#{name}: #{value}" instead.
|
635
|
+
WARNING
|
636
|
+
|
633
637
|
value_start_offset = name_end_offset = name_start_offset + name.length
|
634
638
|
unless value.empty?
|
635
639
|
# +1 and -1 both compensate for the leading ':', which is part of line.text
|
data/lib/sass/environment.rb
CHANGED
@@ -81,7 +81,7 @@ module Sass
|
|
81
81
|
inherited_hash_reader :function
|
82
82
|
|
83
83
|
# @param options [{Symbol => Object}] The options hash. See
|
84
|
-
# {file:SASS_REFERENCE.md#
|
84
|
+
# {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
85
85
|
# @param parent [Environment] See \{#parent}
|
86
86
|
def initialize(parent = nil, options = nil)
|
87
87
|
@parent = parent
|
data/lib/sass/error.rb
CHANGED
@@ -69,14 +69,14 @@ module Sass
|
|
69
69
|
# The name of the mixin in which the error occurred.
|
70
70
|
# This could be `nil` if the error occurred outside a mixin.
|
71
71
|
#
|
72
|
-
# @return [
|
72
|
+
# @return [String]
|
73
73
|
def sass_mixin
|
74
74
|
sass_backtrace.first[:mixin]
|
75
75
|
end
|
76
76
|
|
77
77
|
# The line of the Sass template on which the error occurred.
|
78
78
|
#
|
79
|
-
# @return [
|
79
|
+
# @return [Integer]
|
80
80
|
def sass_line
|
81
81
|
sass_backtrace.first[:line]
|
82
82
|
end
|
@@ -153,7 +153,7 @@ module Sass
|
|
153
153
|
# Returns an error report for an exception in CSS format.
|
154
154
|
#
|
155
155
|
# @param e [Exception]
|
156
|
-
# @param line_offset [
|
156
|
+
# @param line_offset [Integer] The number of the first line of the Sass template.
|
157
157
|
# @return [String] The error report
|
158
158
|
# @raise [Exception] `e`, if the
|
159
159
|
# {file:SASS_REFERENCE.md#full_exception-option `:full_exception`} option
|
data/lib/sass/exec/base.rb
CHANGED
@@ -23,7 +23,7 @@ module Sass::Exec
|
|
23
23
|
# at_exit is a bit of a hack, but it allows us to rethrow when --trace
|
24
24
|
# is active and get both the built-in exception formatting and the
|
25
25
|
# correct exit code.
|
26
|
-
at_exit {exit 65} if e.is_a?(Sass::SyntaxError)
|
26
|
+
at_exit {exit Sass::Util.windows? ? 13 : 65} if e.is_a?(Sass::SyntaxError)
|
27
27
|
|
28
28
|
raise e if @options[:trace] || e.is_a?(SystemExit)
|
29
29
|
|
data/lib/sass/plugin.rb
CHANGED
@@ -12,7 +12,7 @@ module Sass
|
|
12
12
|
# when it's used as a plugin for various frameworks.
|
13
13
|
# All Rack-enabled frameworks are supported out of the box.
|
14
14
|
# The plugin is
|
15
|
-
# {file:SASS_REFERENCE.md#
|
15
|
+
# {file:SASS_REFERENCE.md#Rack_Rails_Merb_Plugin automatically activated for Rails and Merb}.
|
16
16
|
# Other frameworks must enable it explicitly; see {Sass::Plugin::Rack}.
|
17
17
|
#
|
18
18
|
# This module has a large set of callbacks available
|
data/lib/sass/plugin/compiler.rb
CHANGED
@@ -31,7 +31,7 @@ module Sass::Plugin
|
|
31
31
|
# Creates a new compiler.
|
32
32
|
#
|
33
33
|
# @param opts [{Symbol => Object}]
|
34
|
-
# See {file:SASS_REFERENCE.md#
|
34
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
35
35
|
def initialize(opts = {})
|
36
36
|
@watched_files = Set.new
|
37
37
|
options.merge!(opts)
|
@@ -26,8 +26,8 @@ module Sass
|
|
26
26
|
clear_callbacks!
|
27
27
|
end
|
28
28
|
|
29
|
-
# An options hash.
|
30
|
-
#
|
29
|
+
# An options hash. See {file:SASS_REFERENCE.md#Options the Sass options
|
30
|
+
# documentation}.
|
31
31
|
#
|
32
32
|
# @return [{Symbol => Object}]
|
33
33
|
def options
|
data/lib/sass/plugin/rack.rb
CHANGED
@@ -9,19 +9,19 @@ module Sass
|
|
9
9
|
#
|
10
10
|
# ## Customize
|
11
11
|
#
|
12
|
-
# Sass::Plugin.options.merge(
|
12
|
+
# Sass::Plugin.options.merge!(
|
13
13
|
# :cache_location => './tmp/sass-cache',
|
14
14
|
# :never_update => environment != :production,
|
15
15
|
# :full_exception => environment != :production)
|
16
16
|
#
|
17
|
-
# {file:SASS_REFERENCE.md#
|
17
|
+
# {file:SASS_REFERENCE.md#Options See the Reference for more options}.
|
18
18
|
#
|
19
19
|
# ## Use
|
20
20
|
#
|
21
21
|
# Put your Sass files in `public/stylesheets/sass`.
|
22
22
|
# Your CSS will be generated in `public/stylesheets`,
|
23
23
|
# and regenerated every request if necessary.
|
24
|
-
# The locations and frequency {file:SASS_REFERENCE.md#
|
24
|
+
# The locations and frequency {file:SASS_REFERENCE.md#Options can be customized}.
|
25
25
|
# That's all there is to it!
|
26
26
|
class Rack
|
27
27
|
# The delay, in seconds, between update checks.
|
@@ -39,7 +39,7 @@ module Sass
|
|
39
39
|
# for checking the staleness of several stylesheets at once.
|
40
40
|
#
|
41
41
|
# @param options [{Symbol => Object}]
|
42
|
-
# See {file:SASS_REFERENCE.md#
|
42
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
43
43
|
def initialize(options)
|
44
44
|
# URIs that are being actively checked for staleness. Protects against
|
45
45
|
# import loops.
|
@@ -72,7 +72,7 @@ module Sass
|
|
72
72
|
# Returns whether a Sass or SCSS stylesheet has been modified since a given time.
|
73
73
|
#
|
74
74
|
# @param template_file [String] The location of the Sass or SCSS template.
|
75
|
-
# @param mtime [
|
75
|
+
# @param mtime [Time] The modification time to check against.
|
76
76
|
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
|
77
77
|
# Defaults to the filesystem importer.
|
78
78
|
# @return [Boolean] Whether the stylesheet has been modified.
|
@@ -103,7 +103,7 @@ module Sass
|
|
103
103
|
# so it's better to use when checking multiple stylesheets at once.
|
104
104
|
#
|
105
105
|
# @param template_file [String] The location of the Sass or SCSS template.
|
106
|
-
# @param mtime [
|
106
|
+
# @param mtime [Time] The modification time to check against.
|
107
107
|
# @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
|
108
108
|
# Defaults to the filesystem importer.
|
109
109
|
# @return [Boolean] Whether the stylesheet has been modified.
|