sass-embedded 0.6.7 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1b7d4e1bdfae2dbb2f99b43c42c0e06673a5f4f8c92b213efdfa4535a56b5b
4
- data.tar.gz: 23fe4aeaeab07ddf717e7f2fad75d3fc9d9c82db4f4606763e52df8450113f59
3
+ metadata.gz: af257f49189b3ea9e19c67fd67dba0cbf35d010c7a222e36fd820afee7eb3e10
4
+ data.tar.gz: a63caa77fc2a9793f5138896df09722aae680b85a11db50512da3281fba8fae7
5
5
  SHA512:
6
- metadata.gz: 13f8c565606af71bad343b5863ca3c792897d9a7bfea0071f17c510d99b6f0bf4d995441433572ba6aab2ca7489b9202c70fee3db4fc1c63fd15a5d4a5e8f593
7
- data.tar.gz: a9bcd6caf920377fd86aa94f1ef536582f41483e0b0fca252718995af25037162eb2e77ee61cf6fc8d761195c10da48ebbf6dcb48de0c723cf0d01d46de0c1c6
6
+ metadata.gz: 1b5e7ea087a76653e6e45ee2338eeb31224a85388b9ece793d90652176f50d77affb4816acccfa6c1dbe5ffb5221bebc3bd1d0a00dcade850e6413125c4d1fc6
7
+ data.tar.gz: 7de00d938497c9d447c396d69eb4d6907683097c3b897c77ead784a17f3fcc691f8a67ca99bc5fbf9e7ce268db5f443e31d65903e81c8acb966238760db1a35a
data/README.md CHANGED
@@ -22,7 +22,7 @@ Sass.render(file: "style.scss")
22
22
 
23
23
  ## Options
24
24
 
25
- `Sass.render()` support the following options:
25
+ `Sass.render(**kwargs)` supports the following options:
26
26
 
27
27
  - [`data`](https://sass-lang.com/documentation/js-api#data)
28
28
  - [`file`](https://sass-lang.com/documentation/js-api#file)
@@ -35,6 +35,7 @@ Sass.render(file: "style.scss")
35
35
  - [`source_map`](https://sass-lang.com/documentation/js-api#sourcemap)
36
36
  - [`out_file`](https://sass-lang.com/documentation/js-api#outfile)
37
37
  - [`omit_source_map_url`](https://sass-lang.com/documentation/js-api#omitsourcemapurl)
38
+ - [`source_map_contents`](https://sass-lang.com/documentation/js-api#sourcemapcontents)
38
39
  - [`source_map_embed`](https://sass-lang.com/documentation/js-api#sourcemapembed)
39
40
  - [`source_map_root`](https://sass-lang.com/documentation/js-api#sourcemaproot)
40
41
  - [`functions`](https://sass-lang.com/documentation/js-api#functions)
data/lib/sass/embedded.rb CHANGED
@@ -49,8 +49,6 @@ module Sass
49
49
  source_map_root: '',
50
50
  functions: {},
51
51
  importer: [])
52
- raise NotImplementedError, 'source_map_contents is not implemented' unless source_map_contents == false
53
-
54
52
  start = Util.now
55
53
 
56
54
  indent_type = parse_indent_type(indent_type)
@@ -89,6 +87,7 @@ module Sass
89
87
  file: file,
90
88
  out_file: out_file,
91
89
  source_map: source_map,
90
+ source_map_contents: source_map_contents,
92
91
  source_map_root: source_map_root)
93
92
 
94
93
  css = post_process_css(css: message.success.css,
@@ -122,6 +121,7 @@ module Sass
122
121
  file:,
123
122
  out_file:,
124
123
  source_map:,
124
+ source_map_contents:,
125
125
  source_map_root:)
126
126
  return if map.nil? || map.empty?
127
127
 
@@ -146,10 +146,15 @@ module Sass
146
146
  map_data['file'] = 'stdin.css'
147
147
  end
148
148
 
149
+ map_data['sourcesContent'] = [] if source_map_contents
150
+
149
151
  map_data['sources'].map! do |source|
150
152
  if source.start_with? Util::FILE_PROTOCOL
151
- Util.relative(source_map_dir, Util.path(source))
153
+ path = Util.path(source)
154
+ map_data['sourcesContent'].push(File.read(path)) if source_map_contents
155
+ Util.relative(source_map_dir, path)
152
156
  else
157
+ map_data['sourcesContent'].push(nil) if source_map_contents
153
158
  source
154
159
  end
155
160
  end
data/lib/sass/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sass
4
- VERSION = '0.6.7'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき