sass-embedded 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/sass_embedded/extconf.rb +1 -1
- data/lib/sass.rb +8 -8
- data/lib/sass/embedded/compiler.rb +1 -1
- data/lib/sass/version.rb +1 -1
- data/test/compiler_test.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8152265aec1c4adf4ec89b826191a97f202b14bf86cf4093e679f8c24cd2d5af
|
4
|
+
data.tar.gz: 7b0d5d870ed38bf59562f617ad75cf2a3085704e0cc802989d21e15e9f14ee9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d037a1fe518298f2976d99d947544642325fa763315e539115422fb78b0f185d35f6c3b97cb97ec373ae04b70984f772f3915ec35974a450095e1f5f3366d88
|
7
|
+
data.tar.gz: 3844e6926954c302259f55a609e2e63a971c472580026ada05d13753dbebb4fb7bc4a13299c47b93a643b9fceaf742063e8a8b7b78f4ae541408eb4041e877b0
|
@@ -65,7 +65,7 @@ end
|
|
65
65
|
def download_protoc
|
66
66
|
repo = "protocolbuffers/protobuf"
|
67
67
|
|
68
|
-
tag = URI.open(
|
68
|
+
tag = URI.open("https://github.com/#{repo}/releases/latest") { |file|
|
69
69
|
File.basename file.base_uri.to_s
|
70
70
|
}
|
71
71
|
|
data/lib/sass.rb
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
module Sass
|
4
4
|
# The global include_paths for Sass files. This is meant for plugins and
|
5
5
|
# libraries to register the paths to their Sass stylesheets to that they may
|
6
|
-
# be `@imported`. This
|
7
|
-
# {Sass::Embedded::Compiler}. They are lower-precedence than any
|
8
|
-
# paths passed in via the `:
|
6
|
+
# be `@imported`. This include path is used by every instance of
|
7
|
+
# {Sass::Embedded::Compiler}. They are lower-precedence than any include
|
8
|
+
# paths passed in via the `:include_paths` option.
|
9
9
|
#
|
10
10
|
# If the `SASS_PATH` environment variable is set,
|
11
11
|
# the initial value of `include_paths` will be initialized based on that.
|
@@ -16,11 +16,11 @@ module Sass
|
|
16
16
|
# Sass.include_paths << File.dirname(__FILE__ + '/sass')
|
17
17
|
# @return [Array<String, Pathname>]
|
18
18
|
def self.include_paths
|
19
|
-
@
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
@include_paths ||= if ENV['SASS_PATH']
|
20
|
+
ENV['SASS_PATH'].split(File::PATH_SEPARATOR)
|
21
|
+
else
|
22
|
+
[]
|
23
|
+
end
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.render options
|
@@ -60,7 +60,7 @@ module Sass
|
|
60
60
|
importers = (options[:importer] ? [
|
61
61
|
Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new( :importer_id => 0 )
|
62
62
|
] : []).concat(
|
63
|
-
|
63
|
+
(options[:include_paths] || []).concat(Sass.include_paths)
|
64
64
|
.map { |path| Sass::EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
|
65
65
|
:path => File.absolute_path(path)
|
66
66
|
)}
|
data/lib/sass/version.rb
CHANGED
data/test/compiler_test.rb
CHANGED
@@ -163,14 +163,12 @@ SCSS
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def test_global_include_paths
|
166
|
-
skip 'race condition in test'
|
167
|
-
|
168
166
|
temp_dir("included_1")
|
169
167
|
temp_dir("included_2")
|
170
168
|
|
171
169
|
temp_file("included_1/import_parent.scss", "$s: 30px;")
|
172
|
-
temp_file("included_2/import.scss", "@use 'import_parent'
|
173
|
-
temp_file("styles.scss", "@use 'import.scss'
|
170
|
+
temp_file("included_2/import.scss", "@use 'import_parent' as *; $size: $s;")
|
171
|
+
temp_file("styles.scss", "@use 'import.scss' as *; .hi { width: $size; }")
|
174
172
|
|
175
173
|
::Sass.include_paths << "included_1"
|
176
174
|
::Sass.include_paths << "included_2"
|
@@ -179,12 +177,14 @@ SCSS
|
|
179
177
|
end
|
180
178
|
|
181
179
|
def test_env_include_paths
|
182
|
-
skip 'race condition in test'
|
183
|
-
|
184
180
|
expected_include_paths = [ "included_3", "included_4" ]
|
181
|
+
|
185
182
|
::Sass.instance_eval { @include_paths = nil }
|
183
|
+
|
186
184
|
ENV['SASS_PATH'] = expected_include_paths.join(File::PATH_SEPARATOR)
|
187
|
-
|
185
|
+
|
186
|
+
assert_equal expected_include_paths, Sass.include_paths
|
187
|
+
|
188
188
|
::Sass.include_paths.clear
|
189
189
|
end
|
190
190
|
|
@@ -192,8 +192,8 @@ SCSS
|
|
192
192
|
temp_dir("included_5")
|
193
193
|
temp_dir("included_6")
|
194
194
|
temp_file("included_5/import_parent.scss", "$s: 30px;")
|
195
|
-
temp_file("included_6/import.scss", "@use 'import_parent'
|
196
|
-
temp_file("styles.scss", "@use 'import.scss'
|
195
|
+
temp_file("included_6/import.scss", "@use 'import_parent' as *; $size: $s;")
|
196
|
+
temp_file("styles.scss", "@use 'import.scss' as *; .hi { width: $size; }")
|
197
197
|
|
198
198
|
assert_raises(CompilationError) do
|
199
199
|
render(File.read("styles.scss"))
|