1
0
Fork 0
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:
seenmyfate 2013-03-15 13:48:48 +00:00
parent 72b854185b
commit 21f24f244a
3 changed files with 10 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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