sassc-embedded 1.68.2 → 1.68.4

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: e9bc5cac9cd760e5a3763752ed7972d9071daac5c73a4470ef51674222dea3d4
4
- data.tar.gz: 5ee33293cc9ea0911f557812d5e6fd8d9f13c9da96427f0cb1e60f1ac806fe9b
3
+ metadata.gz: df137dce16ba36c3c08123bcc7640689e241b9639651336521d1a7cc2b132866
4
+ data.tar.gz: 0b5a036057c957816770fcf37945e0aa7138ed1e47628a8ee25cb3361cacef99
5
5
  SHA512:
6
- metadata.gz: 17245ae4b95349b96a89991ba2b9a6486a71e37dc146230f433416c224cd51f243983907415beb3464f5ef301c343406b197a3e85396dbc327e9de34d9d193fd
7
- data.tar.gz: b2d86f258395f846fe809da335efc70e3be4e9527dd4e85c9744da0f4dc858e0860e6020f4a0fd6f72ce04b391c84f7d524061a2aad362492530f6c12766105e
6
+ metadata.gz: 598c352f1ef7cb2c0c50462cc415b7b64b9be75b8ce207636ae308678c2fe67084461baed878d8928fe417df810908fbfa8ca60d2aa9eef6002673bb270161fa
7
+ data.tar.gz: a0ad7341bbf03fb8177aa4285f1b7c6c9aa1ebf7a1193f90fc32560a02c8c4616c143f7fb122f483fd30e46b1f8636e34bf59113ec16f4b5da849f085efddeb0
data/README.md CHANGED
@@ -9,52 +9,13 @@ This library shims [`sassc`](https://github.com/sass/sassc-ruby) with the [`sass
9
9
 
10
10
  It has been tested with:
11
11
 
12
+ - [`bootstrap`](https://github.com/twbs/bootstrap-rubygem)
12
13
  - [`sassc`](https://github.com/sass/sassc-ruby)
13
14
  - [`sassc-rails`](https://github.com/sass/sassc-rails)
14
15
  - [`sprockets`](https://github.com/rails/sprockets)
15
16
  - [`sprockets-rails`](https://github.com/rails/sprockets-rails)
16
17
 
17
- ## Uninstall `sassc`
18
-
19
- Execute:
20
-
21
- ``` sh
22
- bundle remove sassc
23
- ```
24
-
25
- Or uninstall it yourself as:
26
-
27
- ``` sh
28
- gem uninstall sassc
29
- ```
30
-
31
- **If your application has a transitive dependency on `sassc` that cannot be removed, you can use any of the following workarounds.**
32
-
33
- ### Workaround One
34
-
35
- Add this line to your application's Gemfile:
36
-
37
- ``` ruby
38
- gem 'sassc', github: 'sass/sassc-ruby', ref: 'refs/pull/233/head'
39
- ```
40
-
41
- And then execute:
42
-
43
- ``` sh
44
- bundle
45
- ```
46
-
47
- The fork of `sassc` at https://github.com/sass/sassc-ruby/pull/233 will load the shim automatically when `require 'sassc'` is invoked, meaning no other code changes needed in your application.
48
-
49
- ### Workaround Two
50
-
51
- Add this line to your application's code:
52
-
53
- ``` ruby
54
- require 'sassc-embedded'
55
- ```
56
-
57
- ## Install `sassc-embedded`
18
+ ## Install
58
19
 
59
20
  Add this line to your application's Gemfile:
60
21
 
@@ -95,3 +56,45 @@ See [rubydoc.info/gems/sassc](https://rubydoc.info/gems/sassc) for full API docu
95
56
  3. Option `:line_comments` is ignored.
96
57
 
97
58
  See [the dart-sass documentation](https://github.com/sass/dart-sass#behavioral-differences-from-ruby-sass) for other differences.
59
+
60
+ ## Troubleshooting
61
+
62
+ ### The original `sassc` gem is still being used instead of `sassc-embedded`
63
+
64
+ When launching an application via `bundle exec`, it puts `sassc-embedded` at higher priority than `sassc` in `$LOAD_PATH`. You can verify the order of `$LOAD_PATH` with the following command:
65
+
66
+ ``` ruby
67
+ bundle exec ruby -e 'puts $LOAD_PATH'
68
+ ```
69
+
70
+ If you see `sassc` has higher priority than `sassc-embedded`, try remove `sassc`:
71
+
72
+ ```
73
+ bundle remove sassc
74
+ ```
75
+
76
+ If your application has a transitive dependency on `sassc` that cannot be removed, you can use one of the following workarounds.
77
+
78
+ #### Workaround One
79
+
80
+ Add this line to your application's Gemfile:
81
+
82
+ ``` ruby
83
+ gem 'sassc', github: 'sass/sassc-ruby', ref: 'refs/pull/233/head'
84
+ ```
85
+
86
+ And then execute:
87
+
88
+ ``` sh
89
+ bundle
90
+ ```
91
+
92
+ The fork of `sassc` at https://github.com/sass/sassc-ruby/pull/233 will load the shim whenever `require 'sassc'` is invoked, meaning no other code changes needed in your application.
93
+
94
+ #### Workaround Two
95
+
96
+ Add this line to your application's code:
97
+
98
+ ``` ruby
99
+ require 'sassc-embedded'
100
+ ```
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.68.2'
5
+ VERSION = '1.68.4'
6
6
  end
7
7
  end
@@ -15,7 +15,9 @@ module SassC
15
15
 
16
16
  base_importer = import_handler.setup(nil)
17
17
 
18
- result = ::Sass.compile_string(
18
+ sass = ::Sass::Embedded.new
19
+
20
+ result = sass.compile_string(
19
21
  @template,
20
22
  importer: base_importer,
21
23
  load_paths: load_paths,
@@ -64,14 +66,16 @@ module SassC
64
66
  URL.file_urls_to_relative_path(url, URL.path_to_file_url("#{Dir.pwd}/"))
65
67
  end
66
68
  raise SyntaxError.new(e.full_message, filename: path, line: line)
69
+ ensure
70
+ sass&.close
67
71
  end
68
72
 
69
73
  def dependencies
70
74
  raise NotRenderedError unless @loaded_urls
71
75
 
72
- Dependency.from_filenames(@loaded_urls
73
- .filter { |url| url.start_with?(Protocol::FILE) && url != file_url }
74
- .map { |url| URL.file_url_to_path(url) })
76
+ Dependency.from_filenames(@loaded_urls.filter_map do |url|
77
+ URL.file_url_to_path(url) if url.start_with?(Protocol::FILE) && url != file_url
78
+ end)
75
79
  end
76
80
 
77
81
  def source_map
@@ -569,11 +573,11 @@ module SassC
569
573
  end
570
574
 
571
575
  def file_urls_to_relative_url(url, from_url)
572
- URL.parse(url).route_from(from_url).to_s
576
+ parse(url).route_from(from_url).to_s
573
577
  end
574
578
 
575
579
  def file_urls_to_relative_path(url, from_url)
576
- URL.unescape(file_urls_to_relative_url(url, from_url))
580
+ unescape(file_urls_to_relative_url(url, from_url))
577
581
  end
578
582
 
579
583
  def file_url_to_path(url)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.68.2
4
+ version: 1.68.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-22 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-embedded
@@ -78,7 +78,7 @@ licenses:
78
78
  - MIT
79
79
  metadata:
80
80
  documentation_uri: https://rubydoc.info/gems/sassc
81
- source_code_uri: https://github.com/ntkme/sassc-embedded-shim-ruby/tree/v1.68.2
81
+ source_code_uri: https://github.com/ntkme/sassc-embedded-shim-ruby/tree/v1.68.4
82
82
  funding_uri: https://github.com/sponsors/ntkme
83
83
  post_install_message:
84
84
  rdoc_options: []