sassc-embedded 0.1.0 → 0.1.3

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: 01b39ff3df99a2a2c1d9e9aa76ad7d06462a0ba970c8ed907753dc094ac93f54
4
- data.tar.gz: aa75aa2ff62c0b50c48fd0c7594aadee3ff7180b215df76c9efbc7f3e4112ace
3
+ metadata.gz: 0520ad895979ec3c36838b7fdf5bac2430c923f873358606e49eb72f70776109
4
+ data.tar.gz: 2b60642cceca432904ad4f1cd0ab43f2501164e54a33e5e964758b80f29a3828
5
5
  SHA512:
6
- metadata.gz: 9eec5413a5ef0da29d752c421889cb0f4bf278f10a48ca7a0ffdd002d7217f04f99d3553dbdf9396077c23e66ed24d5baa7005bb6a7a324f094533300a2d9d20
7
- data.tar.gz: 59348aae444404fba124bc4717ac51f8433739f5ff6c26ab394b3191483ccc5aa67ffb5df917a3c0643c5ca2fd93da1ab563c8c460fd6c27083e04c1aaeb1551
6
+ metadata.gz: 873f6c9d78221ad59c2e34f46d384496967e83480878a8e2db71de7166f2d6ec46ab960ca64f010ce7002736bfd6cea0b3a4b57f8eb7c7d020b655a77e132ba6
7
+ data.tar.gz: 354510f0d6a528603e3ac1aa3f32c3cb97fb166555508577e115375e4b30a34f889220fea4cd4d4eee95bbbc4c88ec62458d877535539836acb83a1bf7faaba2
data/README.md CHANGED
@@ -16,7 +16,7 @@ gem install sassc-embedded
16
16
 
17
17
  ## Usage
18
18
 
19
- To compile, `require 'sassc/embedded'` before use a `SassC::Engine`, e.g.:
19
+ This polyfill utilizes `sass-embedded` to allow you to compile SCSS or SASS syntax to CSS. To compile, use a `SassC::Engine`, e.g.:
20
20
 
21
21
  ``` ruby
22
22
  require 'sassc/embedded'
@@ -32,4 +32,5 @@ See [rubydoc.info/gems/sassc](https://rubydoc.info/gems/sassc) for full API docu
32
32
  2. Option `:style => :compact` behaves as `:compressed`.
33
33
  3. Option `:precision` is ignored.
34
34
  4. Option `:line_comments` is ignored.
35
- 5. Argument `parent_path` in `Importer#imports` is set to value of option `:filename`.
35
+ 5. Argument `parent_path` in `Importer#imports` is set to value of option `:filename`.
36
+ 6. See [the dart-sass documentation](https://github.com/sass/dart-sass#behavioral-differences-from-ruby-sass) for other differences.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
@@ -22,7 +22,7 @@ module SassC
22
22
  syntax: syntax,
23
23
  url: file_url,
24
24
 
25
- source_map: !source_map_file.nil?,
25
+ source_map: source_map_embed? || !source_map_file.nil?,
26
26
  source_map_include_sources: source_map_contents?,
27
27
  style: output_style,
28
28
 
@@ -52,6 +52,10 @@ module SassC
52
52
 
53
53
  private
54
54
 
55
+ def output_path
56
+ @options[:output_path]
57
+ end
58
+
55
59
  def file_url
56
60
  @file_url ||= Util.path_to_file_url(filename || 'stdin')
57
61
  end
@@ -89,6 +93,8 @@ module SassC
89
93
 
90
94
  data = JSON.parse(source_map)
91
95
 
96
+ data['file'] = URI::DEFAULT_PARSER.escape(output_path) if output_path
97
+
92
98
  data['sources'].map! do |source|
93
99
  if source.start_with? 'file:'
94
100
  relative_path(Dir.pwd, Util.file_url_to_path(source))
@@ -101,7 +107,7 @@ module SassC
101
107
  end
102
108
 
103
109
  def post_process_css(css)
104
- css += "\n" if css.end_with? '}'
110
+ css += "\n" unless css.empty?
105
111
  unless @source_map.nil? || omit_source_map_url?
106
112
  url = if source_map_embed?
107
113
  "data:application/json;base64,#{Base64.strict_encode64(@source_map)}"
@@ -159,7 +165,7 @@ module SassC
159
165
 
160
166
  begin
161
167
  begin
162
- raise
168
+ raise RuntimeError
163
169
  rescue StandardError
164
170
  raise ::Sass::ScriptError
165
171
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -138,8 +138,8 @@ homepage: https://github.com/ntkme/sassc-embedded-polyfill-ruby
138
138
  licenses:
139
139
  - MIT
140
140
  metadata:
141
- documentation_uri: https://rubydoc.info/gems/sassc-embedded/0.1.0
142
- source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v0.1.0
141
+ documentation_uri: https://rubydoc.info/gems/sassc-embedded/0.1.3
142
+ source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v0.1.3
143
143
  funding_uri: https://github.com/sponsors/ntkme
144
144
  post_install_message:
145
145
  rdoc_options: []