sassc 1.10.0 → 1.10.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b52db28344dd1103c3d9c82150b7670f31e040d6
4
- data.tar.gz: 0ce1622190528f513b5460017c4033da8932fb4d
3
+ metadata.gz: 9be0f0a939018b6002c548e4c5a4e62a2a5cd2d2
4
+ data.tar.gz: 6a4565b6ef56faf224e58d7a4b4976b820124f62
5
5
  SHA512:
6
- metadata.gz: ca2d6b6f548d6c73c419dc6ba94c3d0a20fbed1af6a95862a8ff3c68fb55e583c9a51f33b5122e353d6514d9998fad8a388131a9b74b3a9d06433eacae5461e6
7
- data.tar.gz: 06e7cb73e2e52f756aa0980c449b8f32d6f10c6be9a9e8a4e223d9f34603221e2859ae80a41eca0e9066e0d9e8cc0848ab259b0c03a0f20dd927542b50609d7a
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module SassC
2
- VERSION = "1.10.0"
2
+ VERSION = "1.10.1"
3
3
  end
@@ -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.0
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-06-22 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake