class Locum::Cap

Public Class Methods

source_root() click to toggle source
# File lib/locum/cap.rb, line 7
def self.source_root
  File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
end

Public Instance Methods

arguments() click to toggle source
# File lib/locum/cap.rb, line 11
def arguments
  hu   = Locum::HostingUnit.get
  ping = Locum::Ping.new

  ping.call

  @login   = ping.login
  @project = File.basename(Dir.pwd)
  @user    = hu.login
  @server  = hu.server

  @cap_version = Gem::Specification.find_by_name('capistrano').version.to_s
end
capfile() click to toggle source
# File lib/locum/cap.rb, line 25
def capfile
  template('templates/capfile.erb', 'Capfile')
end
deploy_rb() click to toggle source
# File lib/locum/cap.rb, line 29
def deploy_rb
  template('templates/deploy.erb', 'config/deploy.rb')
end
locum_stage() click to toggle source
# File lib/locum/cap.rb, line 33
def locum_stage
  template('templates/locum.erb', 'config/deploy/locum.rb')
end
notify() click to toggle source
# File lib/locum/cap.rb, line 41
    def notify
      cn.say <<EOFBLOCK

   Для проекта создана конфигурация Capistrano и настроен деплой для
   окружения locum. Проверьте версию ruby в файле <%= color('config/deploy.rb', BOLD) %>
   и используйте <%= color('cap locum deploy', BOLD) %> для выкладки изменений на сервер.

EOFBLOCK
    end
ssh_key() click to toggle source
# File lib/locum/cap.rb, line 37
def ssh_key
  Locum::CLI.start(['ssh_key', 'add'])
end