sass-embedded 1.1.0 → 1.1.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
  SHA256:
3
- metadata.gz: 105fb9a8f27198dc74d89911ec31eafc40e7cf786a9567d993f584c956169014
4
- data.tar.gz: e381b1d5c74d5356dfa9c6085bc7f6ed088259c90a80051dc22cbdf975fc1642
3
+ metadata.gz: 4e63fe59310ae93bfce4710d847ee1a3d57a3678ea42754eebeb239c0510c933
4
+ data.tar.gz: d0f0e73bdd5952dfb1471ca23807584be64468e605f9e7c325e471b63d2a6f75
5
5
  SHA512:
6
- metadata.gz: a33ebf10f59766f644e2c88be19ea2aa72bb78a45684f65092be5c386d977437f928fa5d63a9dde96d31f777e72a6a30b36be8959a22dbc4da02c090278ff01d
7
- data.tar.gz: '096e8913f2d9d4f402625d2f479e68ca772fffeaa8135ef078538af43052765753339fe9c1e3f378464f8d26d5dcffb113f2783754cd17bb24e097343a12b8fb'
6
+ metadata.gz: 416f46659daf522785ec25b98a1b40df6e07216cffa7783004706404b49da57626cfca7c4e4f52a2da7d4981aca89a85cb926f1a49686390b9f3ff963eb288cf
7
+ data.tar.gz: 7e5ffe58da7e814fab55ea43d17b16b7b53382b915cde3874e215b58919055c73e1120df8a5f934fe6aa71c70126cbe21965cf381ef45f024c982536e852ef7a
data/ext/sass/Rakefile CHANGED
@@ -63,45 +63,54 @@ module FileUtils
63
63
  sh 'unzip', '-od', dest, archive
64
64
  end
65
65
  else
66
- raise "Unknown archive format #{archive}"
66
+ raise ArgumentError, "Unknown archive format #{archive}"
67
67
  end
68
68
  end
69
69
 
70
- def fetch(uri_or_path, dest = nil)
71
- require 'open-uri'
70
+ def fetch(source_uri, dest_path = nil)
71
+ require 'rubygems/remote_fetcher'
72
72
 
73
- begin
74
- uri = URI.parse(uri_or_path)
75
- path = URI::DEFAULT_PARSER.unescape(uri.path)
76
- if uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
77
- path = path.delete_prefix('/') if Gem.win_platform? && !File.file?(path)
78
- raise unless File.file?(path)
73
+ unless source_uri.is_a?(URI::Generic)
74
+ begin
75
+ source_uri = URI.parse(source_uri)
76
+ rescue StandardError
77
+ source_uri = URI.parse(URI::DEFAULT_PARSER.escape(source_uri.to_s))
79
78
  end
80
- rescue StandardError
81
- raise unless File.file?(uri_or_path)
79
+ end
80
+
81
+ scheme = source_uri.scheme
82
+ source_path = URI::DEFAULT_PARSER.unescape(source_uri.path)
82
83
 
83
- uri = nil
84
- path = uri_or_path
84
+ if Gem.win_platform? && scheme =~ /^[a-z]$/i && !source_path.include?(':')
85
+ source_path = "#{scheme}:#{source_path}"
86
+ scheme = nil
85
87
  end
86
88
 
87
- dest = File.basename(path) if dest.nil?
89
+ dest_path = File.basename(source_path) if dest_path.nil?
88
90
 
89
- if uri.nil? || uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
90
- cp path, dest
91
- elsif uri.respond_to?(:open)
92
- Rake.rake_output_message "curl -fsSLo #{dest} -- #{uri}" if Rake::FileUtilsExt.verbose_flag
93
- unless Rake::FileUtilsExt.nowrite_flag
94
- uri.open do |stream|
95
- File.binwrite(dest, stream.read)
96
- end
91
+ case scheme
92
+ when nil, 'file'
93
+ if Gem.win_platform? && source_path[0].chr == '/' && source_path[1].chr =~ /[a-z]/i && source_path[2].chr == ':'
94
+ source_path = source_path[1..]
97
95
  end
96
+ cp source_path, dest_path
98
97
  else
99
- raise
98
+ fetcher = Gem::RemoteFetcher.fetcher
99
+ symbol = "fetch_#{scheme}".to_sym
100
+ raise ArgumentError, "Unsupported URI scheme #{scheme}" unless fetcher.respond_to?(symbol)
101
+
102
+ if Rake::FileUtilsExt.verbose_flag
103
+ redacted_uri = Gem::RemoteFetcher::FetchError.new('', source_uri).uri
104
+ Rake.rake_output_message "fetch #{redacted_uri}"
105
+ end
106
+
107
+ unless Rake::FileUtilsExt.nowrite_flag
108
+ data = fetcher.public_send(symbol, source_uri)
109
+ Gem.write_binary(dest_path, data)
110
+ end
100
111
  end
101
112
 
102
- dest
103
- rescue StandardError
104
- raise IOError, "Failed to fetch #{uri_or_path}"
113
+ dest_path
105
114
  end
106
115
  end
107
116
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '1.1.0'
5
+ VERSION = '1.1.1'
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2022-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -160,8 +160,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
160
160
  licenses:
161
161
  - MIT
162
162
  metadata:
163
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.1.0
164
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.1.0
163
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.1.1
164
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.1.1
165
165
  funding_uri: https://github.com/sponsors/ntkme
166
166
  post_install_message:
167
167
  rdoc_options: []