mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Merge pull request #1586 from mattbrictson/multi-append
Allow more than one value to be sent to `append`
This commit is contained in:
commit
de6bba4226
3 changed files with 6 additions and 4 deletions
|
@ -7,6 +7,8 @@ Reverse Chronological Order:
|
|||
https://github.com/capistrano/capistrano/compare/v3.4.0...HEAD
|
||||
|
||||
* `append` DSL method for pushing values like `linked_dirs`
|
||||
[#1447](https://github.com/capistrano/capistrano/pull/1447),
|
||||
[#1586](https://github.com/capistrano/capistrano/pull/1586)
|
||||
* Added support for git shallow clone
|
||||
* Remove 'vendor/bundle' from default :linked_dirs (@ojab)
|
||||
* Removed the post-install message (@Kriechi)
|
||||
|
|
|
@ -38,8 +38,8 @@ module Capistrano
|
|||
set(key, value, &block) unless config.has_key? key
|
||||
end
|
||||
|
||||
def append(key, value)
|
||||
set(key, Array(fetch(key)) << value)
|
||||
def append(key, *values)
|
||||
set(key, Array(fetch(key)).concat(values))
|
||||
end
|
||||
|
||||
def delete(key)
|
||||
|
|
|
@ -160,10 +160,10 @@ module Capistrano
|
|||
end
|
||||
|
||||
context 'appending' do
|
||||
subject { config.append(:linked_dirs, 'vendor/bundle') }
|
||||
subject { config.append(:linked_dirs, 'vendor/bundle', 'tmp') }
|
||||
|
||||
it "returns appended value" do
|
||||
expect(subject).to eq ['vendor/bundle']
|
||||
expect(subject).to eq ['vendor/bundle', 'tmp']
|
||||
end
|
||||
|
||||
context "on non-array variable" do
|
||||
|
|
Loading…
Add table
Reference in a new issue