sass-embedded 1.0.3 → 1.0.6

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
  SHA256:
3
- metadata.gz: 62088f9ce8ff61f56c3191f1d7f941779f92583975db9b763a88f99c0255e8e3
4
- data.tar.gz: 3db4302a699a5b014b271f809a9e3f32e94ae5c841ff114bc2d37bcff1563d43
3
+ metadata.gz: bb22fd222502bd171a92c0f112b0644dda7b3c6badf12c9f9aa9b079c0856681
4
+ data.tar.gz: fd6f3666396b577de10d2c8403dd3bbdcf382b9d7e6a656d2da7ca6750ff0e38
5
5
  SHA512:
6
- metadata.gz: b1eb7486f98a12739ce4b9f19cacc3a13b96e005c6a5cf74053baad538375f5d2c3180a85cfa5b7b264ffda1c8e89ec72ae9f83fc3701ea114ffcdbedf59e3a8
7
- data.tar.gz: 47d6f81a0617b759b9ca605ee645245197d9ff5e05da6a6ecce93c13fce8d77cd9e8f7c68f61a2da85f6b0e9ca2fd96a6527d842bf9be88bf62ac83e792ef693
6
+ metadata.gz: e75993c794dfde2f004cff309537562914b6cf5efcc9898f5b5b5b2e92c8cf5f616397ba363477768c36c2e42a1548c3f6897d2d28cdd4c4010489b744ff0626
7
+ data.tar.gz: 1116525243f799d4fa7ac0fb52fe3f59f5a5d2c08256d347c88ff19a48eef714ce3e2ccc58e8b71b61ebb055b80322b84017df207b5b047a802b8dea585fd73c
data/ext/sass/Makefile CHANGED
@@ -9,14 +9,14 @@ EXTCONF = ruby -- extconf.rb
9
9
  all: embedded_sass_pb.rb sass_embedded
10
10
 
11
11
  .PHONY: install
12
- install: clean
13
-
14
- .PHONY: uninstall
15
- uninstall:
16
- $(RM) embedded_sass_pb.rb sass_embedded
12
+ install: distclean
17
13
 
18
14
  .PHONY: clean
19
15
  clean:
16
+ $(RM) embedded_sass_pb.rb sass_embedded
17
+
18
+ .PHONY: distclean
19
+ distclean:
20
20
  $(RM) embedded_sass.proto protoc protoc-* sass_embedded-*
21
21
 
22
22
  ifeq ($(OS),Windows_NT)
data/ext/sass/extconf.rb CHANGED
@@ -104,14 +104,27 @@ module Sass
104
104
  end
105
105
  end
106
106
 
107
- def fetch(uri_s)
108
- uri = URI.parse(uri_s)
109
- path = URI::DEFAULT_PARSER.unescape(uri.path)
107
+ def fetch(uri_or_path)
108
+ begin
109
+ uri = URI.parse(uri_or_path)
110
+ path = URI::DEFAULT_PARSER.unescape(uri.path)
111
+ if uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
112
+ path = path.delete_prefix('/') if Platform::OS == 'windows' && !File.file?(path)
113
+ raise unless File.file?(path)
114
+ end
115
+ rescue StandardError
116
+ raise unless File.file?(uri_or_path)
117
+
118
+ uri = nil
119
+ path = uri_or_path
120
+ end
121
+
110
122
  dest = File.absolute_path(File.basename(path), __dir__)
111
- if uri.is_a?(URI::File) || uri.instance_of?(URI::Generic)
123
+
124
+ if uri.nil? || uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
112
125
  puts "cp -- #{path} #{dest}"
113
126
  FileUtils.copy_file(path, dest)
114
- elsif uri.respond_to? :open
127
+ elsif uri.respond_to?(:open)
115
128
  puts "curl -fsSLo #{dest} -- #{uri}"
116
129
  uri.open do |stream|
117
130
  File.binwrite(dest, stream.read)
@@ -120,7 +133,7 @@ module Sass
120
133
  raise
121
134
  end
122
135
  rescue StandardError
123
- raise "Failed to fetch #{uri_s}"
136
+ raise "Failed to fetch #{uri_or_path}"
124
137
  end
125
138
 
126
139
  def default_sass_embedded
@@ -138,7 +151,7 @@ module Sass
138
151
  when 'windows'
139
152
  'windows'
140
153
  else
141
- raise "Unsupported OS: #{Platform::OS}"
154
+ raise release_asset_not_available_error(repo, tag_name)
142
155
  end
143
156
 
144
157
  arch = case Platform::ARCH
@@ -147,11 +160,9 @@ module Sass
147
160
  when 'i386'
148
161
  'ia32'
149
162
  when 'aarch64'
150
- raise "Unsupported Arch: #{Platform::ARCH}" unless Platform::OS == 'darwin'
151
-
152
- 'x64'
163
+ Platform::OS == 'darwin' ? 'x64' : 'arm64'
153
164
  else
154
- raise "Unsupported Arch: #{Platform::ARCH}"
165
+ raise release_asset_not_available_error(repo, tag_name)
155
166
  end
156
167
 
157
168
  ext = case os
@@ -179,16 +190,12 @@ module Sass
179
190
  when 'windows'
180
191
  'win'
181
192
  else
182
- raise "Unsupported OS: #{Platform::OS}"
193
+ raise release_asset_not_available_error(repo, tag_name)
183
194
  end
184
195
 
185
196
  arch = case Platform::ARCH
186
197
  when 'aarch64'
187
- if Platform::OS == 'darwin'
188
- 'x86_64'
189
- else
190
- 'aarch_64'
191
- end
198
+ Platform::OS == 'darwin' ? 'x86_64' : 'aarch_64'
192
199
  when 'sparcv9'
193
200
  's390'
194
201
  when 'i386'
@@ -198,7 +205,7 @@ module Sass
198
205
  when 'powerpc64'
199
206
  'ppcle_64'
200
207
  else
201
- raise "Unsupported Arch: #{Platform::ARCH}"
208
+ raise release_asset_not_available_error(repo, tag_name)
202
209
  end
203
210
 
204
211
  os_arch = case os
@@ -222,7 +229,13 @@ module Sass
222
229
 
223
230
  tag_name = JSON.parse(stdout)['protocolVersion']
224
231
 
225
- "https://raw.githubusercontent.com/#{repo}/#{tag_name}/embedded_sass.proto"
232
+ "https://github.com/#{repo}/raw/#{tag_name}/embedded_sass.proto"
233
+ end
234
+
235
+ def release_asset_not_available_error(repo, tag_name)
236
+ platform = "#{Platform::OS} #{Platform::ARCH}"
237
+ url = "https://github.com/#{repo}/releases/tag/#{tag_name}"
238
+ NotImplementedError.new("Release asset for #{platform} not available at #{url}")
226
239
  end
227
240
  end
228
241
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '1.0.3'
5
+ VERSION = '1.0.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-27 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.8.0
103
+ version: 2.9.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.8.0
110
+ version: 2.9.0
111
111
  description: A Ruby library that will communicate with Embedded Dart Sass using the
112
112
  Embedded Sass protocol.
113
113
  email:
@@ -162,8 +162,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
162
162
  licenses:
163
163
  - MIT
164
164
  metadata:
165
- documentation_uri: https://www.rubydoc.info/gems/sass-embedded/1.0.3
166
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.3
165
+ documentation_uri: https://www.rubydoc.info/gems/sass-embedded/1.0.6
166
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.6
167
167
  funding_uri: https://github.com/sponsors/ntkme
168
168
  post_install_message:
169
169
  rdoc_options: []