rake_dependencies 0.16.1.pre2 → 0.16.1.pre3

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: b677ec56cc6b429fcb7bd61f37774b8c16b59518207ee9854077ca03f78155c1
4
- data.tar.gz: 595cfaf1f921dd1aa59324ed36e7966978e26d550c158f90e6e7f8e6c7801232
3
+ metadata.gz: aa836ff5769c0df6471374ac055fad7ee15f2bb0621f4b5f05aa7054f0bd8c90
4
+ data.tar.gz: a58231049a67c7466bfca5fa19db62a99c17abe771ffd2da9b3e2258831f6613
5
5
  SHA512:
6
- metadata.gz: dc9c6ce97449ced353b879752bbbaf1ae805244123e4d5d6695dba031cdce785be80bd5624b24dbe8a9dc0e6eb6984c74740f9b83e1c0938d71a5bcb6820008e
7
- data.tar.gz: 6fbbd0649e0fee2495911b1f4dea52728a039fb466d35be9cc02545abe14e5b65781e3ba3b6849a97b436964a926b37e759ca634418a19bf89e90301108f6215
6
+ metadata.gz: b04298cea72c0e601131dc6283845e8ebd726155e0e70f33ba46638b2070259d6146ef1ab7a7011ae91b7661bd54d4bfc8812bb8800c4e3a7c0d0ceeef78e97f
7
+ data.tar.gz: a44f4eb2c2a1ed01bb3feb97d06a380ec018553fa353ff4b176ab67bdf45bab653558f14081a22434aace8640f7bac78876bf44454684d8cfa07a62d657f482c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_dependencies (0.16.1.pre2)
4
+ rake_dependencies (0.16.1.pre3)
5
5
  hamster (~> 3.0)
6
6
  minitar (~> 0.6)
7
7
  rubyzip (~> 1.1)
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
- | `target_name_template` | A template for the name of the binary after extraction/copying | - | no |
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 | Description | Default | Required |
201
- |--------------------------|------------------------------------------------------------------------------------------------------|------------------------------------|:--------:|
202
- | `name` | The name of the task, required if it should be different from the default | `:extract` | yes |
203
- | `dependency` | The name of the dependency, used in status reporting | - | yes |
204
- | `version` | The version of the dependency to manage, only required if used in templates | - | no |
205
- | `path` | The path in which to install the dependency | - | yes |
206
- | `type` | The archive type of the distribution, one of `:zip`, `:tar_gz`, `:tgz` or `:uncompressed` | `:zip` | yes |
207
- | `os_ids` | A map of platforms to OS identifiers to use in templates, containing entries for `:mac` and `:linux` | `{:mac: 'mac', :linux: 'linux'}` | yes |
208
- | `extractors` | A map of archive types to extractor classes, see notes for further details | Extractors for all supported types | yes |
209
- | `distribution_directory` | The name of the directory under the supplied path into which the distribution was downloaded | `'dist'` | yes |
210
- | `binary_directory` | The name of the directory under the supplied path into which to extract/copy the binaries | `'bin'` | yes |
211
- | `file_name_template` | A template for the name of the downloaded file | - | yes |
212
- | `target_name_template` | A template for the name to give the binary after extraction/copying | - | no |
213
- | `strip_path_template` | A template for the path to strip within an archive before extracting | - | no |
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
- t.target_name_template = target_name_template
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 = target_name_template || dependency
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 :target_name_template
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 target_name_template
65
- options[:rename_to] = Template.new(target_name_template)
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
@@ -1,3 +1,3 @@
1
1
  module RakeDependencies
2
- VERSION = "0.16.1.pre2"
2
+ VERSION = "0.16.1.pre3"
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: 0.16.1.pre2
4
+ version: 0.16.1.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson