mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
allow set
to take a proc
This commit is contained in:
parent
72b854185b
commit
21f24f244a
3 changed files with 10 additions and 6 deletions
|
@ -22,12 +22,12 @@ TODO:
|
|||
- [x] support set/fetch/role configuration
|
||||
- [x] basic deploy
|
||||
- [x] ask
|
||||
- [ ] support existing significant configuration variables
|
||||
- [ ] prefer `roles(:all)` over `all_roles`
|
||||
- [ ] support primary servers `on primary(:db)`
|
||||
- [ ] basic rollback
|
||||
- [ ] add examples to README
|
||||
- [ ] support existing significant configuration variables
|
||||
- [ ] set configuration defaults, add commented out examples to templates
|
||||
- [ ] add examples to README
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -103,9 +103,6 @@ module Capistrano
|
|||
@response ||= $stdin.gets.chomp
|
||||
end
|
||||
|
||||
def set(key, value)
|
||||
end
|
||||
|
||||
def question
|
||||
I18n.t(:question, key: key, default_value: default, scope: :capistrano)
|
||||
end
|
||||
|
|
|
@ -97,7 +97,14 @@ module Capistrano
|
|||
end
|
||||
end
|
||||
|
||||
context 'block is passed' do
|
||||
context 'value is a proc' do
|
||||
subject { config.fetch(:key, Proc.new { :proc } ) }
|
||||
it 'calls the proc' do
|
||||
expect(subject).to eq :proc
|
||||
end
|
||||
end
|
||||
|
||||
context 'block is passed to fetch' do
|
||||
subject { config.fetch(:key, :default) { fail 'we need this!' } }
|
||||
|
||||
it 'returns the block value' do
|
||||
|
|
Loading…
Add table
Reference in a new issue