Browse Source

fix COOK-2812 allow block for restart_command

hungryblank 11 years ago
parent
commit
30b30643fd
1 changed files with 5 additions and 1 deletions
  1. 5 1
      resources/default.rb

+ 5 - 1
resources/default.rb

@@ -51,11 +51,15 @@ attribute :symlinks, :kind_of => Hash, :default => {}
 attribute :symlink_before_migrate, :kind_of => Hash, :default => {}
 attribute :migrate, :kind_of => [TrueClass, FalseClass], :default => false
 attribute :migration_command, :kind_of => [String, NilClass], :default => nil
-attribute :restart_command, :kind_of => [String, NilClass], :default => nil
 attribute :packages, :kind_of => [Array, Hash], :default => []
 attribute :application_provider
 attr_reader :sub_resources
 
+def restart_command(arg=nil, &block)
+  arg ||= block
+  set_or_return(:restart_command, arg, :kind_of => [Proc, String])
+end
+
 # Callback fires before deploy is started.
 def before_deploy(arg=nil, &block)
   arg ||= block