Refactor actions with Action#setup

This commit is contained in:
Thibault Jouan
2014-10-09 01:06:42 +00:00
parent 336b43aaa7
commit 3c4bcc1a4b
6 changed files with 19 additions and 63 deletions

View File

@@ -2,8 +2,7 @@ module Producer
module Core
module Actions
class Mkdir < Action
def initialize(env, *args, **options)
super
def setup
@options[:permissions] = @options.delete :mode if @options.key? :mode
@options[:owner] = @options.delete :user if @options.key? :user
end