rake_dependencies 0.16.1.pre2 → 0.16.1.pre3
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.lock +1 -1
- data/README.md +17 -15
- data/lib/rake_dependencies/extractors.rb +8 -0
- data/lib/rake_dependencies/tasks/all.rb +7 -3
- data/lib/rake_dependencies/tasks/extract.rb +7 -3
- data/lib/rake_dependencies/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa836ff5769c0df6471374ac055fad7ee15f2bb0621f4b5f05aa7054f0bd8c90
|
4
|
+
data.tar.gz: a58231049a67c7466bfca5fa19db62a99c17abe771ffd2da9b3e2258831f6613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04298cea72c0e601131dc6283845e8ebd726155e0e70f33ba46638b2070259d6146ef1ab7a7011ae91b7661bd54d4bfc8812bb8800c4e3a7c0d0ceeef78e97f
|
7
|
+
data.tar.gz: a44f4eb2c2a1ed01bb3feb97d06a380ec018553fa353ff4b176ab67bdf45bab653558f14081a22434aace8640f7bac78876bf44454684d8cfa07a62d657f482c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -126,7 +126,8 @@ parameters:
|
|
126
126
|
| `installation_directory` | The name of the directory into which to install the binaries, anywhere on the file system | - | no |
|
127
127
|
| `uri_template` | A template for the URI of the distribution | - | yes |
|
128
128
|
| `file_name_template` | A template for the name of the downloaded file | - | yes |
|
129
|
-
| `
|
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 |
|
130
131
|
| `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
|
131
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 |
|
132
133
|
| `clean_task_name` | The name of the clean task, required if it should be different from the default | `:clean` | yes |
|
@@ -197,20 +198,21 @@ Notes:
|
|
197
198
|
The `RakeDependencies::Tasks::Extract` tasklib supports the following
|
198
199
|
configuration parameters:
|
199
200
|
|
200
|
-
| Name
|
201
|
-
|
202
|
-
| `name`
|
203
|
-
| `dependency`
|
204
|
-
| `version`
|
205
|
-
| `path`
|
206
|
-
| `type`
|
207
|
-
| `os_ids`
|
208
|
-
| `extractors`
|
209
|
-
| `distribution_directory`
|
210
|
-
| `binary_directory`
|
211
|
-
| `file_name_template`
|
212
|
-
| `
|
213
|
-
| `
|
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 |
|
214
216
|
|
215
217
|
Notes:
|
216
218
|
* The templates have the same instance variables in scope when rendered as
|
@@ -25,6 +25,10 @@ module RakeDependencies
|
|
25
25
|
zip_file_entries.extract(entry, file_path) unless File.exist?(file_path)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
if @options[:rename_from] && @options[:rename_to]
|
29
|
+
FileUtils.mkdir_p(File.dirname(@options[:rename_to]))
|
30
|
+
FileUtils.mv(@options[:rename_from], @options[:rename_to])
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
@@ -52,6 +56,10 @@ module RakeDependencies
|
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
59
|
+
if @options[:rename_from] && @options[:rename_to]
|
60
|
+
FileUtils.mkdir_p(File.dirname(@options[:rename_to]))
|
61
|
+
FileUtils.mv(@options[:rename_from], @options[:rename_to])
|
62
|
+
end
|
55
63
|
end
|
56
64
|
end
|
57
65
|
|
@@ -23,9 +23,11 @@ module RakeDependencies
|
|
23
23
|
|
24
24
|
parameter :uri_template, :required => true
|
25
25
|
parameter :file_name_template, :required => true
|
26
|
-
parameter :target_name_template
|
27
26
|
parameter :strip_path_template
|
28
27
|
|
28
|
+
parameter :source_binary_name_template
|
29
|
+
parameter :target_binary_name_template
|
30
|
+
|
29
31
|
parameter :needs_fetch, :required => true
|
30
32
|
|
31
33
|
parameter :clean_task_name, :default => :clean
|
@@ -86,7 +88,9 @@ module RakeDependencies
|
|
86
88
|
|
87
89
|
t.file_name_template = file_name_template
|
88
90
|
t.strip_path_template = strip_path_template
|
89
|
-
|
91
|
+
|
92
|
+
t.source_binary_name_template = source_binary_name_template
|
93
|
+
t.target_binary_name_template = target_binary_name_template
|
90
94
|
end
|
91
95
|
Install.new do |t|
|
92
96
|
t.name = install_task_name
|
@@ -99,7 +103,7 @@ module RakeDependencies
|
|
99
103
|
t.os_ids = os_ids
|
100
104
|
|
101
105
|
t.binary_directory = binary_directory
|
102
|
-
t.binary_name_template =
|
106
|
+
t.binary_name_template = target_binary_name_template || dependency
|
103
107
|
|
104
108
|
t.installation_directory = installation_directory
|
105
109
|
end if installation_directory
|
@@ -27,7 +27,8 @@ module RakeDependencies
|
|
27
27
|
parameter :version
|
28
28
|
parameter :path, required: true
|
29
29
|
parameter :file_name_template, required: true
|
30
|
-
parameter :
|
30
|
+
parameter :source_binary_name_template
|
31
|
+
parameter :target_binary_name_template
|
31
32
|
parameter :strip_path_template
|
32
33
|
|
33
34
|
def process_arguments args
|
@@ -61,8 +62,11 @@ module RakeDependencies
|
|
61
62
|
.render
|
62
63
|
end
|
63
64
|
|
64
|
-
if
|
65
|
-
options[:
|
65
|
+
if source_binary_name_template && target_binary_name_template
|
66
|
+
options[:rename_from] = Template.new(source_binary_name_template)
|
67
|
+
.with_parameters(parameters)
|
68
|
+
.render
|
69
|
+
options[:rename_to] = Template.new(target_binary_name_template)
|
66
70
|
.with_parameters(parameters)
|
67
71
|
.render
|
68
72
|
end
|