sassc 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/sassc/engine.rb +6 -0
- data/lib/sassc/version.rb +1 -1
- data/test/engine_test.rb +45 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be0f0a939018b6002c548e4c5a4e62a2a5cd2d2
|
4
|
+
data.tar.gz: 6a4565b6ef56faf224e58d7a4b4976b820124f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e8f1ca2ef3ae160f2a934ba97dd8d9f545a2310ed48a3b1670dca315b11d2b7b2cde987defb848c484944647144028dcad377eddf1d6668acfc8db67585b9f
|
7
|
+
data.tar.gz: 7ed0d484f040dc411e3995d0603670cb5ca488b081506d54c875f79d81929e59c4435b8d59370b751691832a5c55640322aabeed50b0c499b9647be68e5ecb92
|
data/README.md
CHANGED
@@ -49,6 +49,8 @@ and [awesome contributors](https://github.com/bolandrm/sassc-ruby/graphs/contrib
|
|
49
49
|
|
50
50
|
## Changelog
|
51
51
|
|
52
|
+
- **1.10.1**
|
53
|
+
- [Add sourcemap getter](https://github.com/sass/sassc-ruby/pull/48)
|
52
54
|
- **1.10.0**
|
53
55
|
- [Improved error messages](https://github.com/sass/sassc-ruby/pull/34)
|
54
56
|
- Update to Libsass 3.3.6
|
data/lib/sassc/engine.rb
CHANGED
@@ -49,6 +49,7 @@ module SassC
|
|
49
49
|
css = Native.context_get_output_string(context)
|
50
50
|
|
51
51
|
@dependencies = Native.context_get_included_files(context)
|
52
|
+
@source_map = Native.context_get_source_map_string(context)
|
52
53
|
|
53
54
|
Native.delete_data_context(data_context)
|
54
55
|
|
@@ -62,6 +63,11 @@ module SassC
|
|
62
63
|
Dependency.from_filenames(@dependencies)
|
63
64
|
end
|
64
65
|
|
66
|
+
def source_map
|
67
|
+
raise NotRenderedError unless @source_map
|
68
|
+
@source_map
|
69
|
+
end
|
70
|
+
|
65
71
|
def filename
|
66
72
|
@options[:filename]
|
67
73
|
end
|
data/lib/sassc/version.rb
CHANGED
data/test/engine_test.rb
CHANGED
@@ -121,6 +121,51 @@ CSS
|
|
121
121
|
assert_raises(NotRenderedError) { engine.dependencies }
|
122
122
|
end
|
123
123
|
|
124
|
+
def test_source_map
|
125
|
+
temp_dir('admin')
|
126
|
+
|
127
|
+
temp_file('admin/text-color.scss', <<SCSS)
|
128
|
+
p {
|
129
|
+
color: red;
|
130
|
+
}
|
131
|
+
SCSS
|
132
|
+
temp_file('style.scss', <<SCSS)
|
133
|
+
@import 'admin/text-color';
|
134
|
+
|
135
|
+
p {
|
136
|
+
padding: 20px;
|
137
|
+
}
|
138
|
+
SCSS
|
139
|
+
engine = Engine.new(File.read('style.scss'), {
|
140
|
+
source_map_file: "style.scss.map",
|
141
|
+
source_map_contents: true
|
142
|
+
})
|
143
|
+
engine.render
|
144
|
+
|
145
|
+
assert_equal <<MAP.strip, engine.source_map
|
146
|
+
{
|
147
|
+
\t"version": 3,
|
148
|
+
\t"file": "stdin.css",
|
149
|
+
\t"sources": [
|
150
|
+
\t\t"stdin",
|
151
|
+
\t\t"admin/text-color.scss"
|
152
|
+
\t],
|
153
|
+
\t"sourcesContent": [
|
154
|
+
\t\t"@import 'admin/text-color';\\n\\np {\\n padding: 20px;\\n}\\n",
|
155
|
+
\t\t"p {\\n color: red;\\n}\\n"
|
156
|
+
\t],
|
157
|
+
\t"mappings": "ACAA,AAAA,CAAC,CAAC;EACA,KAAK,EAAE,GAAI,GACZ;;ADAD,AAAA,CAAC,CAAC;EACA,OAAO,EAAE,IAAK,GACf",
|
158
|
+
\t"names": []
|
159
|
+
}
|
160
|
+
MAP
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_no_source_map
|
164
|
+
engine = Engine.new("$size: 30px;")
|
165
|
+
engine.render
|
166
|
+
assert_raises(NotRenderedError) { engine.source_map }
|
167
|
+
end
|
168
|
+
|
124
169
|
def test_load_paths
|
125
170
|
temp_dir("included_1")
|
126
171
|
temp_dir("included_2")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sassc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Boland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|