rake_dependencies 2.12.0.pre.3 → 3.0.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a8d1c9565265ee0de305541f53d7edf66bf4d543ca020a9df354a147fac70eb
4
- data.tar.gz: 8be121118f0a1613ee2c3d800304b2dcffe073cd71cf1bdb94e5f88fcee4e65b
3
+ metadata.gz: 5725bf06b6c449286c14a58b5ca7b413e02439ab9f04cca32319cc620ade15fd
4
+ data.tar.gz: 890d5161d50c27bd2db49ebe89e63bcb99926f57060f9de9ee1b0ec47708d9dc
5
5
  SHA512:
6
- metadata.gz: 514f54f6b242a583c0abb47ae0a035d05f1d0142db12e1905e3711e814e063720a6ea1077b5052424f2a32ff4f8d1e3365f6cba958cb153e20ad1fb1a2312040
7
- data.tar.gz: '078ce22e10c837657675283874d36bbefbaab63737ac953bf54aba02df9b20d83bc8f3ed8ae0cc7e3433073da7c0f064f2ec7ac60d914b8c4a45e72f89c6f2c1'
6
+ metadata.gz: 26ffc915dc4920e4939eb4c6ef07b18a3ea44ee555ca9307d55b1a9dae36f2bfce18e3e54b7a6e89aff363234d1d9c5b87b8a59efabd3c9a166cc3297bbcc41f
7
+ data.tar.gz: 728d08d55767b4edc3b6fa2b4179d76c1cc654f5eb005fd06559cfb69c53b79364f6ff4261c7b11f2dfc743d85ba3d3c07286e92a5519663cafca9841eb5cb8d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_dependencies (2.12.0.pre.3)
4
+ rake_dependencies (3.0.0.pre.2)
5
5
  hamster (~> 3.0)
6
6
  minitar (~> 0.9)
7
7
  rake_factory (~> 0.23)
@@ -10,21 +10,20 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (6.1.5)
13
+ activesupport (7.0.2.3)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
17
17
  tzinfo (~> 2.0)
18
- zeitwerk (~> 2.3)
19
18
  addressable (2.8.0)
20
19
  public_suffix (>= 2.0.2, < 5.0)
21
20
  colored2 (3.1.2)
22
21
  concurrent-ruby (1.1.9)
23
22
  diff-lcs (1.5.0)
24
23
  docile (1.4.0)
25
- excon (0.82.0)
24
+ excon (0.92.0)
26
25
  fakefs (1.4.1)
27
- faraday (1.9.3)
26
+ faraday (1.10.0)
28
27
  faraday-em_http (~> 1.0)
29
28
  faraday-em_synchrony (~> 1.0)
30
29
  faraday-excon (~> 1.1)
@@ -109,29 +108,28 @@ GEM
109
108
  simplecov-html (~> 0.11)
110
109
  simplecov_json_formatter (~> 0.1)
111
110
  simplecov-html (0.12.3)
112
- simplecov_json_formatter (0.1.3)
111
+ simplecov_json_formatter (0.1.4)
113
112
  sshkey (2.0.0)
114
113
  tzinfo (2.0.4)
115
114
  concurrent-ruby (~> 1.0)
116
- zeitwerk (2.5.4)
117
115
 
118
116
  PLATFORMS
119
117
  ruby
120
118
  x86_64-darwin-19
121
119
 
122
120
  DEPENDENCIES
123
- activesupport (>= 4)
124
- bundler (~> 2.1)
125
- fakefs (~> 1.0)
126
- gem-release (~> 2.1)
127
- rake (~> 13.0)
128
- rake_circle_ci (~> 0.9)
121
+ activesupport
122
+ bundler
123
+ fakefs
124
+ gem-release
125
+ rake
126
+ rake_circle_ci
129
127
  rake_dependencies!
130
- rake_github (~> 0.5)
131
- rake_gpg (~> 0.12)
132
- rake_ssh (~> 0.4)
133
- rspec (~> 3.9)
134
- simplecov (~> 0.17)
128
+ rake_github
129
+ rake_gpg
130
+ rake_ssh
131
+ rspec
132
+ simplecov
135
133
 
136
134
  BUNDLED WITH
137
135
  2.3.9
data/README.md CHANGED
@@ -32,19 +32,22 @@ RakeDependencies::Tasks::All.new do |t|
32
32
  t.version = '0.9.0'
33
33
  t.path = File.join('vendor', 'terraform')
34
34
  t.type = :zip
35
-
36
- t.os_ids = {mac: 'darwin', linux: 'linux'}
37
-
38
- t.uri_template =
39
- 'https://releases.hashicorp.com/terraform/<%= @version %>/' +
40
- 'terraform_<%= @version %>_<%= @os_id %>_amd64<%= @ext %>'
41
- t.file_name_template =
42
- 'terraform_<%= @version %>_<%= @os_id %>_amd64<%= @ext %>'
43
-
35
+
36
+ t.platform_os_names = { darwin: 'darwin', linux: 'linux' }
37
+ t.platform_cpu_names = { x86_64: 'amd64', arm64: 'arm64' }
38
+
39
+ t.uri_template =
40
+ 'https://releases.hashicorp.com/terraform/<%= @version %>/' +
41
+ 'terraform_<%= @version %>_' +
42
+ '<%= @platform_os_name %>_<%= @platform_cpu_name %><%= @ext %>'
43
+ t.file_name_template =
44
+ 'terraform_<%= @version %>_' +
45
+ '<%= @platform_os_name %>_<%= @platform_cpu_name %><%= @ext %>'
46
+
44
47
  t.needs_fetch = lambda do |parameters|
45
48
  terraform_binary = File.join(
46
- parameters[:path], parameters[:binary_directory], 'terraform')
47
-
49
+ parameters[:path], parameters[:binary_directory], 'terraform')
50
+
48
51
  !(File.exist?(terraform_binary) &&
49
52
  `#{terraform_binary} -version`.lines.first =~ /#{parameters[:version]}/)
50
53
  end
@@ -52,6 +55,7 @@ end
52
55
  ```
53
56
 
54
57
  With this in place, a number of tasks will be defined:
58
+
55
59
  ```bash
56
60
  > rake -T
57
61
  rake terraform:clean # Clean vendored terraform
@@ -62,36 +66,37 @@ rake terraform:fetch # Fetch terraform
62
66
  ```
63
67
 
64
68
  The tasks perform the following:
69
+
65
70
  * `<ns>:clean` - recursively deletes the directory containing the dependency
66
71
  * `<ns>:download` - downloads the distribution from the provided path into the
67
72
  dependency directory
68
73
  * `<ns>:extract` - extracts, in the case of a compressed archive, or copies, in
69
- the case of an uncompressed distribution, the binaries into the binary
74
+ the case of an uncompressed distribution, the binaries into the binary
70
75
  directory under the dependency directory
71
76
  * `<ns>:fetch` - downloads then extracts
72
77
  * `<ns>:ensure` - checks whether the dependency needs to be fetched and cleans
73
78
  and fetches if necessary
74
79
 
75
- With these tasks defined, any task that requires the dependency to be present
80
+ With these tasks defined, any task that requires the dependency to be present
76
81
  should depend on `<ns>:ensure`. Continuing the terraform example:
77
-
82
+
78
83
  ```ruby
79
84
  task :provision_database => ['terraform:ensure'] do
80
85
  sh('vendor/terraform/bin/terraform apply infra/database')
81
86
  end
82
87
  ```
83
88
 
84
- If the `installation_directory` attribute is supplied, an additional `install`
89
+ If the `installation_directory` attribute is supplied, an additional `install`
85
90
  task will be defined:
86
91
 
87
92
  ```ruby
88
93
  RakeDependencies::Tasks::All.new do |t|
89
- t.namespace = :terraform
90
- t.dependency = 'terraform'
91
-
92
- # ...
93
- t.installation_directory = "#{ENV['HOME']}/bin"
94
- # ...
94
+ t.namespace = :terraform
95
+ t.dependency = 'terraform'
96
+
97
+ # ...
98
+ t.installation_directory = "#{ENV['HOME']}/bin"
99
+ # ...
95
100
  end
96
101
  ```
97
102
 
@@ -107,53 +112,57 @@ rake terraform:fetch # Fetch terraform
107
112
  rake terraform:install # Install terraform
108
113
  ```
109
114
 
110
- The `<ns>:install` task copies the binary into the defined installation
115
+ The `<ns>:install` task copies the binary into the defined installation
111
116
  directory which can be anywhere on the filesystem.
112
117
 
113
118
  The `RakeDependencies::Tasks::All` tasklib supports the following configuration
114
119
  parameters:
115
120
 
116
- | Name | Description | Default | Required |
117
- |-------------------------------|-----------------------------------------------------------------------------------------------------------------------|----------------------------------|:--------:|
118
- | `namespace` | The namespace in which to define the tasks | - | no |
119
- | `dependency` | The name of the dependency, used in status reporting and as the default binary name | - | yes |
120
- | `version` | The version of the dependency to manage, only required if used in templates or `needs_fetch` | - | no |
121
- | `path` | The path in which to install the dependency | - | yes |
122
- | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
123
- | `os_ids` | A map of platforms to OS identifiers to use in templates, containing entries for `:mac` and `:linux` | `{:mac: 'mac', :linux: 'linux'}` | yes |
124
- | `distribution_directory` | The name of the directory under the supplied path into which to download the distribution | `'dist'` | yes |
125
- | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
126
- | `installation_directory` | The name of the directory into which to install the binaries, anywhere on the file system | - | no |
127
- | `uri_template` | A template for the URI of the distribution | - | yes |
128
- | `file_name_template` | A template for the name of the downloaded file | - | yes |
129
- | `source_binary_name_template` | A template for the name of the binary before rename after extraction/copying | - | no |
130
- | `target_binary_name_template` | A template for the name to rename the binary to after extraction/copying | - | no |
131
- | `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
132
- | `needs_fetch` | A lambda taking a parameter map that should return `true` if the dependency needs to be fetched, `false` otherwise | Will always return `true` | no |
133
- | `clean_task_name` | The name of the clean task, required if it should be different from the default | `:clean` | yes |
134
- | `download_task_name` | The name of the download task, required if it should be different from the default | `:download` | yes |
135
- | `extract_task_name` | The name of the extract task, required if it should be different from the default | `:extract` | yes |
136
- | `install_task_name` | The name of the install task, required if it should be different from the default | `:install` | no |
137
- | `fetch_task_name` | The name of the fetch task, required if it should be different from the default | `:fetch` | yes |
138
- | `ensure_task_name` | The name of the ensure task, required if it should be different from the default | `:ensure` | yes |
121
+ | Name | Description | Default | Required |
122
+ |-------------------------------|--------------------------------------------------------------------------------------------------------------------|----------------------------------------|:--------:|
123
+ | `namespace` | The namespace in which to define the tasks | - | no |
124
+ | `dependency` | The name of the dependency, used in status reporting and as the default binary name | - | yes |
125
+ | `version` | The version of the dependency to manage, only required if used in templates or `needs_fetch` | - | no |
126
+ | `path` | The path in which to install the dependency | - | yes |
127
+ | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
128
+ | `platform_os_names` | A map of platform OS identifiers to OS names to use in templates | `RakeDependencies::PlatformNames::OS` | yes |
129
+ | `platform_cpu_names` | A map of platform CPU identifiers to CPU names to use in templates | `RakeDependencies::PlatformNames::CPU` | yes |
130
+ | `distribution_directory` | The name of the directory under the supplied path into which to download the distribution | `'dist'` | yes |
131
+ | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
132
+ | `installation_directory` | The name of the directory into which to install the binaries, anywhere on the file system | - | no |
133
+ | `uri_template` | A template for the URI of the distribution | - | yes |
134
+ | `file_name_template` | A template for the name of the downloaded file | - | yes |
135
+ | `source_binary_name_template` | A template for the name of the binary before rename after extraction/copying | - | no |
136
+ | `target_binary_name_template` | A template for the name to rename the binary to after extraction/copying | - | no |
137
+ | `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
138
+ | `needs_fetch` | A lambda taking a parameter map that should return `true` if the dependency needs to be fetched, `false` otherwise | Will always return `true` | no |
139
+ | `clean_task_name` | The name of the clean task, required if it should be different from the default | `:clean` | yes |
140
+ | `download_task_name` | The name of the download task, required if it should be different from the default | `:download` | yes |
141
+ | `extract_task_name` | The name of the extract task, required if it should be different from the default | `:extract` | yes |
142
+ | `install_task_name` | The name of the install task, required if it should be different from the default | `:install` | no |
143
+ | `fetch_task_name` | The name of the fetch task, required if it should be different from the default | `:fetch` | yes |
144
+ | `ensure_task_name` | The name of the ensure task, required if it should be different from the default | `:ensure` | yes |
139
145
 
140
146
  Notes:
147
+
141
148
  * Each of the templates will have the following instance variables in scope when
142
149
  rendered:
143
- * `@version`: the supplied version string
144
- * `@platform`: the platform on which the task is executing, on of `:mac` or
145
- `:linux`
146
- * `@os_id`: the OS identifier derived from the platform on which the task is
147
- executing and the provided `os_ids` map
148
- * `@ext`: the file extension corresponding to the provided `type`, one of
149
- `.zip`, `.tar.gz`, `.tgz` or empty string for uncompressed files
150
+ * `@version`: the supplied version string
151
+ * `@platform`: the `Gem::Platform` on which the task is executing
152
+ * `@platform_os_name`: the OS name derived from the platform on which the
153
+ task is executing and the provided `platform_os_names` map
154
+ * `@platform_cpu_name`: the CPU name derived from the platform on which the
155
+ task is executing and the provided `platform_cpu_names` map
156
+ * `@ext`: the file extension corresponding to the provided `type`, one of
157
+ `.zip`, `.tar.gz`, `.tgz` or empty string for uncompressed files
150
158
  * The `needs_fetch` lambda will receive a map with the following entries:
151
- * `path`: the supplied path
152
- * `version`: the supplied version string
153
- * `binary_directory`: the supplied or default binary directory
154
-
159
+ * `path`: the supplied path
160
+ * `version`: the supplied version string
161
+ * `binary_directory`: the supplied or default binary directory
162
+
155
163
  The `RakeDependencies::Tasks::All` tasklib uses each of the following tasklibs
156
164
  in its definition:
165
+
157
166
  * `RakeDependencies::Tasks::Clean`
158
167
  * `RakeDependencies::Tasks::Download`
159
168
  * `RakeDependencies::Tasks::Extract`
@@ -163,7 +172,7 @@ in its definition:
163
172
 
164
173
  ### `RakeDependencies::Tasks::Clean`
165
174
 
166
- The `RakeDependencies::Tasks::Clean` tasklib supports the following
175
+ The `RakeDependencies::Tasks::Clean` tasklib supports the following
167
176
  configuration parameters:
168
177
 
169
178
  | Name | Description | Default | Required |
@@ -174,82 +183,88 @@ configuration parameters:
174
183
 
175
184
  ### `RakeDependencies::Tasks::Download`
176
185
 
177
- The `RakeDependencies::Tasks::Download` tasklib supports the following
186
+ The `RakeDependencies::Tasks::Download` tasklib supports the following
178
187
  configuration parameters:
179
188
 
180
- | Name | Description | Default | Required |
181
- |--------------------------|------------------------------------------------------------------------------------------------------|----------------------------------|:--------:|
182
- | `name` | The name of the task, required if it should be different from the default | `:download` | yes |
183
- | `dependency` | The name of the dependency, used in status reporting | - | yes |
184
- | `version` | The version of the dependency to manage, only required if used in templates | - | no |
185
- | `path` | The path in which to install the dependency | - | yes |
186
- | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
187
- | `os_ids` | A map of platforms to OS identifiers to use in templates, containing entries for `:mac` and `:linux` | `{:mac: 'mac', :linux: 'linux'}` | yes |
188
- | `distribution_directory` | The name of the directory under the supplied path into which to download the distribution | `'dist'` | yes |
189
- | `uri_template` | A template for the URI of the distribution | - | yes |
190
- | `file_name_template` | A template for the name of the downloaded file | - | yes |
189
+ | Name | Description | Default | Required |
190
+ |-------------------------------|---------------------------------------------------------------------------------------------------|----------------------------------------|:--------:|
191
+ | `name` | The name of the task, required if it should be different from the default | `:download` | yes |
192
+ | `dependency` | The name of the dependency, used in status reporting | - | yes |
193
+ | `version` | The version of the dependency to manage, only required if used in templates | - | no |
194
+ | `path` | The path in which to install the dependency | - | yes |
195
+ | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
196
+ | `platform_os_names` | A map of platform OS identifiers to OS names to use in templates | `RakeDependencies::PlatformNames::OS` | yes |
197
+ | `platform_cpu_names` | A map of platform CPU identifiers to CPU names to use in templates | `RakeDependencies::PlatformNames::CPU` | yes |
198
+ | `distribution_directory` | The name of the directory under the supplied path into which to download the distribution | `'dist'` | yes |
199
+ | `uri_template` | A template for the URI of the distribution | - | yes |
200
+ | `file_name_template` | A template for the name of the downloaded file | - | yes |
191
201
 
192
202
  Notes:
193
- * The templates have the same instance variables in scope when rendered as
203
+
204
+ * The templates have the same instance variables in scope when rendered as
194
205
  mentioned above.
195
206
 
196
207
  ### `RakeDependencies::Tasks::Extract`
197
208
 
198
- The `RakeDependencies::Tasks::Extract` tasklib supports the following
209
+ The `RakeDependencies::Tasks::Extract` tasklib supports the following
199
210
  configuration parameters:
200
211
 
201
- | Name | Description | Default | Required |
202
- |-------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------|:--------:|
203
- | `name` | The name of the task, required if it should be different from the default | `:extract` | yes |
204
- | `dependency` | The name of the dependency, used in status reporting | - | yes |
205
- | `version` | The version of the dependency to manage, only required if used in templates | - | no |
206
- | `path` | The path in which to install the dependency | - | yes |
207
- | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
208
- | `os_ids` | A map of platforms to OS identifiers to use in templates, containing entries for `:mac` and `:linux` | `{:mac: 'mac', :linux: 'linux'}` | yes |
209
- | `extractors` | A map of archive types to extractor classes, see notes for further details | Extractors for all supported types | yes |
210
- | `distribution_directory` | The name of the directory under the supplied path into which the distribution was downloaded | `'dist'` | yes |
211
- | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
212
- | `file_name_template` | A template for the name of the downloaded file | - | yes |
213
- | `source_binary_name_template` | A template for the name of the binary before rename after extraction/copying | - | no |
214
- | `target_binary_name_template` | A template for the name to rename the binary to after extraction/copying | - | no |
215
- | `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
212
+ | Name | Description | Default | Required |
213
+ |-------------------------------|----------------------------------------------------------------------------------------------|----------------------------------------|:--------:|
214
+ | `name` | The name of the task, required if it should be different from the default | `:extract` | yes |
215
+ | `dependency` | The name of the dependency, used in status reporting | - | yes |
216
+ | `version` | The version of the dependency to manage, only required if used in templates | - | no |
217
+ | `path` | The path in which to install the dependency | - | yes |
218
+ | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
219
+ | `platform_os_names` | A map of platform OS identifiers to OS names to use in templates | `RakeDependencies::PlatformNames::OS` | yes |
220
+ | `platform_cpu_names` | A map of platform CPU identifiers to CPU names to use in templates | `RakeDependencies::PlatformNames::CPU` | yes |
221
+ | `extractors` | A map of archive types to extractor classes, see notes for further details | Extractors for all supported types | yes |
222
+ | `distribution_directory` | The name of the directory under the supplied path into which the distribution was downloaded | `'dist'` | yes |
223
+ | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
224
+ | `file_name_template` | A template for the name of the downloaded file | - | yes |
225
+ | `source_binary_name_template` | A template for the name of the binary before rename after extraction/copying | - | no |
226
+ | `target_binary_name_template` | A template for the name to rename the binary to after extraction/copying | - | no |
227
+ | `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
216
228
 
217
229
  Notes:
218
- * The templates have the same instance variables in scope when rendered as
230
+
231
+ * The templates have the same instance variables in scope when rendered as
219
232
  mentioned above.
220
233
  * The extractors map has entries for the following keys:
221
- * `:zip`: An extractor class for zip files
222
- * `:tar_gz`: An extractor class for tar.gz files
223
- * `:tgz`: An alias for `:tar_gz` using the same extractor class
224
- * `:uncompressed`: An extractor class that copies the source to the
225
- destination
234
+ * `:zip`: An extractor class for zip files
235
+ * `:tar_gz`: An extractor class for tar.gz files
236
+ * `:tgz`: An alias for `:tar_gz` using the same extractor class
237
+ * `:uncompressed`: An extractor class that copies the source to the
238
+ destination
226
239
  * The extractor map can be overridden but should include entries for all of the
227
240
  above.
228
241
 
229
242
  ### `RakeDependencies::Tasks::Install`
230
243
 
231
- The `RakeDependencies::Tasks::Install` tasklib supports the following
244
+ The `RakeDependencies::Tasks::Install` tasklib supports the following
232
245
  configuration parameters:
233
246
 
234
- | Name | Description | Default | Required |
235
- |--------------------------|------------------------------------------------------------------------------------------------------|------------------------------------|:--------:|
236
- | `name` | The name of the task, required if it should be different from the default | `:install` | yes |
237
- | `dependency` | The name of the dependency, used in status reporting | - | yes |
238
- | `version` | The version of the dependency to manage, only required if used in templates | - | no |
239
- | `path` | The path in which to install the dependency | - | yes |
240
- | `type` | The archive type of the original distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
241
- | `os_ids` | A map of platforms to OS identifiers to use in templates, containing entries for `:mac` and `:linux` | `{:mac: 'mac', :linux: 'linux'}` | yes |
242
- | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
243
- | `installation_directory` | The name of the directory into which the binary should be installed | - | yes |
244
- | `binary_name_template` | A template for the name of the binary | - | yes |
247
+ | Name | Description | Default | Required |
248
+ |--------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------|:--------:|
249
+ | `name` | The name of the task, required if it should be different from the default | `:install` | yes |
250
+ | `dependency` | The name of the dependency, used in status reporting | - | yes |
251
+ | `version` | The version of the dependency to manage, only required if used in templates | - | no |
252
+ | `path` | The path in which to install the dependency | - | yes |
253
+ | `type` | The archive type of the original distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
254
+ | `platform_os_names` | A map of platform OS identifiers to OS names to use in templates | `RakeDependencies::PlatformNames::OS` | yes |
255
+ | `platform_cpu_names` | A map of platform CPU identifiers to CPU names to use in templates | `RakeDependencies::PlatformNames::CPU` | yes |
256
+ | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
257
+ | `installation_directory` | The name of the directory into which the binary should be installed | - | yes |
258
+ | `binary_name_template` | A template for the name of the binary | - | yes |
245
259
 
246
260
  Notes:
247
- * The templates have the same instance variables in scope when rendered as
261
+
262
+ * The templates have the same instance variables in scope when rendered as
248
263
  mentioned above.
249
264
 
250
265
  ### `RakeDependencies::Tasks::Fetch`
251
266
 
252
- The `RakeDependencies::Tasks::Fetch` tasklib supports the following
267
+ The `RakeDependencies::Tasks::Fetch` tasklib supports the following
253
268
  configuration parameters:
254
269
 
255
270
  | Name | Description | Default | Required |
@@ -261,7 +276,7 @@ configuration parameters:
261
276
 
262
277
  ### `RakeDependencies::Tasks::Ensure`
263
278
 
264
- The `RakeDependencies::Tasks::Fetch` tasklib supports the following
279
+ The `RakeDependencies::Tasks::Fetch` tasklib supports the following
265
280
  configuration parameters:
266
281
 
267
282
  | Name | Description | Default | Required |
@@ -278,14 +293,15 @@ configuration parameters:
278
293
  | `install_task` | The full name including namespaces of the install task | `<current-namespace>:install` | yes |
279
294
 
280
295
  Notes:
281
- * The templates have the same instance variables in scope when rendered as
296
+
297
+ * The templates have the same instance variables in scope when rendered as
282
298
  mentioned above.
283
299
  * The needs_fetch method receives the same parameter map as mentioned above.
284
-
300
+
285
301
  ## Development
286
302
 
287
- After checking out the repo, run `bin/setup` to install dependencies. Then,
288
- run `rake spec` to run the tests. You can also run `bin/console` for an
303
+ After checking out the repo, run `bin/setup` to install dependencies. Then,
304
+ run `rake spec` to run the tests. You can also run `bin/console` for an
289
305
  interactive prompt that will allow you to experiment.
290
306
 
291
307
  To install this gem onto your local machine, run `bundle exec rake install`. To
@@ -319,13 +335,12 @@ openssl aes-256-cbc \
319
335
 
320
336
  ## Contributing
321
337
 
322
- Bug reports and pull requests are welcome on GitHub at
323
- https://github.com/infrablocks/rake_dependencies. This project is intended to
324
- be a safe, welcoming space for collaboration, and contributors are expected to
338
+ Bug reports and pull requests are welcome on GitHub at
339
+ https://github.com/infrablocks/rake_dependencies. This project is intended to be
340
+ a safe, welcoming space for collaboration, and contributors are expected to
325
341
  adhere to the [Contributor Covenant](http://contributor-covenant.org) code of
326
342
  conduct.
327
343
 
328
-
329
344
  ## License
330
345
 
331
346
  The gem is available as open source under the terms of the
@@ -0,0 +1,17 @@
1
+ module RakeDependencies
2
+ module PlatformNames
3
+ CPU = {
4
+ x86_64: 'amd64',
5
+ x64: 'amd64',
6
+ x86: '386',
7
+ arm: 'arm',
8
+ arm64: 'arm64'
9
+ }
10
+ OS = {
11
+ darwin: 'darwin',
12
+ linux: 'linux',
13
+ mswin32: 'windows',
14
+ mswin64: 'windows'
15
+ }
16
+ end
17
+ end
@@ -19,7 +19,8 @@ module RakeDependencies
19
19
  parameter :path, required: true
20
20
  parameter :type, default: :zip
21
21
 
22
- parameter :os_ids, default: {mac: 'mac', linux: 'linux'}
22
+ parameter :platform_cpu_names, default: PlatformNames::CPU
23
+ parameter :platform_os_names, default: PlatformNames::OS
23
24
 
24
25
  parameter :distribution_directory, default: 'dist'
25
26
  parameter :binary_directory, default: 'bin'
@@ -1,7 +1,9 @@
1
1
  require 'rake_factory'
2
2
  require 'open-uri'
3
+ require 'rubygems'
3
4
 
4
5
  require_relative '../template'
6
+ require_relative '../platform_names'
5
7
 
6
8
  module RakeDependencies
7
9
  module Tasks
@@ -12,7 +14,9 @@ module RakeDependencies
12
14
  }
13
15
 
14
16
  parameter :type, default: :zip
15
- parameter :os_ids, default: {mac: 'mac', linux: 'linux'}
17
+
18
+ parameter :platform_cpu_names, default: PlatformNames::CPU
19
+ parameter :platform_os_names, default: PlatformNames::OS
16
20
 
17
21
  parameter :distribution_directory, default: 'dist'
18
22
 
@@ -24,18 +28,19 @@ module RakeDependencies
24
28
 
25
29
  action do
26
30
  parameters = {
27
- version: version,
28
- platform: platform,
29
- os_id: os_id,
30
- ext: ext
31
+ version: version,
32
+ platform: platform,
33
+ platform_cpu_name: platform_cpu_name,
34
+ platform_os_name: platform_os_name,
35
+ ext: ext
31
36
  }
32
37
 
33
38
  uri = Template.new(uri_template)
34
- .with_parameters(parameters)
35
- .render
39
+ .with_parameters(parameters)
40
+ .render
36
41
  download_file_name = Template.new(file_name_template)
37
- .with_parameters(parameters)
38
- .render
42
+ .with_parameters(parameters)
43
+ .render
39
44
  download_file_directory = File.join(path, distribution_directory)
40
45
  download_file_path = File.join(download_file_directory, download_file_name)
41
46
 
@@ -47,16 +52,20 @@ module RakeDependencies
47
52
 
48
53
  private
49
54
 
50
- def os_id
51
- os_ids[platform]
55
+ def platform
56
+ Gem::Platform.local
52
57
  end
53
58
 
54
- def platform
55
- RUBY_PLATFORM =~ /darwin/ ? :mac : :linux
59
+ def platform_os_name
60
+ platform_os_names[platform.os.to_sym]
61
+ end
62
+
63
+ def platform_cpu_name
64
+ platform_cpu_names[platform.cpu.to_sym]
56
65
  end
57
66
 
58
67
  def resolved_type
59
- type.is_a?(Hash) ? type[platform].to_sym : type.to_sym
68
+ type.is_a?(Hash) ? type[platform.os.to_sym].to_sym : type.to_sym
60
69
  end
61
70
 
62
71
  def ext
@@ -75,4 +84,4 @@ module RakeDependencies
75
84
  end
76
85
  end
77
86
  end
78
- end
87
+ end
@@ -1,5 +1,6 @@
1
1
  require 'rake_factory'
2
2
  require 'zip'
3
+ require 'rubygems'
3
4
 
4
5
  require_relative '../template'
5
6
  require_relative '../extractors'
@@ -13,10 +14,10 @@ module RakeDependencies
13
14
  }
14
15
 
15
16
  parameter :type, default: :zip
16
- parameter :os_ids, default: {
17
- mac: 'mac',
18
- linux: 'linux'
19
- }
17
+
18
+ parameter :platform_cpu_names, default: PlatformNames::CPU
19
+ parameter :platform_os_names, default: PlatformNames::OS
20
+
20
21
  parameter :extractors, default: {
21
22
  zip: Extractors::ZipExtractor,
22
23
  tar_gz: Extractors::TarGzExtractor,
@@ -39,7 +40,8 @@ module RakeDependencies
39
40
  parameters = {
40
41
  version: version,
41
42
  platform: platform,
42
- os_id: os_id,
43
+ platform_cpu_name: platform_cpu_name,
44
+ platform_os_name: platform_os_name,
43
45
  ext: ext
44
46
  }
45
47
 
@@ -81,16 +83,20 @@ module RakeDependencies
81
83
  extractors[resolved_type]
82
84
  end
83
85
 
84
- def os_id
85
- os_ids[platform]
86
+ def platform
87
+ Gem::Platform.local
86
88
  end
87
89
 
88
- def platform
89
- RUBY_PLATFORM =~ /darwin/ ? :mac : :linux
90
+ def platform_os_name
91
+ platform_os_names[platform.os.to_sym]
92
+ end
93
+
94
+ def platform_cpu_name
95
+ platform_cpu_names[platform.cpu.to_sym]
90
96
  end
91
97
 
92
98
  def resolved_type
93
- type.is_a?(Hash) ? type[platform].to_sym : type.to_sym
99
+ type.is_a?(Hash) ? type[platform.os.to_sym].to_sym : type.to_sym
94
100
  end
95
101
 
96
102
  def ext
@@ -1,4 +1,7 @@
1
1
  require 'rake_factory'
2
+ require 'rubygems'
3
+
4
+ require_relative '../template'
2
5
 
3
6
  module RakeDependencies
4
7
  module Tasks
@@ -8,10 +11,8 @@ module RakeDependencies
8
11
  "Install #{t.dependency}"
9
12
  }
10
13
 
11
- parameter :os_ids, default: {
12
- mac: 'mac',
13
- linux: 'linux'
14
- }
14
+ parameter :platform_cpu_names, default: PlatformNames::CPU
15
+ parameter :platform_os_names, default: PlatformNames::OS
15
16
 
16
17
  parameter :dependency, required: true
17
18
  parameter :version
@@ -27,7 +28,8 @@ module RakeDependencies
27
28
  parameters = {
28
29
  version: version,
29
30
  platform: platform,
30
- os_id: os_id,
31
+ platform_cpu_name: platform_cpu_name,
32
+ platform_os_name: platform_os_name,
31
33
  ext: ext
32
34
  }
33
35
 
@@ -42,16 +44,22 @@ module RakeDependencies
42
44
  cp binary_file_path, installation_directory
43
45
  end
44
46
 
45
- def os_id
46
- os_ids[platform]
47
- end
47
+ private
48
48
 
49
49
  def platform
50
- RUBY_PLATFORM =~ /darwin/ ? :mac : :linux
50
+ Gem::Platform.local
51
+ end
52
+
53
+ def platform_os_name
54
+ platform_os_names[platform.os.to_sym]
55
+ end
56
+
57
+ def platform_cpu_name
58
+ platform_cpu_names[platform.cpu.to_sym]
51
59
  end
52
60
 
53
61
  def resolved_type
54
- type.is_a?(Hash) ? type[platform].to_sym : type.to_sym
62
+ type.is_a?(Hash) ? type[platform.os.to_sym].to_sym : type.to_sym
55
63
  end
56
64
 
57
65
  def ext
@@ -1,3 +1,3 @@
1
1
  module RakeDependencies
2
- VERSION = "2.12.0.pre.3"
2
+ VERSION = "3.0.0.pre.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0.pre.3
4
+ version: 3.0.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
@@ -70,156 +70,156 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '2.1'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '2.1'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '13.0'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '13.0'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake_circle_ci
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '0.9'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '0.9'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake_github
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '0.5'
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '0.5'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake_ssh
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '0.4'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '0.4'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rake_gpg
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '0.12'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '0.12'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '3.9'
159
+ version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: '3.9'
166
+ version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: gem-release
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - "~>"
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: '2.1'
173
+ version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - "~>"
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
- version: '2.1'
180
+ version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: activesupport
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: '4'
187
+ version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: '4'
194
+ version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: fakefs
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - "~>"
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: '1.0'
201
+ version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - "~>"
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: '1.0'
208
+ version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: simplecov
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - "~>"
213
+ - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '0.17'
215
+ version: '0'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - "~>"
220
+ - - ">="
221
221
  - !ruby/object:Gem::Version
222
- version: '0.17'
222
+ version: '0'
223
223
  description: Provides rake tasks for downloading and extracting tools depended on
224
224
  for further build activities.
225
225
  email:
@@ -239,6 +239,7 @@ files:
239
239
  - lib/rake_dependencies.rb
240
240
  - lib/rake_dependencies/extractors.rb
241
241
  - lib/rake_dependencies/kernel_extensions.rb
242
+ - lib/rake_dependencies/platform_names.rb
242
243
  - lib/rake_dependencies/task_sets.rb
243
244
  - lib/rake_dependencies/task_sets/all.rb
244
245
  - lib/rake_dependencies/tasks.rb