rake_dependencies 3.2.0.pre.1 → 3.2.0.pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +35 -6
- data/Rakefile +67 -45
- data/bin/console +4 -3
- data/lib/rake_dependencies/extractors.rb +195 -42
- data/lib/rake_dependencies/kernel_extensions.rb +2 -0
- data/lib/rake_dependencies/platform_names.rb +6 -2
- data/lib/rake_dependencies/task_sets/all.rb +37 -24
- data/lib/rake_dependencies/task_sets.rb +3 -1
- data/lib/rake_dependencies/tasks/clean.rb +7 -5
- data/lib/rake_dependencies/tasks/download.rb +12 -13
- data/lib/rake_dependencies/tasks/ensure.rb +6 -4
- data/lib/rake_dependencies/tasks/extract.rb +61 -41
- data/lib/rake_dependencies/tasks/fetch.rb +7 -7
- data/lib/rake_dependencies/tasks/install.rb +17 -18
- data/lib/rake_dependencies/tasks.rb +2 -0
- data/lib/rake_dependencies/template.rb +8 -5
- data/lib/rake_dependencies/version.rb +3 -1
- data/lib/rake_dependencies.rb +2 -0
- data/rake_dependencies.gemspec +61 -0
- metadata +75 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7673875792fa643d0d18a5f5b643792d89fa184c501e9db8052de4399c603a6f
|
4
|
+
data.tar.gz: a1fb8a84cb4ad9c60a327a9218849c34fa2573ee007190d8155347f5b5bf8a6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd2a1a5320c1f4e76b67ddc723d6490bd0c388aed9a30a60b8de7b41c15e2257f8847c56c644ce994ab34a2524b1a0e930e8e5ba951d6871e1cb5fd03d5a09f8
|
7
|
+
data.tar.gz: 1bd4f1e7097dcf8c1e0fdf9b49c3adaf3bbd8691f2e3d3db8ddd7ab25a1ce1a2ab876df1b69420bee130f86355630ff456265fbd0353fb6e86fbcbfc256b0543
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rake_dependencies (3.2.0.pre.
|
4
|
+
rake_dependencies (3.2.0.pre.4)
|
5
|
+
down (~> 5.3)
|
5
6
|
hamster (~> 3.0)
|
6
7
|
minitar (~> 0.9)
|
7
8
|
rake_factory (~> 0.23)
|
@@ -17,11 +18,14 @@ GEM
|
|
17
18
|
tzinfo (~> 2.0)
|
18
19
|
addressable (2.8.0)
|
19
20
|
public_suffix (>= 2.0.2, < 5.0)
|
21
|
+
ast (2.4.2)
|
20
22
|
colored2 (3.1.2)
|
21
|
-
concurrent-ruby (1.1.
|
23
|
+
concurrent-ruby (1.1.10)
|
22
24
|
diff-lcs (1.5.0)
|
23
25
|
docile (1.4.0)
|
24
|
-
|
26
|
+
down (5.3.1)
|
27
|
+
addressable (~> 2.8)
|
28
|
+
excon (0.92.2)
|
25
29
|
fakefs (1.4.1)
|
26
30
|
faraday (1.10.0)
|
27
31
|
faraday-em_http (~> 1.0)
|
@@ -61,7 +65,11 @@ GEM
|
|
61
65
|
faraday (>= 0.9)
|
62
66
|
sawyer (~> 0.8.0, >= 0.5.3)
|
63
67
|
open4 (1.3.4)
|
68
|
+
parallel (1.22.1)
|
69
|
+
parser (3.1.1.0)
|
70
|
+
ast (~> 2.4.1)
|
64
71
|
public_suffix (4.0.6)
|
72
|
+
rainbow (3.1.1)
|
65
73
|
rake (13.0.6)
|
66
74
|
rake_circle_ci (0.9.0)
|
67
75
|
colored2 (~> 3.1)
|
@@ -83,6 +91,8 @@ GEM
|
|
83
91
|
colored2 (~> 3.1)
|
84
92
|
rake_factory (~> 0.23)
|
85
93
|
sshkey (~> 2.0)
|
94
|
+
regexp_parser (2.2.1)
|
95
|
+
rexml (3.2.5)
|
86
96
|
rspec (3.11.0)
|
87
97
|
rspec-core (~> 3.11.0)
|
88
98
|
rspec-expectations (~> 3.11.0)
|
@@ -92,10 +102,26 @@ GEM
|
|
92
102
|
rspec-expectations (3.11.0)
|
93
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
94
104
|
rspec-support (~> 3.11.0)
|
95
|
-
rspec-mocks (3.11.
|
105
|
+
rspec-mocks (3.11.1)
|
96
106
|
diff-lcs (>= 1.2.0, < 2.0)
|
97
107
|
rspec-support (~> 3.11.0)
|
98
108
|
rspec-support (3.11.0)
|
109
|
+
rubocop (1.26.1)
|
110
|
+
parallel (~> 1.10)
|
111
|
+
parser (>= 3.1.0.0)
|
112
|
+
rainbow (>= 2.2.2, < 4.0)
|
113
|
+
regexp_parser (>= 1.8, < 3.0)
|
114
|
+
rexml
|
115
|
+
rubocop-ast (>= 1.16.0, < 2.0)
|
116
|
+
ruby-progressbar (~> 1.7)
|
117
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
118
|
+
rubocop-ast (1.16.0)
|
119
|
+
parser (>= 3.1.1.0)
|
120
|
+
rubocop-rake (0.6.0)
|
121
|
+
rubocop (~> 1.0)
|
122
|
+
rubocop-rspec (2.9.0)
|
123
|
+
rubocop (~> 1.19)
|
124
|
+
ruby-progressbar (1.11.0)
|
99
125
|
ruby2_keywords (0.0.5)
|
100
126
|
ruby_gpg2 (0.8.0)
|
101
127
|
lino (>= 1.5)
|
@@ -112,10 +138,10 @@ GEM
|
|
112
138
|
sshkey (2.0.0)
|
113
139
|
tzinfo (2.0.4)
|
114
140
|
concurrent-ruby (~> 1.0)
|
141
|
+
unicode-display_width (2.1.0)
|
115
142
|
|
116
143
|
PLATFORMS
|
117
144
|
ruby
|
118
|
-
x86_64-darwin-19
|
119
145
|
|
120
146
|
DEPENDENCIES
|
121
147
|
activesupport
|
@@ -129,7 +155,10 @@ DEPENDENCIES
|
|
129
155
|
rake_gpg
|
130
156
|
rake_ssh
|
131
157
|
rspec
|
158
|
+
rubocop
|
159
|
+
rubocop-rake
|
160
|
+
rubocop-rspec
|
132
161
|
simplecov
|
133
162
|
|
134
163
|
BUNDLED WITH
|
135
|
-
2.3.
|
164
|
+
2.3.10
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'yaml'
|
2
4
|
require 'rake_circle_ci'
|
3
5
|
require 'rake_github'
|
@@ -5,17 +7,20 @@ require 'rake_ssh'
|
|
5
7
|
require 'rake_gpg'
|
6
8
|
require 'securerandom'
|
7
9
|
require 'rspec/core/rake_task'
|
10
|
+
require 'rubocop/rake_task'
|
8
11
|
|
9
|
-
task :
|
10
|
-
|
11
|
-
|
12
|
+
task default: %i[
|
13
|
+
library:fix
|
14
|
+
test:unit
|
15
|
+
]
|
12
16
|
|
13
17
|
namespace :encryption do
|
14
18
|
namespace :passphrase do
|
19
|
+
desc 'Generate encryption passphrase for CI GPG key'
|
15
20
|
task :generate do
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
FileUtils.mkdir_p('config/secrets/ci/')
|
22
|
+
File.write('config/secrets/ci/encryption.passphrase',
|
23
|
+
SecureRandom.base64(36))
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -23,85 +28,102 @@ end
|
|
23
28
|
namespace :keys do
|
24
29
|
namespace :deploy do
|
25
30
|
RakeSSH.define_key_tasks(
|
26
|
-
|
27
|
-
|
31
|
+
path: 'config/secrets/ci/',
|
32
|
+
comment: 'maintainers@infrablocks.io'
|
33
|
+
)
|
28
34
|
end
|
29
35
|
|
30
36
|
namespace :gpg do
|
31
37
|
RakeGPG.define_generate_key_task(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
output_directory: 'config/secrets/ci',
|
39
|
+
name_prefix: 'gpg',
|
40
|
+
owner_name: 'InfraBlocks Maintainers',
|
41
|
+
owner_email: 'maintainers@infrablocks.io',
|
42
|
+
owner_comment: 'rake_dependencies CI Key'
|
43
|
+
)
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
47
|
+
RuboCop::RakeTask.new
|
48
|
+
|
49
|
+
namespace :library do
|
50
|
+
desc 'Run all checks of the library'
|
51
|
+
task check: [:rubocop]
|
52
|
+
|
53
|
+
desc 'Attempt to automatically fix issues with the library'
|
54
|
+
task fix: [:'rubocop:auto_correct']
|
55
|
+
end
|
56
|
+
|
57
|
+
namespace :test do
|
58
|
+
RSpec::Core::RakeTask.new(:unit)
|
59
|
+
end
|
60
|
+
|
40
61
|
RakeCircleCI.define_project_tasks(
|
41
|
-
|
42
|
-
|
62
|
+
namespace: :circle_ci,
|
63
|
+
project_slug: 'github/infrablocks/rake_dependencies'
|
43
64
|
) do |t|
|
44
65
|
circle_ci_config =
|
45
|
-
|
66
|
+
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
46
67
|
|
47
|
-
t.api_token = circle_ci_config[
|
68
|
+
t.api_token = circle_ci_config['circle_ci_api_token']
|
48
69
|
t.environment_variables = {
|
49
|
-
|
50
|
-
|
51
|
-
|
70
|
+
ENCRYPTION_PASSPHRASE:
|
71
|
+
File.read('config/secrets/ci/encryption.passphrase')
|
72
|
+
.chomp
|
52
73
|
}
|
53
74
|
t.checkout_keys = []
|
54
75
|
t.ssh_keys = [
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
76
|
+
{
|
77
|
+
hostname: 'github.com',
|
78
|
+
private_key: File.read('config/secrets/ci/ssh.private')
|
79
|
+
}
|
59
80
|
]
|
60
81
|
end
|
61
82
|
|
62
83
|
RakeGithub.define_repository_tasks(
|
63
|
-
|
64
|
-
|
84
|
+
namespace: :github,
|
85
|
+
repository: 'infrablocks/rake_dependencies'
|
65
86
|
) do |t, args|
|
66
87
|
github_config =
|
67
|
-
|
88
|
+
YAML.load_file('config/secrets/github/config.yaml')
|
68
89
|
|
69
|
-
t.access_token = github_config[
|
90
|
+
t.access_token = github_config['github_personal_access_token']
|
70
91
|
t.deploy_keys = [
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
92
|
+
{
|
93
|
+
title: 'CircleCI',
|
94
|
+
public_key: File.read('config/secrets/ci/ssh.public')
|
95
|
+
}
|
75
96
|
]
|
76
97
|
t.branch_name = args.branch_name
|
77
98
|
t.commit_message = args.commit_message
|
78
99
|
end
|
79
100
|
|
80
101
|
namespace :pipeline do
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
102
|
+
desc 'Prepare CircleCI Pipeline'
|
103
|
+
task prepare: %i[
|
104
|
+
circle_ci:project:follow
|
105
|
+
circle_ci:env_vars:ensure
|
106
|
+
circle_ci:checkout_keys:ensure
|
107
|
+
circle_ci:ssh_keys:ensure
|
108
|
+
github:deploy_keys:ensure
|
87
109
|
]
|
88
110
|
end
|
89
111
|
|
90
112
|
namespace :version do
|
91
|
-
desc
|
113
|
+
desc 'Bump version for specified type (pre, major, minor, patch)'
|
92
114
|
task :bump, [:type] do |_, args|
|
93
115
|
bump_version_for(args.type)
|
94
116
|
end
|
95
117
|
end
|
96
118
|
|
97
|
-
desc
|
119
|
+
desc 'Release gem'
|
98
120
|
task :release do
|
99
|
-
sh
|
121
|
+
sh 'gem release --tag --push'
|
100
122
|
end
|
101
123
|
|
102
124
|
def bump_version_for(version_type)
|
103
|
-
sh "gem bump --version #{version_type} "
|
104
|
-
|
105
|
-
|
106
|
-
|
125
|
+
sh "gem bump --version #{version_type} " \
|
126
|
+
'&& bundle install ' \
|
127
|
+
'&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
|
128
|
+
'&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
|
107
129
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rake_dependencies'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rake_dependencies"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'zip'
|
2
4
|
require 'zlib'
|
3
5
|
require 'pathname'
|
@@ -6,6 +8,8 @@ require 'archive/tar/minitar'
|
|
6
8
|
module RakeDependencies
|
7
9
|
module Extractors
|
8
10
|
class ZipExtractor
|
11
|
+
attr_reader :file_path, :extract_path, :options
|
12
|
+
|
9
13
|
def initialize(file_path, extract_path, options = {})
|
10
14
|
@file_path = file_path
|
11
15
|
@extract_path = extract_path
|
@@ -13,30 +17,92 @@ module RakeDependencies
|
|
13
17
|
end
|
14
18
|
|
15
19
|
def extract
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
create_extract_directory
|
21
|
+
extract_files
|
22
|
+
|
23
|
+
return unless requires_rename?
|
24
|
+
|
25
|
+
rename(
|
26
|
+
relative_to_extract_directory(rename_from),
|
27
|
+
relative_to_extract_directory(rename_to)
|
28
|
+
)
|
29
|
+
end
|
23
30
|
|
24
|
-
|
25
|
-
|
26
|
-
|
31
|
+
private
|
32
|
+
|
33
|
+
def extract_files
|
34
|
+
Zip::File.open(file_path) do |zip_file_entries|
|
35
|
+
zip_file_entries.each do |entry|
|
36
|
+
process_zip_file_entry(zip_file_entries, entry)
|
27
37
|
end
|
28
38
|
end
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
39
|
+
end
|
40
|
+
|
41
|
+
def process_zip_file_entry(zip_file_entries, entry)
|
42
|
+
target_path = relative_to_extract_directory(target_pathname(entry))
|
43
|
+
create_base_directory(target_path)
|
44
|
+
extract_file_if_needed(zip_file_entries, entry, target_path)
|
45
|
+
end
|
46
|
+
|
47
|
+
def extract_file_if_needed(zip_file_entries, entry, target_path)
|
48
|
+
return if File.exist?(target_path)
|
49
|
+
|
50
|
+
zip_file_entries.extract(entry, target_path)
|
51
|
+
end
|
52
|
+
|
53
|
+
def requires_rename?
|
54
|
+
rename_from && rename_to
|
55
|
+
end
|
56
|
+
|
57
|
+
def relative_to_extract_directory(path)
|
58
|
+
File.join(extract_path, path)
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_base_directory(path)
|
62
|
+
FileUtils.mkdir_p(File.dirname(path))
|
63
|
+
end
|
64
|
+
|
65
|
+
def create_extract_directory
|
66
|
+
FileUtils.mkdir_p(extract_path)
|
67
|
+
end
|
68
|
+
|
69
|
+
def move(from, to)
|
70
|
+
FileUtils.mv(from, to)
|
71
|
+
end
|
72
|
+
|
73
|
+
def rename(from, to)
|
74
|
+
create_base_directory(to)
|
75
|
+
move(from, to)
|
76
|
+
end
|
77
|
+
|
78
|
+
def target_pathname(entry)
|
79
|
+
entry_pathname(entry).relative_path_from(strip_pathname)
|
80
|
+
end
|
81
|
+
|
82
|
+
def strip_pathname
|
83
|
+
Pathname.new(strip_path)
|
84
|
+
end
|
85
|
+
|
86
|
+
def entry_pathname(entry)
|
87
|
+
Pathname.new(entry.name)
|
88
|
+
end
|
89
|
+
|
90
|
+
def rename_to
|
91
|
+
options[:rename_to]
|
92
|
+
end
|
93
|
+
|
94
|
+
def rename_from
|
95
|
+
options[:rename_from]
|
96
|
+
end
|
97
|
+
|
98
|
+
def strip_path
|
99
|
+
options[:strip_path] || ''
|
36
100
|
end
|
37
101
|
end
|
38
102
|
|
39
103
|
class TarGzExtractor
|
104
|
+
attr_reader :file_path, :extract_path, :options
|
105
|
+
|
40
106
|
def initialize(file_path, extract_path, options = {})
|
41
107
|
@file_path = file_path
|
42
108
|
@extract_path = extract_path
|
@@ -44,33 +110,94 @@ module RakeDependencies
|
|
44
110
|
end
|
45
111
|
|
46
112
|
def extract
|
47
|
-
|
48
|
-
|
113
|
+
create_extract_directory
|
114
|
+
extract_files
|
115
|
+
|
116
|
+
return unless requires_rename?
|
117
|
+
|
118
|
+
rename(
|
119
|
+
relative_to_extract_directory(rename_from),
|
120
|
+
relative_to_extract_directory(rename_to)
|
121
|
+
)
|
122
|
+
end
|
123
|
+
|
124
|
+
private
|
125
|
+
|
126
|
+
def extract_files
|
127
|
+
Zlib::GzipReader.open(file_path) do |tar_file|
|
49
128
|
Archive::Tar::Minitar.open(tar_file) do |tar_file_entries|
|
50
|
-
tar_file_entries.each
|
51
|
-
entry_pathname = Pathname.new(entry.name)
|
52
|
-
strip_pathname = Pathname.new(@options[:strip_path] || '')
|
53
|
-
target_pathname = entry_pathname.relative_path_from(strip_pathname)
|
54
|
-
|
55
|
-
file_path = File.join(@extract_path, target_pathname)
|
56
|
-
FileUtils.mkdir_p(File.dirname(file_path))
|
57
|
-
if entry.file? && !File.exist?(file_path)
|
58
|
-
File.open(file_path, 'w', entry.mode) { |f| f.write(entry.read) }
|
59
|
-
end
|
60
|
-
end
|
129
|
+
tar_file_entries.each(&method(:process_tar_file_entry))
|
61
130
|
end
|
62
131
|
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
132
|
+
end
|
133
|
+
|
134
|
+
def process_tar_file_entry(entry)
|
135
|
+
target_path = relative_to_extract_directory(target_pathname(entry))
|
136
|
+
create_base_directory(target_path)
|
137
|
+
extract_file_if_needed(entry, target_path)
|
138
|
+
end
|
139
|
+
|
140
|
+
def extract_file_if_needed(entry, target_path)
|
141
|
+
return unless entry.file? && !File.exist?(target_path)
|
142
|
+
|
143
|
+
File.open(target_path, 'w', entry.mode) do |f|
|
144
|
+
f.write(entry.read)
|
69
145
|
end
|
70
146
|
end
|
147
|
+
|
148
|
+
def requires_rename?
|
149
|
+
rename_from && rename_to
|
150
|
+
end
|
151
|
+
|
152
|
+
def relative_to_extract_directory(path)
|
153
|
+
File.join(extract_path, path)
|
154
|
+
end
|
155
|
+
|
156
|
+
def create_base_directory(path)
|
157
|
+
FileUtils.mkdir_p(File.dirname(path))
|
158
|
+
end
|
159
|
+
|
160
|
+
def create_extract_directory
|
161
|
+
FileUtils.mkdir_p(extract_path)
|
162
|
+
end
|
163
|
+
|
164
|
+
def move(from, to)
|
165
|
+
FileUtils.mv(from, to)
|
166
|
+
end
|
167
|
+
|
168
|
+
def rename(from, to)
|
169
|
+
create_base_directory(to)
|
170
|
+
move(from, to)
|
171
|
+
end
|
172
|
+
|
173
|
+
def target_pathname(entry)
|
174
|
+
entry_pathname(entry).relative_path_from(strip_pathname)
|
175
|
+
end
|
176
|
+
|
177
|
+
def strip_pathname
|
178
|
+
Pathname.new(strip_path)
|
179
|
+
end
|
180
|
+
|
181
|
+
def entry_pathname(entry)
|
182
|
+
Pathname.new(entry.name)
|
183
|
+
end
|
184
|
+
|
185
|
+
def rename_to
|
186
|
+
options[:rename_to]
|
187
|
+
end
|
188
|
+
|
189
|
+
def rename_from
|
190
|
+
options[:rename_from]
|
191
|
+
end
|
192
|
+
|
193
|
+
def strip_path
|
194
|
+
options[:strip_path] || ''
|
195
|
+
end
|
71
196
|
end
|
72
197
|
|
73
198
|
class UncompressedExtractor
|
199
|
+
attr_reader :file_path, :extract_path, :options
|
200
|
+
|
74
201
|
def initialize(file_path, extract_path, options = {})
|
75
202
|
@file_path = file_path
|
76
203
|
@extract_path = extract_path
|
@@ -78,13 +205,39 @@ module RakeDependencies
|
|
78
205
|
end
|
79
206
|
|
80
207
|
def extract
|
81
|
-
target_name =
|
82
|
-
|
83
|
-
|
208
|
+
target_name = rename_to || file_name
|
209
|
+
source_path = file_path
|
210
|
+
target_path = relative_to_extract_directory(target_name)
|
211
|
+
|
212
|
+
create_extract_directory
|
213
|
+
move(source_path, target_path)
|
214
|
+
fix_permissions(target_path)
|
215
|
+
end
|
216
|
+
|
217
|
+
private
|
218
|
+
|
219
|
+
def file_name
|
220
|
+
File.basename(file_path)
|
221
|
+
end
|
222
|
+
|
223
|
+
def fix_permissions(target_path)
|
224
|
+
FileUtils.chmod(0o755, target_path)
|
225
|
+
end
|
226
|
+
|
227
|
+
def move(source_path, target_path)
|
228
|
+
FileUtils.cp(source_path, target_path)
|
229
|
+
end
|
230
|
+
|
231
|
+
def relative_to_extract_directory(path)
|
232
|
+
File.join(extract_path, path)
|
233
|
+
end
|
234
|
+
|
235
|
+
def create_extract_directory
|
236
|
+
FileUtils.mkdir_p(extract_path)
|
237
|
+
end
|
84
238
|
|
85
|
-
|
86
|
-
|
87
|
-
FileUtils.chmod(0755, destination)
|
239
|
+
def rename_to
|
240
|
+
options[:rename_to]
|
88
241
|
end
|
89
242
|
end
|
90
243
|
end
|
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RakeDependencies
|
4
|
+
# rubocop:disable Naming/VariableNumber
|
2
5
|
module PlatformNames
|
3
6
|
CPU = {
|
4
7
|
x86_64: 'amd64',
|
@@ -6,12 +9,13 @@ module RakeDependencies
|
|
6
9
|
x86: '386',
|
7
10
|
arm: 'arm',
|
8
11
|
arm64: 'arm64'
|
9
|
-
}
|
12
|
+
}.freeze
|
10
13
|
OS = {
|
11
14
|
darwin: 'darwin',
|
12
15
|
linux: 'linux',
|
13
16
|
mswin32: 'windows',
|
14
17
|
mswin64: 'windows'
|
15
|
-
}
|
18
|
+
}.freeze
|
16
19
|
end
|
20
|
+
# rubocop:enable Naming/VariableNumber
|
17
21
|
end
|