tebako-runtime 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +35 -0
- data/README.adoc +30 -0
- data/Rakefile +35 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/tebako-runtime/adapters/ffi.rb +40 -0
- data/lib/tebako-runtime/adapters/jing.rb +44 -0
- data/lib/tebako-runtime/adapters/mn2pdf.rb +40 -0
- data/lib/tebako-runtime/adapters/mnconvert.rb +41 -0
- data/lib/tebako-runtime/adapters/sassc.rb +65 -0
- data/lib/tebako-runtime/memfs.rb +67 -0
- data/lib/tebako-runtime/pre/seven-zip.rb +39 -0
- data/lib/tebako-runtime/string.rb +41 -0
- data/lib/tebako-runtime/version.rb +30 -0
- data/lib/tebako-runtime.rb +81 -0
- data/tebako-runtime.gemspec +67 -0
- metadata +190 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 74c66dc071ea02c3a3aba65fb2bf9591bac42d9098fb1d8ff2f24d388dc81c7a
|
4
|
+
data.tar.gz: 6fabb9d9af8db8f131bc57b92a0bd73d0c58cdb6c19eb9917f9248ef733b10a8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7ff49a2adf18263cc155e223b8f990ca4682ed5062968bf092a4c6015c5b6236450e21280049f7abd86cb6f5ff0fd887e993b9afef01d4a1833976df9f7e60f4
|
7
|
+
data.tar.gz: 3fc3e4c34e979c33007835c8fa3bff2dd36008516a4049ea5d6c8cd64c2d648abf07ab841762469b99bb78b6dc12b5bfdef2bb1bb94b1e1a9e5f8e3395237580
|
data/Gemfile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
source "https://rubygems.org"
|
29
|
+
|
30
|
+
gemspec
|
31
|
+
|
32
|
+
gem "rake", "~> 12.0"
|
33
|
+
|
34
|
+
# https://github.com/fontist/seven_zip_ruby/issues/13
|
35
|
+
gem "seven-zip", git: "https://github.com/fontist/seven_zip_ruby.git"
|
data/README.adoc
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
= Tebako-runtime
|
2
|
+
|
3
|
+
== A helper Gem for tebako image packager
|
4
|
+
|
5
|
+
image:https://github.com/maxirmx/tebako-runtime/actions/workflows/test-and-release.yml/badge.svg["Test and release", link="https://github.com/maxirmx/tebako-runtime/actions/workflows/test-and-release.yml"]
|
6
|
+
|
7
|
+
Tebako is an executable packager. It packages a set of files into a DwarFS file system for read-only purposes.
|
8
|
+
|
9
|
+
After packaging the file system into an image, Tebako produces a single executable binary that allows the user to run a selected file from the packaged filesystem.
|
10
|
+
|
11
|
+
Tebako image is essentially a patched Ruby with embedded filesystem as shown in the diagram.
|
12
|
+
|
13
|
+
image:https://user-images.githubusercontent.com/2081498/150532110-75b60f61-0dc0-4697-abe9-59133878ae8c.jpg["Tebako architecture", link="https://user-images.githubusercontent.com/2081498/150532110-75b60f61-0dc0-4697-abe9-59133878ae8c.jpg"]
|
14
|
+
|
15
|
+
Inside tebako image there are Ruby gems that can access native extensions. If a gem loads native extension using rubygem features this call is intercepted, a copy extension shared object is placed to
|
16
|
+
host temporary folder, all further calls to extension are routed to the copy of extension (Item 2 on the diagram).
|
17
|
+
|
18
|
+
Gems and extensions can reference other libraries, executable and data files using native system calls (Items 5, 6). Tebako cannot intercept such calls and route them correctly to
|
19
|
+
memory filesystem. Tebako shall offload required file from memfs to temporary folder and reroute system calls as needed.
|
20
|
+
|
21
|
+
tebako-runtime (this Gem) provides support for known Gems that use system calls to access executable or data files.
|
22
|
+
|
23
|
+
== Supported Gems
|
24
|
+
|
25
|
+
* https://rubygems.org/gems/ffi[ffi]
|
26
|
+
* https://rubygems.org/gems/mn2pdf[mn2pdf]
|
27
|
+
* https://rubygems.org/gems/mnconvert[mnconvert]
|
28
|
+
* https://rubygems.org/gems/ruby-jing[ruby-jing]
|
29
|
+
* https://rubygems.org/gems/sassc[sassc]
|
30
|
+
* https://rubygems.org/gems/seven-zip[seven-zip]
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require "bundler/gem_tasks"
|
29
|
+
require "rspec/core/rake_task"
|
30
|
+
require "rubocop/rake_task"
|
31
|
+
|
32
|
+
RSpec::Core::RakeTask.new(:spec)
|
33
|
+
RuboCop::RakeTask.new
|
34
|
+
|
35
|
+
task default: %i[spec]
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "tebako-runtime"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require_relative "../memfs"
|
29
|
+
|
30
|
+
# Wrapper for FFI.map_library_name method
|
31
|
+
# If the library file to be mapped to is within memfs it is extracted to tmp folder
|
32
|
+
module FFI
|
33
|
+
# https://stackoverflow.com/questions/29907157/how-to-alias-a-class-method-in-rails-model/29907207
|
34
|
+
singleton_class.send(:alias_method, :map_library_name_orig, :map_library_name)
|
35
|
+
|
36
|
+
# http://tech.tulentsev.com/2012/02/ruby-how-to-override-class-method-with-a-module/
|
37
|
+
def self.map_library_name(lib)
|
38
|
+
map_library_name_orig(TebakoRuntime.extract_memfs(lib))
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
# Unpack jing.jar
|
29
|
+
class Jing
|
30
|
+
tmp = DEFAULT_JAR
|
31
|
+
remove_const("DEFAULT_JAR")
|
32
|
+
DEFAULT_JAR = TebakoRuntime.extract_memfs(tmp)
|
33
|
+
|
34
|
+
alias original_initialize initialize
|
35
|
+
alias original_validate validate
|
36
|
+
|
37
|
+
def initialize(schema, options = nil)
|
38
|
+
original_initialize(TebakoRuntime.extract_memfs(schema, wild: true), options)
|
39
|
+
end
|
40
|
+
|
41
|
+
def validate(xml)
|
42
|
+
original_validate(TebakoRuntime.extract_memfs(xml))
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
# Unpack mn2pdf.jar
|
29
|
+
module Mn2pdf
|
30
|
+
remove_const("MN2PDF_JAR_PATH")
|
31
|
+
MN2PDF_JAR_PATH = TebakoRuntime.extract_memfs(File.join(TebakoRuntime.full_gem_path("mn2pdf"), "bin", "mn2pdf.jar"))
|
32
|
+
|
33
|
+
singleton_class.send(:alias_method, :convert_orig, :convert)
|
34
|
+
singleton_class.send(:remove_method, :convert)
|
35
|
+
|
36
|
+
def self.convert(url_path, output_path, xsl_stylesheet, options)
|
37
|
+
convert_orig(TebakoRuntime.extract_memfs(url_path), output_path, TebakoRuntime.extract_memfs(xsl_stylesheet),
|
38
|
+
options)
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
# Unpack mn2pdf.jar
|
29
|
+
module MnConvert
|
30
|
+
remove_const("MNCONVERT_JAR_PATH")
|
31
|
+
MNCONVERT_JAR_PATH = TebakoRuntime.extract_memfs(File.join(TebakoRuntime.full_gem_path("mnconvert"), "bin",
|
32
|
+
"mnconvert.jar"))
|
33
|
+
|
34
|
+
singleton_class.send(:alias_method, :convert_orig, :convert)
|
35
|
+
singleton_class.send(:remove_method, :convert)
|
36
|
+
|
37
|
+
def self.convert(input_file, opts = {})
|
38
|
+
opts[:xsl_file] = TebakoRuntime.extract_memfs(opts[:xsl_file]) if opts[:xsl_file]
|
39
|
+
convert_orig(TebakoRuntime.extract_memfs(input_file), opts)
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require "fileutils"
|
29
|
+
require_relative "../memfs"
|
30
|
+
|
31
|
+
module SassC
|
32
|
+
# Load style files for sassc
|
33
|
+
class Engine
|
34
|
+
# rubocop:disable Style/ClassVars
|
35
|
+
@@loaded_pathes = []
|
36
|
+
@@loaded_pathes_semaphore = Mutex.new
|
37
|
+
# rubocop:enable Style/ClassVars
|
38
|
+
|
39
|
+
def load_files(path, m_path)
|
40
|
+
FileUtils.mkdir_p(m_path)
|
41
|
+
FileUtils.cp_r(File.join(path, "."), m_path) if File.exist?(path)
|
42
|
+
@@loaded_pathes << m_path
|
43
|
+
end
|
44
|
+
|
45
|
+
def load_path(path, new_paths)
|
46
|
+
if path.start_with?(TebakoRuntime::COMPILER_MEMFS)
|
47
|
+
m_path = path.sub(TebakoRuntime::COMPILER_MEMFS, TebakoRuntime::COMPILER_MEMFS_LIB_CACHE.to_s)
|
48
|
+
@@loaded_pathes_semaphore.synchronize do
|
49
|
+
load_files(path, m_path) unless @@loaded_pathes.include?(m_path)
|
50
|
+
end
|
51
|
+
new_paths << m_path
|
52
|
+
else
|
53
|
+
new_paths << path
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_paths
|
58
|
+
paths = (@options[:load_paths] || []) + SassC.load_paths
|
59
|
+
new_paths = []
|
60
|
+
paths.each { |path| load_path path, new_paths }
|
61
|
+
pp = new_paths.join(File::PATH_SEPARATOR) unless new_paths.empty?
|
62
|
+
pp
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require "fileutils"
|
29
|
+
require "pathname"
|
30
|
+
require "rubygems"
|
31
|
+
require "tempfile"
|
32
|
+
|
33
|
+
require_relative "string"
|
34
|
+
|
35
|
+
# Module TebakoRuntime
|
36
|
+
# Methods to extract files from memfs to temporary folder
|
37
|
+
module TebakoRuntime
|
38
|
+
COMPILER_MEMFS = "/__tebako_memfs__"
|
39
|
+
COMPILER_MEMFS_LIB_CACHE = Pathname.new(Dir.mktmpdir("tebako-runtime-"))
|
40
|
+
|
41
|
+
class << self
|
42
|
+
def extract(file, wild, extract_path)
|
43
|
+
files = if wild
|
44
|
+
Dir.glob("#{File.dirname(file)}/*#{File.extname(file)}")
|
45
|
+
else
|
46
|
+
[file]
|
47
|
+
end
|
48
|
+
FileUtils.cp_r files, extract_path
|
49
|
+
end
|
50
|
+
|
51
|
+
# wild == true means "also extract other files with the same extension"
|
52
|
+
def extract_memfs(file, wild: false, cache_path: COMPILER_MEMFS_LIB_CACHE)
|
53
|
+
is_quoted = file.quoted?
|
54
|
+
file = file.unquote if is_quoted
|
55
|
+
return is_quoted ? file.quote : file unless File.exist?(file) && file.start_with?(COMPILER_MEMFS)
|
56
|
+
|
57
|
+
memfs_extracted_file = cache_path + File.basename(file)
|
58
|
+
extract(file, wild, cache_path) unless memfs_extracted_file.exist?
|
59
|
+
|
60
|
+
is_quoted ? memfs_extracted_file.to_path.quote : memfs_extracted_file.to_path
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
at_exit do
|
66
|
+
FileUtils.remove_dir(TebakoRuntime::COMPILER_MEMFS_LIB_CACHE.to_path, true)
|
67
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require_relative "../memfs"
|
29
|
+
require_relative "../../tebako-runtime"
|
30
|
+
|
31
|
+
# Fix path for 7zip load
|
32
|
+
module TebakoRuntime
|
33
|
+
sevenz_lib = RUBY_PLATFORM.downcase.match(/mswin|mingw/) ? "7z*.dll" : "7z.so"
|
34
|
+
sevenz_path = File.join(full_gem_path("seven-zip"), "lib", "seven_zip_ruby", sevenz_lib)
|
35
|
+
sevenz_new_folder = COMPILER_MEMFS_LIB_CACHE / "seven_zip_ruby"
|
36
|
+
FileUtils.mkdir_p(sevenz_new_folder)
|
37
|
+
FileUtils.cp(sevenz_path, sevenz_new_folder)
|
38
|
+
$LOAD_PATH.unshift(COMPILER_MEMFS_LIB_CACHE)
|
39
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
# Quote/unquote add-on for String class
|
29
|
+
class String
|
30
|
+
def quoted?
|
31
|
+
start_with?('"') && end_with?('"')
|
32
|
+
end
|
33
|
+
|
34
|
+
def unquote
|
35
|
+
chomp('"').reverse.chomp('"').reverse
|
36
|
+
end
|
37
|
+
|
38
|
+
def quote
|
39
|
+
"\"#{self}\""
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
module TebakoRuntime
|
29
|
+
VERSION = "0.2.0"
|
30
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require "fileutils"
|
29
|
+
require "pathname"
|
30
|
+
|
31
|
+
require_relative "tebako-runtime/version"
|
32
|
+
require_relative "tebako-runtime/memfs"
|
33
|
+
|
34
|
+
# Module TenakoRuntime
|
35
|
+
# Adds two additional steps for original require
|
36
|
+
# - an option to run some pre-processing 'BEFORE'
|
37
|
+
# - an option to implement adapter 'AFTER'
|
38
|
+
module TebakoRuntime
|
39
|
+
PRE_REQUIRE_MAP = {
|
40
|
+
"seven_zip_ruby" => "tebako-runtime/pre/seven-zip"
|
41
|
+
}.freeze
|
42
|
+
|
43
|
+
POST_REQUIRE_MAP = {
|
44
|
+
"ffi" => "tebako-runtime/adapters/ffi",
|
45
|
+
"jing" => "tebako-runtime/adapters/jing",
|
46
|
+
"mn2pdf" => "tebako-runtime/adapters/mn2pdf",
|
47
|
+
"mnconvert" => "tebako-runtime/adapters/mnconvert",
|
48
|
+
"sassc" => "tebako-runtime/adapters/sassc"
|
49
|
+
}.freeze
|
50
|
+
|
51
|
+
def self.full_gem_path(gem)
|
52
|
+
Gem::Specification.find_by_name(gem).full_gem_path
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.log_enabled
|
56
|
+
@log_enabled ||= false
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.process(name, map, title)
|
60
|
+
return !log_enabled unless map.key?(name)
|
61
|
+
|
62
|
+
puts "Tebako runtime: req/#{title} [#{name} => #{map[name]}]" if log_enabled
|
63
|
+
res_inner = require_relative map[name]
|
64
|
+
puts "Tebako runtime: skipped [#{name}]" if log_enabled && !res_inner
|
65
|
+
log_enabled
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Some would call it 'monkey patching' but in reality we are adding
|
70
|
+
# adapters to gems that shall be aware that they are running in tebako environment
|
71
|
+
module Kernel
|
72
|
+
alias original_require require
|
73
|
+
def require(name)
|
74
|
+
f1 = TebakoRuntime.process(name, TebakoRuntime::PRE_REQUIRE_MAP, "pre")
|
75
|
+
res = original_require name
|
76
|
+
f2 = TebakoRuntime.process(name, TebakoRuntime::POST_REQUIRE_MAP, "post")
|
77
|
+
|
78
|
+
puts "Tebako runtime: req [#{name}]" unless f1 || f2
|
79
|
+
res
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2023 [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
|
+
require_relative "lib/tebako-runtime/version"
|
29
|
+
|
30
|
+
Gem::Specification.new do |spec|
|
31
|
+
spec.name = "tebako-runtime"
|
32
|
+
spec.version = TebakoRuntime::VERSION
|
33
|
+
spec.authors = ["Ribose Inc."]
|
34
|
+
spec.email = ["open.source@ribose.com"]
|
35
|
+
spec.license = "BSD-2-Clause"
|
36
|
+
|
37
|
+
spec.summary = "Run-time support of tebako exxecutable packager"
|
38
|
+
spec.description = <<~SUM
|
39
|
+
Tebako (https://github.com/tamatebako/tebako) is an executable packager.
|
40
|
+
tebako-runtime gem implements adapters for Ruby gems that shall be aware
|
41
|
+
that they run in tebako environment.
|
42
|
+
SUM
|
43
|
+
spec.homepage = "https://github.com/tamatebako/tebako-runtime"
|
44
|
+
spec.required_ruby_version = ">= 2.7.0"
|
45
|
+
|
46
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
47
|
+
spec.metadata["source_code_uri"] = "https://github.com/tamatebako/tebako-runtime"
|
48
|
+
|
49
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
50
|
+
`git ls-files --recurse-submodules -z`.split("\x0").reject do |f|
|
51
|
+
(f == __FILE__) ||
|
52
|
+
f.match(%r{\A(?:(?:spec|tmp|\.github)/|\.(?:git|rspec|rubocop|gitignore))})
|
53
|
+
end
|
54
|
+
end
|
55
|
+
spec.require_paths = ["lib"]
|
56
|
+
|
57
|
+
spec.add_development_dependency "rspec", "~> 3.2"
|
58
|
+
spec.add_development_dependency "rubocop", "~> 1.52"
|
59
|
+
spec.add_development_dependency "rubocop-rspec", "~> 2.23"
|
60
|
+
spec.add_development_dependency "rubocop-rubycw", "~> 0.1"
|
61
|
+
|
62
|
+
spec.add_development_dependency "ffi", "~> 1.15"
|
63
|
+
spec.add_development_dependency "mn2pdf", "~> 1.79"
|
64
|
+
spec.add_development_dependency "mnconvert", "~> 1.54"
|
65
|
+
spec.add_development_dependency "ruby-jing", "~> 0.0.3"
|
66
|
+
spec.add_development_dependency "sassc", "~> 2.4"
|
67
|
+
end
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tebako-runtime
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ribose Inc.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-08-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.52'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.52'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.23'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.23'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-rubycw
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ffi
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.15'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.15'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mn2pdf
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.79'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.79'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mnconvert
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.54'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.54'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: ruby-jing
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.0.3
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.0.3
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: sassc
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.4'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.4'
|
139
|
+
description: |
|
140
|
+
Tebako (https://github.com/tamatebako/tebako) is an executable packager.
|
141
|
+
tebako-runtime gem implements adapters for Ruby gems that shall be aware
|
142
|
+
that they run in tebako environment.
|
143
|
+
email:
|
144
|
+
- open.source@ribose.com
|
145
|
+
executables: []
|
146
|
+
extensions: []
|
147
|
+
extra_rdoc_files: []
|
148
|
+
files:
|
149
|
+
- Gemfile
|
150
|
+
- README.adoc
|
151
|
+
- Rakefile
|
152
|
+
- bin/console
|
153
|
+
- bin/setup
|
154
|
+
- lib/tebako-runtime.rb
|
155
|
+
- lib/tebako-runtime/adapters/ffi.rb
|
156
|
+
- lib/tebako-runtime/adapters/jing.rb
|
157
|
+
- lib/tebako-runtime/adapters/mn2pdf.rb
|
158
|
+
- lib/tebako-runtime/adapters/mnconvert.rb
|
159
|
+
- lib/tebako-runtime/adapters/sassc.rb
|
160
|
+
- lib/tebako-runtime/memfs.rb
|
161
|
+
- lib/tebako-runtime/pre/seven-zip.rb
|
162
|
+
- lib/tebako-runtime/string.rb
|
163
|
+
- lib/tebako-runtime/version.rb
|
164
|
+
- tebako-runtime.gemspec
|
165
|
+
homepage: https://github.com/tamatebako/tebako-runtime
|
166
|
+
licenses:
|
167
|
+
- BSD-2-Clause
|
168
|
+
metadata:
|
169
|
+
homepage_uri: https://github.com/tamatebako/tebako-runtime
|
170
|
+
source_code_uri: https://github.com/tamatebako/tebako-runtime
|
171
|
+
post_install_message:
|
172
|
+
rdoc_options: []
|
173
|
+
require_paths:
|
174
|
+
- lib
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: 2.7.0
|
180
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
requirements: []
|
186
|
+
rubygems_version: 3.1.2
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Run-time support of tebako exxecutable packager
|
190
|
+
test_files: []
|