class Object

Public Instance Methods

get_clouddb_password() click to toggle source
# File lib/cl_mina/tasks/clouddb.rb, line 11
def get_clouddb_password
  if !clouddb_password
    pw = ask "Database password: " do |p|
      p.echo = '*'
    end
    set :clouddb_password, pw
  end
end
get_postgresql_password() click to toggle source
# File lib/cl_mina/tasks/postgresql.rb, line 30
def get_postgresql_password
  if !postgresql_password
    pw = ask "Postgresql password: " do |p|
      p.echo = '*'
    end
    set :postgresql_password, pw
  end
end
template(from, to, *opts) click to toggle source
# File lib/cl_mina/tasks/utility.rb, line 30
def template(from, to, *opts)
  templates_path ||= File.expand_path("../../templates", __FILE__)
  queue %{echo "-----> Creating file at #{to} using template #{from}"}
  if opts.include? :tee
    command = ''
    command << 'sudo ' if opts.include? :sudo
    command << %{tee #{to} <<'zzENDOFFILEzz' > /dev/null\n}
    command << %{#{erb("#{templates_path}/#{from}")}}
    command << %{\nzzENDOFFILEzz}
  else
    command = %{echo '#{erb("#{templates_path}/#{from}")}' > #{to}}
  end
  queue command
end