class Object
Public Instance Methods
abort_red(msg)
click to toggle source
# File lib/ratchetify/base.rb, line 4 def abort_red(msg) abort " * \e[#{1};31mERROR: #{msg}\e[0m" end
branch?(full_path)
click to toggle source
working with git
# File lib/ratchetify/helpers.rb, line 63 def branch?(full_path) capture("cd #{full_path} && git branch | grep '*'") end
conf_dir()
click to toggle source
# File lib/ratchetify/helpers.rb, line 21 def conf_dir "/home/#{user}/aconf" end
create_dir(full_path, owner=nil)
click to toggle source
# File lib/ratchetify/helpers.rb, line 41 def create_dir(full_path, owner=nil) run "mkdir #{full_path} -p" if owner run "chown #{owner} #{full_path}" end end
daemon_service()
click to toggle source
# File lib/ratchetify/helpers.rb, line 25 def daemon_service "run-#{application}" end
delete_dir(full_path)
click to toggle source
# File lib/ratchetify/helpers.rb, line 48 def delete_dir(full_path) if dir_exists? full_path run "rm -Rf #{full_path}" end end
delete_file(full_path)
click to toggle source
# File lib/ratchetify/helpers.rb, line 54 def delete_file(full_path) if file_exists? full_path run "rm #{full_path}" end end
deploy_dir()
click to toggle source
# File lib/ratchetify/helpers.rb, line 17 def deploy_dir "#{deploy_root}/#{application}" end
deploy_root()
click to toggle source
# File lib/ratchetify/helpers.rb, line 13 def deploy_root "#{webroot_dir}/apps" end
dir_exists?(full_path)
click to toggle source
# File lib/ratchetify/helpers.rb, line 37 def dir_exists?(full_path) 'true' == capture("if [ -d #{full_path} ]; then echo 'true'; fi").strip end
file_exists?(full_path)
click to toggle source
file and dir handling
# File lib/ratchetify/helpers.rb, line 33 def file_exists?(full_path) 'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip end
on_branch?(full_path, branch)
click to toggle source
# File lib/ratchetify/helpers.rb, line 67 def on_branch?(full_path, branch) branch?(full_path).include? branch end
webroot_dir()
click to toggle source
dirs and other constants
# File lib/ratchetify/helpers.rb, line 9 def webroot_dir "/var/www/virtual/#{user}" end