thermite-ruby3-fork-dont-use 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +29 -0
- data/.ruby-version +1 -0
- data/.yardopts +2 -0
- data/CONTRIBUTING.md +67 -0
- data/Gemfile +9 -0
- data/LICENSE +9 -0
- data/NEWS.md +180 -0
- data/README.md +144 -0
- data/Rakefile +32 -0
- data/lib/thermite/cargo.rb +125 -0
- data/lib/thermite/config.rb +293 -0
- data/lib/thermite/custom_binary.rb +66 -0
- data/lib/thermite/fiddle.rb +45 -0
- data/lib/thermite/github_release_binary.rb +125 -0
- data/lib/thermite/package.rb +96 -0
- data/lib/thermite/semver.rb +50 -0
- data/lib/thermite/tasks.rb +160 -0
- data/lib/thermite/util.rb +59 -0
- data/test/fixtures/config/Cargo.toml +5 -0
- data/test/fixtures/github/releases.atom +30 -0
- data/test/lib/thermite/cargo_test.rb +95 -0
- data/test/lib/thermite/config_test.rb +239 -0
- data/test/lib/thermite/custom_binary_test.rb +59 -0
- data/test/lib/thermite/github_release_binary_test.rb +160 -0
- data/test/lib/thermite/package_test.rb +119 -0
- data/test/lib/thermite/semver_test.rb +58 -0
- data/test/lib/thermite/util_test.rb +55 -0
- data/test/test_helper.rb +57 -0
- data/thermite.gemspec +27 -0
- metadata +184 -0
@@ -0,0 +1,160 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
12
|
+
# substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
18
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
|
20
|
+
require 'tmpdir'
|
21
|
+
require 'test_helper'
|
22
|
+
require 'thermite/github_release_binary'
|
23
|
+
require 'thermite/util'
|
24
|
+
|
25
|
+
module Thermite
|
26
|
+
class GithubReleaseBinaryTest < Minitest::Test
|
27
|
+
include Thermite::ModuleTester
|
28
|
+
|
29
|
+
class Tester
|
30
|
+
include Thermite::GithubReleaseBinary
|
31
|
+
include Thermite::TestHelper
|
32
|
+
include Thermite::Util
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_no_downloading_when_github_releases_is_false
|
36
|
+
mock_module(github_releases: false)
|
37
|
+
mock_module.expects(:download_latest_binary_from_github_release).never
|
38
|
+
mock_module.expects(:download_cargo_version_from_github_release).never
|
39
|
+
|
40
|
+
assert !mock_module.download_binary_from_github_release
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_github_release_type_defaults_to_cargo
|
44
|
+
mock_module(github_releases: true)
|
45
|
+
mock_module.expects(:download_latest_binary_from_github_release).never
|
46
|
+
mock_module.expects(:download_cargo_version_from_github_release).once
|
47
|
+
|
48
|
+
mock_module.download_binary_from_github_release
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_download_cargo_version_from_github_release
|
52
|
+
mock_module(github_releases: true)
|
53
|
+
mock_module.config.stubs(:toml).returns(package: { version: '4.5.6' })
|
54
|
+
stub_github_download_uri('v4.5.6')
|
55
|
+
Net::HTTP.stubs(:get_response).returns('location' => 'redirect')
|
56
|
+
mock_module.stubs(:http_get).returns('tarball')
|
57
|
+
mock_module.expects(:unpack_tarball).once
|
58
|
+
mock_module.expects(:prepare_downloaded_library).once
|
59
|
+
|
60
|
+
assert mock_module.download_binary_from_github_release
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_download_cargo_version_from_github_release_with_custom_git_tag_format
|
64
|
+
mock_module(github_releases: true, git_tag_format: 'VER_%s')
|
65
|
+
mock_module.config.stubs(:toml).returns(package: { version: '4.5.6' })
|
66
|
+
stub_github_download_uri('VER_4.5.6')
|
67
|
+
Net::HTTP.stubs(:get_response).returns('location' => 'redirect')
|
68
|
+
mock_module.stubs(:http_get).returns('tarball')
|
69
|
+
mock_module.expects(:unpack_tarball).once
|
70
|
+
mock_module.expects(:prepare_downloaded_library).once
|
71
|
+
|
72
|
+
assert mock_module.download_binary_from_github_release
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_download_cargo_version_from_github_release_with_no_repository
|
76
|
+
mock_module(github_releases: true)
|
77
|
+
mock_module.config.stubs(:toml).returns(package: { version: '4.5.6' })
|
78
|
+
|
79
|
+
assert_raises KeyError do
|
80
|
+
mock_module.download_binary_from_github_release
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_download_cargo_version_from_github_release_with_client_error
|
85
|
+
mock_module(github_releases: true)
|
86
|
+
mock_module.config.stubs(:toml).returns(
|
87
|
+
package: {
|
88
|
+
repository: 'test/test',
|
89
|
+
version: '4.5.6'
|
90
|
+
}
|
91
|
+
)
|
92
|
+
Net::HTTP.stubs(:get_response).returns(Net::HTTPClientError.new('1.1', 403, 'Forbidden'))
|
93
|
+
|
94
|
+
assert !mock_module.download_binary_from_github_release
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_download_cargo_version_from_github_release_with_server_error
|
98
|
+
mock_module(github_releases: true)
|
99
|
+
mock_module.config.stubs(:toml).returns(
|
100
|
+
package: {
|
101
|
+
repository: 'test/test',
|
102
|
+
version: '4.5.6'
|
103
|
+
}
|
104
|
+
)
|
105
|
+
server_error = Net::HTTPServerError.new('1.1', 500, 'Internal Server Error')
|
106
|
+
Net::HTTP.stubs(:get_response).returns(server_error)
|
107
|
+
|
108
|
+
assert_raises Net::HTTPServerException do
|
109
|
+
mock_module.download_binary_from_github_release
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_download_latest_binary_from_github_release
|
114
|
+
mock_module(github_releases: true, github_release_type: 'latest', git_tag_regex: 'v(.*)_rust')
|
115
|
+
stub_releases_atom
|
116
|
+
mock_module.stubs(:download_versioned_github_release_binary).returns(StringIO.new('tarball'))
|
117
|
+
mock_module.expects(:unpack_tarball).once
|
118
|
+
mock_module.expects(:prepare_downloaded_library).once
|
119
|
+
|
120
|
+
assert mock_module.download_binary_from_github_release
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_download_latest_binary_from_github_release_no_releases_match_regex
|
124
|
+
mock_module(github_releases: true, github_release_type: 'latest')
|
125
|
+
stub_releases_atom
|
126
|
+
mock_module.expects(:github_download_uri).never
|
127
|
+
|
128
|
+
assert !mock_module.download_binary_from_github_release
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_download_latest_binary_from_github_release_no_tarball_found
|
132
|
+
mock_module(github_releases: true, github_release_type: 'latest', git_tag_regex: 'v(.*)_rust')
|
133
|
+
stub_releases_atom
|
134
|
+
mock_module.stubs(:download_versioned_github_release_binary).returns(nil)
|
135
|
+
mock_module.expects(:unpack_tarball).never
|
136
|
+
mock_module.expects(:prepare_downloaded_library).never
|
137
|
+
|
138
|
+
assert !mock_module.download_binary_from_github_release
|
139
|
+
end
|
140
|
+
|
141
|
+
private
|
142
|
+
|
143
|
+
def described_class
|
144
|
+
Tester
|
145
|
+
end
|
146
|
+
|
147
|
+
def stub_github_download_uri(tag)
|
148
|
+
uri = 'https://github.com/user/project/downloads/project-4.5.6.tar.gz'
|
149
|
+
mock_module.expects(:github_download_uri).with(tag, '4.5.6').returns(uri)
|
150
|
+
end
|
151
|
+
|
152
|
+
def stub_releases_atom
|
153
|
+
atom = File.read(fixtures_path('github', 'releases.atom'))
|
154
|
+
project_uri = 'https://github.com/user/project'
|
155
|
+
releases_uri = "#{project_uri}/releases.atom"
|
156
|
+
mock_module.config.stubs(:toml).returns(package: { repository: project_uri })
|
157
|
+
mock_module.expects(:http_get).with(releases_uri).returns(atom)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
12
|
+
# substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
18
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
|
20
|
+
require 'fileutils'
|
21
|
+
require 'tmpdir'
|
22
|
+
require 'test_helper'
|
23
|
+
require 'thermite/package'
|
24
|
+
require 'thermite/util'
|
25
|
+
|
26
|
+
module Thermite
|
27
|
+
class PackageTest < Minitest::Test
|
28
|
+
include Thermite::ModuleTester
|
29
|
+
|
30
|
+
class Tester
|
31
|
+
include Thermite::Package
|
32
|
+
include Thermite::TestHelper
|
33
|
+
include Thermite::Util
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_build_package_and_unpack_tarball
|
37
|
+
using_temp_dir do |dir, tgz_filename|
|
38
|
+
using_project_dir(stub_dir(dir, 'project')) do |project_dir|
|
39
|
+
extension_path = stub_extension_path(project_dir)
|
40
|
+
stub_config(project_dir, extension_path, tgz_filename)
|
41
|
+
|
42
|
+
mock_module.build_package
|
43
|
+
FileUtils.rm_f(extension_path)
|
44
|
+
|
45
|
+
# This simulates having an extension build via `install/Rakefile` instead of the
|
46
|
+
# top-level Rakefile.
|
47
|
+
using_install_dir(stub_dir(dir, 'install')) do
|
48
|
+
assert_file_created(extension_path) do
|
49
|
+
File.open(tgz_filename, 'rb') do |f|
|
50
|
+
mock_module.unpack_tarball(f)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
assert_equal 'some extension', File.read(extension_path)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def described_class
|
62
|
+
Tester
|
63
|
+
end
|
64
|
+
|
65
|
+
def stub_config(project_dir, extension_path, filename)
|
66
|
+
mock_module.config.stubs(:ruby_toplevel_dir).returns(project_dir)
|
67
|
+
mock_module.config.stubs(:ruby_extension_path).returns(extension_path)
|
68
|
+
mock_module.config.stubs(:toml).returns(package: { version: '7.8.9' })
|
69
|
+
mock_module.config.stubs(:tarball_filename).with('7.8.9').returns(filename)
|
70
|
+
end
|
71
|
+
|
72
|
+
def stub_dir(base, name)
|
73
|
+
subdir = File.join(base, name)
|
74
|
+
Dir.mkdir(subdir)
|
75
|
+
|
76
|
+
subdir
|
77
|
+
end
|
78
|
+
|
79
|
+
def stub_extension_path(dir)
|
80
|
+
extension_path = File.join(dir, 'lib', 'test.txt')
|
81
|
+
Dir.mkdir(File.dirname(extension_path))
|
82
|
+
File.write(extension_path, 'some extension')
|
83
|
+
|
84
|
+
extension_path
|
85
|
+
end
|
86
|
+
|
87
|
+
def using_project_dir(project_dir)
|
88
|
+
yield project_dir
|
89
|
+
ensure
|
90
|
+
FileUtils.rm_rf(project_dir)
|
91
|
+
end
|
92
|
+
|
93
|
+
def using_install_dir(install_dir)
|
94
|
+
Dir.mkdir(File.join(install_dir, 'lib'))
|
95
|
+
Dir.chdir(install_dir) do
|
96
|
+
yield install_dir
|
97
|
+
end
|
98
|
+
ensure
|
99
|
+
FileUtils.rm_rf(install_dir)
|
100
|
+
end
|
101
|
+
|
102
|
+
def using_temp_dir
|
103
|
+
Dir.mktmpdir do |dir|
|
104
|
+
filename = File.join(dir, 'test-7.8.9.tar.gz')
|
105
|
+
begin
|
106
|
+
yield dir, filename
|
107
|
+
ensure
|
108
|
+
FileUtils.rm_f(filename)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def assert_file_created(filename)
|
114
|
+
refute File.exist?(filename), "File '#{filename}' already exists."
|
115
|
+
yield
|
116
|
+
assert File.exist?(filename), "File '#{filename}' does not exist."
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 Mark Lee and contributors
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
12
|
+
# substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
18
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
|
20
|
+
require 'thermite/semver'
|
21
|
+
|
22
|
+
module Thermite
|
23
|
+
class SemVerTest < Minitest::Test
|
24
|
+
def test_valid_semantic_versions
|
25
|
+
# From https://github.com/malept/thermite/pull/45
|
26
|
+
assert semantic_version_regexp.match('0.3.2')
|
27
|
+
assert semantic_version_regexp.match('v0.3.2')
|
28
|
+
assert semantic_version_regexp.match('0.3.0-rc1')
|
29
|
+
assert semantic_version_regexp.match('0.3.0-rc.1')
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_invalid_semantic_versions
|
33
|
+
# From https://github.com/malept/thermite/pull/45
|
34
|
+
assert_nil semantic_version_regexp.match('v0.3.2.beta13')
|
35
|
+
assert_nil semantic_version_regexp.match('0.5.3.alpha1')
|
36
|
+
assert_nil semantic_version_regexp.match('0.5.3.1')
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_valid_semantic_prerelease_versions
|
40
|
+
# From https://semver.org/spec/v2.0.0.html#spec-item-9
|
41
|
+
assert semantic_version_regexp.match('1.0.0-alpha')
|
42
|
+
assert semantic_version_regexp.match('1.0.0-alpha.1')
|
43
|
+
assert semantic_version_regexp.match('1.0.0-0.3.7')
|
44
|
+
assert semantic_version_regexp.match('1.0.0-x.7.z.92')
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_valid_semantic_build_metadata_versions
|
48
|
+
# From https://semver.org/spec/v2.0.0.html#spec-item-10
|
49
|
+
assert semantic_version_regexp.match('1.0.0-alpha+001')
|
50
|
+
assert semantic_version_regexp.match('1.0.0+20130313144700')
|
51
|
+
assert semantic_version_regexp.match('1.0.0-beta+exp.sha.5114f85')
|
52
|
+
end
|
53
|
+
|
54
|
+
def semantic_version_regexp
|
55
|
+
@semantic_version_regexp ||= /^#{Thermite::SemVer::VERSION}$/
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
12
|
+
# substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
18
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
|
20
|
+
require 'tempfile'
|
21
|
+
require 'test_helper'
|
22
|
+
require 'thermite/util'
|
23
|
+
|
24
|
+
module Thermite
|
25
|
+
class UtilTest < Minitest::Test
|
26
|
+
include Thermite::ModuleTester
|
27
|
+
|
28
|
+
class Tester
|
29
|
+
include Thermite::TestHelper
|
30
|
+
include Thermite::Util
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_debug
|
34
|
+
stub_debug_filename(nil)
|
35
|
+
mock_module.debug('will not exist')
|
36
|
+
debug_file = Tempfile.new('thermite_test')
|
37
|
+
stub_debug_filename(debug_file.path)
|
38
|
+
mock_module.debug('some message')
|
39
|
+
mock_module.instance_variable_get('@debug').flush
|
40
|
+
debug_file.rewind
|
41
|
+
assert_equal "some message\n", debug_file.read
|
42
|
+
ensure
|
43
|
+
debug_file.close
|
44
|
+
debug_file.unlink
|
45
|
+
end
|
46
|
+
|
47
|
+
def stub_debug_filename(value)
|
48
|
+
mock_module.config.stubs(:debug_filename).returns(value)
|
49
|
+
end
|
50
|
+
|
51
|
+
def described_class
|
52
|
+
Tester
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
12
|
+
# substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
18
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
|
+
|
20
|
+
require 'simplecov'
|
21
|
+
SimpleCov.start do
|
22
|
+
load_profile 'test_frameworks'
|
23
|
+
add_filter 'lib/thermite/fiddle.rb'
|
24
|
+
add_filter 'lib/thermite/tasks.rb'
|
25
|
+
track_files 'lib/**/*.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
ENV['THERMITE_TEST'] = '1'
|
29
|
+
|
30
|
+
require 'minitest/autorun'
|
31
|
+
require 'mocha/minitest'
|
32
|
+
require 'thermite/config'
|
33
|
+
|
34
|
+
module Minitest
|
35
|
+
class Test
|
36
|
+
def fixtures_path(*components)
|
37
|
+
File.join(File.dirname(__FILE__), 'fixtures', *components)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Thermite
|
43
|
+
module ModuleTester
|
44
|
+
def mock_module(options = {})
|
45
|
+
@mock_module ||= described_class.new(options)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
module TestHelper
|
50
|
+
attr_reader :config, :options
|
51
|
+
|
52
|
+
def initialize(options = {})
|
53
|
+
@options = options
|
54
|
+
@config = Thermite::Config.new(@options)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/thermite.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'English'
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'thermite-ruby3-fork-dont-use'
|
5
|
+
s.version = '0.14.0'
|
6
|
+
s.summary = 'Rake helpers for Rust+Ruby'
|
7
|
+
s.description = 'A Rake-based helper for building and distributing Rust-based Ruby extensions'
|
8
|
+
|
9
|
+
s.authors = ['Mark Lee']
|
10
|
+
s.email = 'malept@users.noreply.github.com'
|
11
|
+
s.homepage = 'https://github.com/Mayurifag/thermite-ruby3-fork-dont-use'
|
12
|
+
s.license = 'MIT'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
15
|
+
s.require_paths = %w[lib]
|
16
|
+
|
17
|
+
s.required_ruby_version = '>= 2.7'
|
18
|
+
|
19
|
+
s.add_runtime_dependency 'minitar', '~> 0.9'
|
20
|
+
s.add_runtime_dependency 'rake', '~> 13.0'
|
21
|
+
s.add_runtime_dependency 'rexml', '~> 3.2'
|
22
|
+
s.add_runtime_dependency 'tomlrb', '~> 2.0'
|
23
|
+
s.add_development_dependency 'minitest', '~> 5.14'
|
24
|
+
s.add_development_dependency 'mocha', '~> 1.12'
|
25
|
+
s.add_development_dependency 'rubocop', '~> 1.13'
|
26
|
+
s.add_development_dependency 'yard', '~> 0.9'
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,184 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: thermite-ruby3-fork-dont-use
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.14.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mark Lee
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitar
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rexml
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: tomlrb
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.14'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.14'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mocha
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.12'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.12'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.13'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.13'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.9'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.9'
|
125
|
+
description: A Rake-based helper for building and distributing Rust-based Ruby extensions
|
126
|
+
email: malept@users.noreply.github.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- ".gitignore"
|
132
|
+
- ".rubocop.yml"
|
133
|
+
- ".ruby-version"
|
134
|
+
- ".yardopts"
|
135
|
+
- CONTRIBUTING.md
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE
|
138
|
+
- NEWS.md
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- lib/thermite/cargo.rb
|
142
|
+
- lib/thermite/config.rb
|
143
|
+
- lib/thermite/custom_binary.rb
|
144
|
+
- lib/thermite/fiddle.rb
|
145
|
+
- lib/thermite/github_release_binary.rb
|
146
|
+
- lib/thermite/package.rb
|
147
|
+
- lib/thermite/semver.rb
|
148
|
+
- lib/thermite/tasks.rb
|
149
|
+
- lib/thermite/util.rb
|
150
|
+
- test/fixtures/config/Cargo.toml
|
151
|
+
- test/fixtures/github/releases.atom
|
152
|
+
- test/lib/thermite/cargo_test.rb
|
153
|
+
- test/lib/thermite/config_test.rb
|
154
|
+
- test/lib/thermite/custom_binary_test.rb
|
155
|
+
- test/lib/thermite/github_release_binary_test.rb
|
156
|
+
- test/lib/thermite/package_test.rb
|
157
|
+
- test/lib/thermite/semver_test.rb
|
158
|
+
- test/lib/thermite/util_test.rb
|
159
|
+
- test/test_helper.rb
|
160
|
+
- thermite.gemspec
|
161
|
+
homepage: https://github.com/Mayurifag/thermite-ruby3-fork-dont-use
|
162
|
+
licenses:
|
163
|
+
- MIT
|
164
|
+
metadata: {}
|
165
|
+
post_install_message:
|
166
|
+
rdoc_options: []
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '2.7'
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
requirements: []
|
180
|
+
rubygems_version: 3.4.10
|
181
|
+
signing_key:
|
182
|
+
specification_version: 4
|
183
|
+
summary: Rake helpers for Rust+Ruby
|
184
|
+
test_files: []
|