Top Level Namespace
Defined Under Namespace
Modules: CapRecipes, RobCapRecipes
Instance Method Summary
collapse
Instance Method Details
#add_apt_repository(repo) ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/rob_cap_recipes/recipes/common.rb', line 9
def add_apt_repository(repo)
run "#{sudo} add-apt-repository #{repo}", :pty => true do |ch, stream, data|
if data =~ /\[ENTER\]/
ch.send_data("\n")
else
Capistrano::Configuration.default_io_proc.call(ch, stream, data)
end
end
end
|
#template(from, to) ⇒ Object
1
2
3
4
5
6
7
|
# File 'lib/rob_cap_recipes/recipes/common.rb', line 1
def template(from, to)
erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
str = StringIO.new(ERB.new(erb).result(binding))
on roles(:app) do |host|
upload!(str, to)
end
end
|