asherah 0.4.0 → 0.4.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Rakefile +2 -0
- data/asherah.gemspec +1 -1
- data/ext/asherah/native_file.rb +10 -10
- data/lib/asherah/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d4f9b143e7306eba568f49f25ba360f1500aa31279f62d50f02f021129c3027
|
4
|
+
data.tar.gz: 462ac2c6f71abc2975ae0db4059f89e298e195274fb9f7dd466d1ecc983c6392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8bcef6399ad44911ba97ec1703e9a3c235737505920bfac652929d75e1699c5720267bcd6614755fa486c60210a33ffd1b33969e5319c89346c7729ad65d7c3
|
7
|
+
data.tar.gz: 469c7069936dd2f70ca105a3ee8dded2aa5465d2c7511a36f701fe7f0d69d2c0c61f0aec1461c363dcb8d3af32a626d6012f6cb5f8951bd39f7660df1c4e4a82
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/asherah.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
28
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
29
29
|
`git ls-files -z`.split("\x0").reject do |f|
|
30
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
30
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|tasks)/|\.(?:git|travis|circleci)|appveyor)})
|
31
31
|
end
|
32
32
|
end
|
33
33
|
spec.bindir = 'exe'
|
data/ext/asherah/native_file.rb
CHANGED
@@ -17,16 +17,15 @@ class NativeFile
|
|
17
17
|
RETRY_DELAY = 1
|
18
18
|
|
19
19
|
class << self
|
20
|
-
def download
|
21
|
-
file_name
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
abort "#{file_path} already exists" if File.exist?(file_path)
|
20
|
+
def download(
|
21
|
+
file_name: Class.new.extend(Cobhan).library_file_name(LIB_NAME),
|
22
|
+
dir: File.join(ROOT_DIR, 'lib/asherah/native')
|
23
|
+
)
|
24
|
+
file_path = File.join(dir, file_name)
|
25
|
+
if File.exist?(file_path)
|
26
|
+
puts "#{file_path} already exists ... skipping download"
|
27
|
+
return
|
28
|
+
end
|
30
29
|
|
31
30
|
checksum = CHECKSUMS.fetch(file_name) do
|
32
31
|
abort "Unsupported platform #{RUBY_PLATFORM}"
|
@@ -37,6 +36,7 @@ class NativeFile
|
|
37
36
|
sha256 = Digest::SHA256.hexdigest(content)
|
38
37
|
abort "Could not verify checksum of #{file_name}" if sha256 != checksum
|
39
38
|
|
39
|
+
FileUtils.mkdir_p(dir)
|
40
40
|
File.binwrite(file_path, content)
|
41
41
|
end
|
42
42
|
|
data/lib/asherah/version.rb
CHANGED