Class: RocketCms::CapifyGenerator

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

Instance Method Summary collapse

Instance Method Details

#app_nameObject



11
12
13
# File 'lib/generators/rocket_cms/capify_generator.rb', line 11

def app_name
  Rails.application.class.name.split("::")[0]
end

#deploy_toObject



15
16
17
18
19
20
21
# File 'lib/generators/rocket_cms/capify_generator.rb', line 15

def deploy_to
  if kind == 'data'
    "/data/#{app_name.downcase}/app"
  else
    "/home/#{app_name.downcase}/#{app_name.downcase}"
  end
end

#installObject



31
32
33
34
35
36
37
# File 'lib/generators/rocket_cms/capify_generator.rb', line 31

def install
  copy_file "Capfile", "Capfile"
  template "unicorn.erb", "config/unicorn/production.rb"
  template "deploy.erb", "config/deploy.rb"
  template "production.erb", "config/deploy/production.rb"
  template "dl.erb", "lib/tasks/dl.thor"
end

#tmp_pathObject



22
23
24
25
26
27
28
# File 'lib/generators/rocket_cms/capify_generator.rb', line 22

def tmp_path
  if kind == 'data'
    "/data/#{app_name.downcase}/tmp_dump"
  else
    "/home/#{app_name.downcase}/tmp_dump"
  end
end