lib/recipes/memcached.rb in capitate-0.3.5 vs lib/recipes/memcached.rb in capitate-0.3.6
- old
+ new
@@ -1,52 +1,21 @@
namespace :memcached do
desc <<-DESC
Create memcached yaml in shared path.
- <dl>
- <dt>memcached_namespace</dt>
-
- <dt>memcached_ttl</dt>
- <dd class="default">Defaults to @3600@</dd>
-
- <dt>memcached_readonly</dt>
- <dd class="default">Defaults to @false@</dd>
-
- <dt>memcached_urlencode</dt>
- <dd class="default">Defaults to @false@</dd>
-
- <dt>memcached_c_threshold</dt>
- <dd class="default">Defaults to @10000@</dd>
-
- <dt>memcached_compression</dt>
- <dd class="default">Defaults to @true@</dd>
-
- <dt>memcached_debug</dt>
- <dd class="default">Defaults to @false@</dd>
-
- <dt>memcached_servers</dt>
- <dd class="default">Defaults to @[ "localhost:11211" ]@</dd>
-
- <dt>memcached_yml_template</dt>
- <dd class="default">Defaults to @"memcached/memcached.yml.erb"@</dd>
- </dl>
-
"Source":#{link_to_source(__FILE__)}
DESC
- task :setup do
-
- # Settings
- fetch(:memcached_namespace)
- fetch_or_default(:memcached_ttl, 3600)
- fetch_or_default(:memcached_readonly, false)
- fetch_or_default(:memcached_urlencode, false)
- fetch_or_default(:memcached_c_threshold, 10000)
- fetch_or_default(:memcached_compression, true)
- fetch_or_default(:memcached_debug, false)
- fetch_or_default(:memcached_servers, [ "localhost:11211" ])
- fetch_or_default(:memcached_yml_template, "memcached/memcached.yml.erb")
-
+ task_arg(:memcached_namespace, "Namespace")
+ task_arg(:memcached_ttl, "TTL in seconds", :default => 3600)
+ task_arg(:memcached_readonly, "Read only enabled", :default => false)
+ task_arg(:memcached_urlencode, "URL encode enabled", :default => false)
+ task_arg(:memcached_c_threshold, "C Threshold", :default => 10000)
+ task_arg(:memcached_compression, "Compression enabed", :default => true)
+ task_arg(:memcached_debug, "Debug enabled", :default => false)
+ task_arg(:memcached_servers, "List of servers", :default => ["localhost:11211"], :default_desc => "[\"localhost:11211\"]")
+ task_arg(:memcached_yml_template, "Memcached yml template", :default => "memcached/memcached.yml.erb")
+ task :setup do
put(memcached_yml_template, "#{shared_path}/config/memcached.yml")
end
desc "Symlink memcached configuration after deploy."
task :update_code, :roles => :app do
\ No newline at end of file