Top Level Namespace

Defined Under Namespace

Modules: NubisRailsBoilerplate

Instance Method Summary collapse

Instance Method Details

#remote_file_exists?(full_path) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/capistrano_recipes/base.rb', line 10

def remote_file_exists?(full_path)
  'true' ==  capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end

#set_default(name, *args, &block) ⇒ Object



6
7
8
# File 'lib/capistrano_recipes/base.rb', line 6

def set_default(name, *args, &block)
  set(name, *args, &block) unless exists?(name)
end

#template(from, to) ⇒ Object



1
2
3
4
# File 'lib/capistrano_recipes/base.rb', line 1

def template(from, to)
  erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
  put ERB.new(erb).result(binding), to
end