Top Level Namespace
Defined Under Namespace
Modules: Trireme, UtilityHelper
Instance Method Summary
collapse
Instance Method Details
#get_postgresql_password ⇒ Object
30
31
32
33
34
35
36
37
|
# File 'lib/trireme/templates/lib/mina/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) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/trireme/templates/lib/mina/utility.rb', line 32
def template(from, to, *opts)
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 echo_cmd command
end
|