tebako-runtime 0.5.0 → 0.5.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/Rakefile +14 -9
- data/lib/tebako-runtime/memfs.rb +1 -1
- data/lib/tebako-runtime/pre/excavate.rb +31 -0
- data/lib/tebako-runtime/pre/seven-zip.rb +3 -2
- data/lib/tebako-runtime/version.rb +1 -1
- data/lib/tebako-runtime.rb +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '097d5286d2407698d42ea62673f8ecb003f02ec6977d980ea399f7b50fbb97e5'
|
4
|
+
data.tar.gz: a7983b403f626a3f6b92a0f8d893fccadf4933c03cf13b2ebb306f221be20cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aba554f750356e8445d4cc0f4dc4d41b5af24058ebda5a7d6c1ac7ddadd82a5032903b6411023a61369def5e904b02ac71b2395a64f8e08624cb8eb5ec4ecbec
|
7
|
+
data.tar.gz: 6f9ff5b865e68681dec9dc25cf7211c7e0c733e126c734be496a00bf168bfd00c4625df26fccfd367ce68895148e2a0e6a96a4d08be7a8a526b1c08d722456b1
|
data/Rakefile
CHANGED
@@ -35,14 +35,17 @@ require "fileutils"
|
|
35
35
|
namespace :build do
|
36
36
|
desc "Download cacert.pem"
|
37
37
|
task :download_cacert do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
unless File.exist?("lib/cert/cacert.pem.mozilla")
|
39
|
+
|
40
|
+
url = URI("https://curl.se/ca/cacert.pem")
|
41
|
+
FileUtils.mkdir_p("lib/cert")
|
42
|
+
Net::HTTP.start(url.host, url.port, use_ssl: url.scheme == "https") do |http|
|
43
|
+
request = Net::HTTP::Get.new url
|
44
|
+
http.request request do |response|
|
45
|
+
open "lib/cert/cacert.pem.mozilla", "w" do |io|
|
46
|
+
response.read_body do |chunk|
|
47
|
+
io.write chunk
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
@@ -52,7 +55,9 @@ end
|
|
52
55
|
|
53
56
|
task build: "build:download_cacert"
|
54
57
|
|
55
|
-
task
|
58
|
+
task spec: "build:download_cacert"
|
59
|
+
|
60
|
+
task default: :spec
|
56
61
|
|
57
62
|
RSpec::Core::RakeTask.new(:spec)
|
58
63
|
RuboCop::RakeTask.new
|
data/lib/tebako-runtime/memfs.rb
CHANGED
@@ -35,7 +35,7 @@ require_relative "string"
|
|
35
35
|
# Module TebakoRuntime
|
36
36
|
# Methods to extract files from memfs to temporary folder
|
37
37
|
module TebakoRuntime
|
38
|
-
COMPILER_MEMFS = RUBY_PLATFORM =~ /
|
38
|
+
COMPILER_MEMFS = RUBY_PLATFORM =~ /mswin|mingw/ ? "A:/__tebako_memfs__" : "/__tebako_memfs__"
|
39
39
|
COMPILER_MEMFS_LIB_CACHE = Pathname.new(Dir.mktmpdir("tebako-runtime-"))
|
40
40
|
|
41
41
|
class << self
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2024 [Ribose Inc](https://www.ribose.com).
|
4
|
+
# All rights reserved.
|
5
|
+
# This file is a part of tebako
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
8
|
+
# modification, are permitted provided that the following conditions
|
9
|
+
# are met:
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
|
28
|
+
# For some reason on Windows an attempt to require "seven_zip_ruby" from excavate fails
|
29
|
+
# I cannot debug it effectively because of https://github.com/tamatebako/tebako/issues/119
|
30
|
+
|
31
|
+
require "seven_zip_ruby"
|
@@ -32,10 +32,11 @@ require_relative "../../tebako-runtime"
|
|
32
32
|
module TebakoRuntime
|
33
33
|
sevenz_lib = RUBY_PLATFORM.downcase.match(/mswin|mingw/) ? "7z*.dll" : "7z.so"
|
34
34
|
sevenz_path = File.join(full_gem_path("seven-zip"), "lib", "seven_zip_ruby", sevenz_lib)
|
35
|
+
sevenz_paths = Dir.glob(sevenz_path)
|
35
36
|
sevenz_new_folder = COMPILER_MEMFS_LIB_CACHE / "seven_zip_ruby"
|
36
37
|
FileUtils.mkdir_p(sevenz_new_folder)
|
37
|
-
|
38
|
+
sevenz_paths.each do |file|
|
38
39
|
FileUtils.cp(file, sevenz_new_folder)
|
39
40
|
end
|
40
|
-
$LOAD_PATH.unshift(COMPILER_MEMFS_LIB_CACHE)
|
41
|
+
$LOAD_PATH.unshift(COMPILER_MEMFS_LIB_CACHE.to_s)
|
41
42
|
end
|
data/lib/tebako-runtime.rb
CHANGED
@@ -37,6 +37,7 @@ require_relative "tebako-runtime/memfs"
|
|
37
37
|
# - an option to implement adapter 'AFTER'
|
38
38
|
module TebakoRuntime
|
39
39
|
PRE_REQUIRE_MAP = {
|
40
|
+
"excavate" => "tebako-runtime/pre/excavate",
|
40
41
|
"seven_zip_ruby" => "tebako-runtime/pre/seven-zip"
|
41
42
|
}.freeze
|
42
43
|
|
@@ -79,10 +80,10 @@ module TebakoRuntime
|
|
79
80
|
# It targets ffi-compiler/ffi-compiler2 that use some functions of
|
80
81
|
# deployed ffi to process other gems
|
81
82
|
# THis approach is not compatible with tebako on Windows because ffi
|
82
|
-
# is deployed with (
|
83
|
+
# is deployed with (implib) reference to target tebako package that is
|
83
84
|
# not available at deploy time
|
84
85
|
def self.process_pass_through(name)
|
85
|
-
if name == "ffi" && RUBY_PLATFORM =~ /
|
86
|
+
if name == "ffi" && RUBY_PLATFORM =~ /mswin|mingw/
|
86
87
|
puts "Replacing ffi ffi-platform-stub" if log_enabled
|
87
88
|
res = original_require "tebako-runtime/pass-through/ffi-platform-stub"
|
88
89
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tebako-runtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- lib/tebako-runtime/adapters/sassc.rb
|
162
162
|
- lib/tebako-runtime/memfs.rb
|
163
163
|
- lib/tebako-runtime/pass-through/ffi-platform-stub.rb
|
164
|
+
- lib/tebako-runtime/pre/excavate.rb
|
164
165
|
- lib/tebako-runtime/pre/seven-zip.rb
|
165
166
|
- lib/tebako-runtime/string.rb
|
166
167
|
- lib/tebako-runtime/version.rb
|
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
187
|
- !ruby/object:Gem::Version
|
187
188
|
version: '0'
|
188
189
|
requirements: []
|
189
|
-
rubygems_version: 3.5.
|
190
|
+
rubygems_version: 3.5.11
|
190
191
|
signing_key:
|
191
192
|
specification_version: 4
|
192
193
|
summary: Run-time support of tebako executable packager
|