Class: Remoting::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/remoting/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_remote_rakeObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/generators/remoting/install_generator.rb', line 26

def create_remote_rake
  
  create_file "lib/tasks/remote/remote.rake", <<-eos
namespace :remote do
  desc "Deploy application on server"
  task :deploy => [:push, :bundle, :"assets:compile", :restart] do
  end
end
  
eos
  
  
end

#create_remote_ymlObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/remoting/install_generator.rb', line 7

def create_remote_yml
  appname = Rails.application.class.to_s.split("::").first.underscore
  host = options[:host]
  user = options[:user] 
  
  stub = <<-STUB
remote:
  login: #{user}@#{host}
  dest: /var/#{user}/#{appname}
  repo: ssh://#{user}@#{host}/var/ror/git/#{appname}.git
  ruby: 1.9.3
  tmp: /tmp
  app: #{appname}
  STUB
  
  create_file "config/remote.yml", stub
  
end