lib/capitate/plugins/utils.rb in capitate-0.2.11 vs lib/capitate/plugins/utils.rb in capitate-0.2.13
- old
+ new
@@ -25,16 +25,18 @@
# See template plugin for where template paths are loaded from.
#
# ==== Options
# +template_path+:: Path to template
# +destination+:: Remote path to evaluated template
- # +options+::
- # - +user+:: User to install (-o)
- # - +mode+:: Mode to install file (-m)
+ # +options+:: Options (see Install template options)
#
+ # ==== Install template options
+ # +user+:: User to install (-o). Defaults to *root*.
+ # +mode+:: Mode to install file (-m)
+ #
# ==== Example
- # utils.install_template("monit/memcached.monitrc.erb", "/etc/monit/memcached.monitrc")
+ # utils.install_template("monit/memcached.monitrc.erb", "/etc/monit/memcached.monitrc", :user => "root", :mode => "600")
#
def install_template(template_path, destination, options = {})
# Truncate extension
tmp_file_path = template_path.gsub("/", "_").gsub(/.erb$/, "")
tmp_path = "/tmp/#{tmp_file_path}"
@@ -94,10 +96,10 @@
# Optionally check that it exists before adding.
#
# ==== Options
# +path+:: Path to file to append to
# +data+:: String data to append
- # +check+:: If not nil, will check to see if egrep matches "^string_to_check" and will not re-append
+ # +check+:: If not nil, will check to see if egrep matches this regex and will not re-append
# +left_strip+:: If true (default), remove whitespace before lines
# +should_exist+:: If true (default), raise error if file does not exist
#
def append_to(path, data, check = nil, left_strip = true, should_exist = true)
# If checking and found expression then abort append
\ No newline at end of file