tebako 0.5.0
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 +7 -0
- data/CMakeLists.txt +694 -0
- data/Gemfile +35 -0
- data/README.adoc +389 -0
- data/Rakefile +33 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/cmake/copy_dir.cmake +29 -0
- data/cmake/def_tty_colours.cmake +19 -0
- data/common.env +6 -0
- data/exe/tebako +31 -0
- data/include/tebako/tebako-fs.h +40 -0
- data/include/tebako/tebako-main.h +40 -0
- data/lib/cli.rb +28 -0
- data/lib/tebako/cli.rb +137 -0
- data/lib/tebako/cli_helpers.rb +147 -0
- data/lib/tebako/error.rb +39 -0
- data/lib/tebako/packager/pass1.rb +155 -0
- data/lib/tebako/packager/pass2.rb +374 -0
- data/lib/tebako/packager.rb +210 -0
- data/lib/tebako/version.rb +30 -0
- data/resources/tebako-fs.cpp.in +37 -0
- data/resources/tebako-version.h.in +37 -0
- data/src/tebako-main.cpp +188 -0
- data/tebako.gemspec +63 -0
- data/tests/scripts/cross-tests.sh +34 -0
- data/tests/scripts/functional-tests.sh +335 -0
- data/tests/test-00/test.rb +4 -0
- data/tests/test-01/tebako-test-run.rb +5 -0
- data/tests/test-09/tebako-test-0.0.1.gem +0 -0
- data/tests/test-11/bin/tebako-test-run.rb +10 -0
- data/tests/test-11/lib/tebako-test.rb +20 -0
- data/tests/test-11/tebako-test.gemspec +15 -0
- data/tests/test-12/tebako-test-a.gemspec +15 -0
- data/tests/test-12/tebako-test-b.gemspec +15 -0
- data/tests/test-13/bin/tebako-test-run.rb +10 -0
- data/tests/test-13/lib/tebako-test.rb +20 -0
- data/tests/test-13/tebako-test.gemspec +15 -0
- data/tests/test-15/Gemfile +8 -0
- data/tests/test-15/Rakefile +4 -0
- data/tests/test-15/bin/tebako-test-run.rb +10 -0
- data/tests/test-15/lib/tebako/bundle/test/version.rb +9 -0
- data/tests/test-15/lib/tebako/bundle/test.rb +29 -0
- data/tests/test-15/tebako-bundle-test.gemspec +30 -0
- data/tests/test-16/Gemfile +8 -0
- data/tests/test-16/Rakefile +4 -0
- data/tests/test-16/bin/tebako-test-run.rb +10 -0
- data/tests/test-16/lib/tebako/bundle/test/version.rb +9 -0
- data/tests/test-16/lib/tebako/bundle/test.rb +29 -0
- data/tests/test-16/tebako-bundle-test.gemspec +24 -0
- data/tests/test-18/Gemfile +5 -0
- data/tests/test-18/tebako-test-run.rb +12 -0
- data/tests/test-19/Gemfile +6 -0
- data/tests/test-19/tebako-test-run.rb +11 -0
- data/tests-2/fixtures/gems-bundler/Gemfile +4 -0
- data/tests-2/fixtures/gems-bundler/gems-bundler.rb +34 -0
- data/tests-2/fixtures/gems-byebug/Gemfile +5 -0
- data/tests-2/fixtures/gems-byebug/gems-byebug.rb +31 -0
- data/tests-2/fixtures/gems-expressir/Gemfile +7 -0
- data/tests-2/fixtures/gems-expressir/gems-expressir.rb +33 -0
- data/tests-2/fixtures/gems-libmspack/Gemfile +5 -0
- data/tests-2/fixtures/gems-libmspack/gems-libmspack.rb +91 -0
- data/tests-2/fixtures/gems-sassc/Gemfile +6 -0
- data/tests-2/fixtures/gems-sassc/base_style/all.scss +1 -0
- data/tests-2/fixtures/gems-sassc/base_style/reset.scss +100 -0
- data/tests-2/fixtures/gems-sassc/gems-sassc.rb +129 -0
- data/tests-2/fixtures/gems-seven-zip/Gemfile +7 -0
- data/tests-2/fixtures/gems-seven-zip/gems-seven-zip.rb +53 -0
- data/tests-2/fixtures/launcher-coreincl/launcher-coreincl.rb +29 -0
- data/tests-2/fixtures/launcher-package/launcher-package.rb +29 -0
- data/tests-2/fixtures/launcher-pwd/launcher-pwd.rb +28 -0
- data/tests-2/fixtures/launcher-stdinredir/input.txt +1 -0
- data/tests-2/fixtures/launcher-stdinredir/launcher-stdinredir.rb +31 -0
- data/tests-2/fixtures/launcher-stdoutredir/launcher-stdoutredir.rb +28 -0
- data/tests-2/fixtures/patches-dir/level-1/level-2/file-1.txt +1 -0
- data/tests-2/fixtures/patches-dir/level-1/level-2/file-2.txt +1 -0
- data/tests-2/fixtures/patches-dir/level-1/level-2/file-3.txt +1 -0
- data/tests-2/fixtures/patches-dir/patches-dir.rb +154 -0
- data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-1.txt +1 -0
- data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-2.txt +2 -0
- data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-3.txt +1 -0
- data/tests-2/fixtures/patches-io-and-file/level-1/link-3 +1 -0
- data/tests-2/fixtures/patches-io-and-file/patches-io-and-file.rb +87 -0
- data/tests-2/fixtures/patches-main/patches-main.rb +6 -0
- data/tests-2/tebako-test.rb +312 -0
- metadata +170 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "tebako-test"
|
|
5
|
+
s.version = "0.0.1"
|
|
6
|
+
s.summary = "A simple gem for tebako testing"
|
|
7
|
+
s.authors = ["Ribose"]
|
|
8
|
+
s.email = ["open.source@ribose.com"]
|
|
9
|
+
s.files = ["bin/tebako-test-run.rb", "lib/tebako-test.rb"]
|
|
10
|
+
s.homepage = "https://github.com/tamitebako"
|
|
11
|
+
s.license = "Unlicense"
|
|
12
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
13
|
+
s.add_dependency "text-table", "~> 1.2.4"
|
|
14
|
+
s.executables << "tebako-test-run.rb"
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "tebako-test"
|
|
5
|
+
s.version = "0.0.1"
|
|
6
|
+
s.summary = "A simple gem for tebako testing"
|
|
7
|
+
s.authors = ["Ribose"]
|
|
8
|
+
s.email = ["open.source@ribose.com"]
|
|
9
|
+
s.files = ["bin/tebako-test-run.rb", "lib/tebako-test.rb"]
|
|
10
|
+
s.homepage = "https://github.com/tamitebako"
|
|
11
|
+
s.license = "Unlicense"
|
|
12
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
13
|
+
s.add_dependency "text-table", "~> 1.2.4"
|
|
14
|
+
s.executables << "tebako-test-run.rb"
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "tebako-test"
|
|
5
|
+
s.version = "0.0.1"
|
|
6
|
+
s.summary = "A simple gem for tebako testing"
|
|
7
|
+
s.authors = ["Ribose"]
|
|
8
|
+
s.email = ["open.source@ribose.com"]
|
|
9
|
+
s.files = ["bin/tebako-test-run.rb", "lib/tebako-test.rb"]
|
|
10
|
+
s.homepage = "https://github.com/tamitebako"
|
|
11
|
+
s.license = "Unlicense"
|
|
12
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
13
|
+
s.add_dependency "text-table", "~> 1.2.4"
|
|
14
|
+
s.executables << "tebako-test-run.rb"
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "text-table"
|
|
4
|
+
|
|
5
|
+
# Tebako test class
|
|
6
|
+
class TebakoTest
|
|
7
|
+
def msg
|
|
8
|
+
table = Text::Table.new
|
|
9
|
+
table.head = %w[A B]
|
|
10
|
+
table.rows = [%w[a1 b1]]
|
|
11
|
+
table.rows << %w[a2 b2]
|
|
12
|
+
puts table
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def run!
|
|
16
|
+
puts "Hello! This is test-11 talking from inside DwarFS"
|
|
17
|
+
puts "You will now see a nice table that will be drawn for you by text-table gem."
|
|
18
|
+
msg
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "tebako-test"
|
|
5
|
+
s.version = "0.0.1"
|
|
6
|
+
s.summary = "A simple gem for tebako testing"
|
|
7
|
+
s.authors = ["Ribose"]
|
|
8
|
+
s.email = open.source @ribose.com
|
|
9
|
+
s.files = ["bin/tebako-test-run.rb", "lib/tebako-test.rb"]
|
|
10
|
+
s.homepage = "https://github.com/tamitebako"
|
|
11
|
+
s.license = "Unlicense"
|
|
12
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
13
|
+
s.add_dependency "text-table", "~> 1.2.4"
|
|
14
|
+
s.executables << "tebako-test-run.rb"
|
|
15
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "text-table"
|
|
4
|
+
require_relative "test/version"
|
|
5
|
+
|
|
6
|
+
module Tebako
|
|
7
|
+
module Bundle
|
|
8
|
+
module Test
|
|
9
|
+
class Error < StandardError; end
|
|
10
|
+
|
|
11
|
+
# Tebako test class
|
|
12
|
+
class TebakoTest
|
|
13
|
+
def msg
|
|
14
|
+
table = Text::Table.new
|
|
15
|
+
table.head = %w[A B]
|
|
16
|
+
table.rows = [%w[a1 b1]]
|
|
17
|
+
table.rows << %w[a2 b2]
|
|
18
|
+
puts table
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def run!
|
|
22
|
+
puts "Hello! This is test-15 talking from inside DwarFS"
|
|
23
|
+
puts "You will now see a nice table that will be drawn for you by text-table gem."
|
|
24
|
+
msg
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/tebako/bundle/test/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "tebako-bundle-test"
|
|
7
|
+
spec.version = Tebako::Bundle::Test::VERSION
|
|
8
|
+
spec.authors = ["Ribose"]
|
|
9
|
+
spec.email = ["open.source@ribose.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "A simple gem for tebako testing"
|
|
12
|
+
spec.homepage = "https://github.com/tamitebako"
|
|
13
|
+
spec.license = "Unlicense"
|
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
|
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
19
|
+
# spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
20
|
+
# `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
|
21
|
+
# end
|
|
22
|
+
|
|
23
|
+
spec.files = Dir["bin/**/*.rb"] + Dir["lib/**/*.rb"]
|
|
24
|
+
|
|
25
|
+
spec.bindir = "bin"
|
|
26
|
+
spec.executables << "tebako-test-run.rb"
|
|
27
|
+
spec.require_paths = %w[bin lib]
|
|
28
|
+
|
|
29
|
+
spec.add_dependency "text-table", "~> 1.2.4"
|
|
30
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "text-table"
|
|
4
|
+
require_relative "test/version"
|
|
5
|
+
|
|
6
|
+
module Tebako
|
|
7
|
+
module Bundle
|
|
8
|
+
module Test
|
|
9
|
+
class Error < StandardError; end
|
|
10
|
+
|
|
11
|
+
# Tebako test class
|
|
12
|
+
class TebakoTest
|
|
13
|
+
def msg
|
|
14
|
+
table = Text::Table.new
|
|
15
|
+
table.head = %w[A B]
|
|
16
|
+
table.rows = [%w[a1 b1]]
|
|
17
|
+
table.rows << %w[a2 b2]
|
|
18
|
+
puts table
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def run!
|
|
22
|
+
puts "Hello! This is test-15 talking from inside DwarFS"
|
|
23
|
+
puts "You will now see a nice table that will be drawn for you by text-table gem."
|
|
24
|
+
msg
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/tebako/bundle/test/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "tebako-bundle-test"
|
|
7
|
+
spec.version = Tebako::Bundle::Test::VERSION
|
|
8
|
+
spec.authors = ["Ribose"]
|
|
9
|
+
spec.email = open.source @ribose.com
|
|
10
|
+
|
|
11
|
+
spec.summary = "A simple gem for tebako testing"
|
|
12
|
+
spec.homepage = "https://github.com/tamitebako"
|
|
13
|
+
spec.license = "Unlicense"
|
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
|
|
17
|
+
spec.files = Dir["bin/**/*.rb"] + Dir["lib/**/*.rb"]
|
|
18
|
+
|
|
19
|
+
spec.bindir = "bin"
|
|
20
|
+
spec.executables << "tebako-test-run.rb"
|
|
21
|
+
spec.require_paths = %w[bin lib]
|
|
22
|
+
|
|
23
|
+
spec.add_dependency "text-table", "~> 1.2.4"
|
|
24
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "text-table"
|
|
4
|
+
|
|
5
|
+
table = Text::Table.new
|
|
6
|
+
table.head = %w[A B]
|
|
7
|
+
table.rows = [%w[a1 b1]]
|
|
8
|
+
table.rows << %w[a2 b2]
|
|
9
|
+
|
|
10
|
+
puts "Hello! This is test-18 talking from inside DwarFS"
|
|
11
|
+
puts "You will now see a nice table that will be drawn for you by text-table gem."
|
|
12
|
+
puts table
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ffi"
|
|
4
|
+
|
|
5
|
+
# Tebako test module
|
|
6
|
+
module TebakoTest
|
|
7
|
+
extend FFI::Library
|
|
8
|
+
ffi_lib FFI::Library::LIBC
|
|
9
|
+
attach_function("cputs", "puts", [:string], :int)
|
|
10
|
+
end
|
|
11
|
+
TebakoTest.cputs("Hello, World via libc puts using FFI on tebako package")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021-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 "rubygems"
|
|
29
|
+
require "bundler"
|
|
30
|
+
# requires 'bundler/setup'
|
|
31
|
+
require "rake"
|
|
32
|
+
|
|
33
|
+
# Just make sure the constant exists
|
|
34
|
+
puts "Hello! Bundler welcomes you to the magic world of ruby gems."
|
|
@@ -0,0 +1,31 @@
|
|
|
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 "byebug"
|
|
29
|
+
|
|
30
|
+
# Just make sure the constant exists
|
|
31
|
+
puts "Hello! Byebug welcomes you to the magic world of ruby gems."
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2022-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
|
+
# This test is inspired packed-mn
|
|
29
|
+
# https://github.com/metanorma/packed-mn
|
|
30
|
+
|
|
31
|
+
require "expressir/express/parser"
|
|
32
|
+
|
|
33
|
+
puts "Hello! Expressir gem welcomes you to the magic world of ruby gems."
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2022-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 "rubygems"
|
|
29
|
+
require "bundler/setup"
|
|
30
|
+
require "tempfile"
|
|
31
|
+
|
|
32
|
+
COMPILER_MEMFS = "/__tebako_memfs__"
|
|
33
|
+
|
|
34
|
+
# https://github.com/pmq20/ruby-packer/blob/master/lib/compiler/constants.rb#L10
|
|
35
|
+
COMPILER_MEMFS_LIB_CACHE = Pathname.new(Dir.mktmpdir("tebako-tests-"))
|
|
36
|
+
at_exit do
|
|
37
|
+
FileUtils.remove_dir(COMPILER_MEMFS_LIB_CACHE.to_path, true)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Extension for String class
|
|
41
|
+
# Operations with quotes
|
|
42
|
+
class String
|
|
43
|
+
def quoted?
|
|
44
|
+
start_with?('"') && end_with?('"')
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def unquote
|
|
48
|
+
chomp('"').reverse.chomp('"').reverse
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def quote
|
|
52
|
+
"\"#{self}\""
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def extract_memfs(file, wild: false, extract_path: COMPILER_MEMFS_LIB_CACHE)
|
|
57
|
+
is_quoted = file.quoted?
|
|
58
|
+
file = file.unquote if is_quoted
|
|
59
|
+
|
|
60
|
+
return file unless File.exist?(file) && file.start_with?(COMPILER_MEMFS)
|
|
61
|
+
|
|
62
|
+
memfs_extracted_file = extract_path + File.basename(file)
|
|
63
|
+
unless memfs_extracted_file.exist?
|
|
64
|
+
files = wild ? Dir.glob("#{File.dirname(file)}/*#{File.extname(file)}") : [file]
|
|
65
|
+
FileUtils.cp_r files, extract_path
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
is_quoted ? memfs_extracted_file.to_path.quote : memfs_extracted_file.to_path
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
require "ffi"
|
|
72
|
+
|
|
73
|
+
# HACK: extract temp libraries to use with ffi
|
|
74
|
+
# Wrapper for FFI.map_library_name method
|
|
75
|
+
module FFI
|
|
76
|
+
# https://stackoverflow.com/questions/29907157/how-to-alias-a-class-method-in-rails-model/29907207
|
|
77
|
+
singleton_class.send(:alias_method, :map_library_name_orig, :map_library_name)
|
|
78
|
+
|
|
79
|
+
# http://tech.tulentsev.com/2012/02/ruby-how-to-override-class-method-with-a-module/
|
|
80
|
+
def self.map_library_name(lib)
|
|
81
|
+
l = extract_memfs(lib)
|
|
82
|
+
puts "#{lib} ==> #{l}"
|
|
83
|
+
ll = map_library_name_orig(l)
|
|
84
|
+
puts "#{lib} ==> #{l} ==> #{ll}"
|
|
85
|
+
ll
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
# END of HACK
|
|
89
|
+
|
|
90
|
+
require "libmspack"
|
|
91
|
+
puts "Hello! libmspack welcomes you to the magic world of ruby gems."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'base_style/reset';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
html, body, div, span, applet, object, iframe,
|
|
2
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
3
|
+
a, abbr, acronym, address, big, cite, code,
|
|
4
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
5
|
+
small, strike, strong, sub, sup, tt, var,
|
|
6
|
+
b, u, i, center,
|
|
7
|
+
ol, ul, li,
|
|
8
|
+
fieldset, form, label, legend,
|
|
9
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
10
|
+
article, aside, canvas, details, embed,
|
|
11
|
+
figure, figcaption, footer, header, hgroup,
|
|
12
|
+
menu, output, ruby, section, summary,
|
|
13
|
+
time, mark, audio, video {
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
html, body, div, span, applet, object, iframe,
|
|
19
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
20
|
+
a, abbr, acronym, address, big, cite, code,
|
|
21
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
22
|
+
small, strike, strong, sub, sup, tt, var,
|
|
23
|
+
b, u, i, center,
|
|
24
|
+
dl, dt, dd, ol, ul, li,
|
|
25
|
+
fieldset, form, label, legend,
|
|
26
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
27
|
+
article, aside, canvas, details, embed,
|
|
28
|
+
figure, figcaption, footer, header, hgroup,
|
|
29
|
+
menu, nav, output, ruby, section, summary,
|
|
30
|
+
time, mark, audio, video {
|
|
31
|
+
border: 0;
|
|
32
|
+
font-size: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
html, body, div, span, applet, object, iframe,
|
|
36
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
37
|
+
a, abbr, acronym, address, big, cite, code,
|
|
38
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
39
|
+
small, strike, strong, tt, var,
|
|
40
|
+
b, u, i, center,
|
|
41
|
+
dl, dd, ol, ul, li,
|
|
42
|
+
fieldset, form, label, legend,
|
|
43
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
44
|
+
article, aside, canvas, details, embed,
|
|
45
|
+
figure, figcaption, footer, header, hgroup,
|
|
46
|
+
menu, nav, output, ruby, section, summary,
|
|
47
|
+
time, mark, audio, video {
|
|
48
|
+
vertical-align: baseline;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
article, aside, details, figcaption, figure,
|
|
52
|
+
footer, header, hgroup, menu, nav, section {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
table {
|
|
57
|
+
border-collapse: collapse;
|
|
58
|
+
border-spacing: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
dl {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: max-content auto;
|
|
64
|
+
|
|
65
|
+
dt, dd {
|
|
66
|
+
p {
|
|
67
|
+
margin-top: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
dt {
|
|
72
|
+
grid-column-start: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
dd {
|
|
76
|
+
grid-column-start: 2;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
b, strong {
|
|
81
|
+
font-weight: bold;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
div.document-stage-band, div.document-type-band {
|
|
85
|
+
background-color: #333333;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
a.FootnoteRef + a.FootnoteRef:before {
|
|
89
|
+
content: ", ";
|
|
90
|
+
vertical-align: super;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.addition {
|
|
94
|
+
color: blue;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.deletion {
|
|
98
|
+
color: red;
|
|
99
|
+
text-decoration: line-through;
|
|
100
|
+
}
|