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


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

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

#deploy_toObject


14
15
16
# File 'lib/generators/rocket_cms/capify_generator.rb', line 14

def deploy_to
  "/data/#{app_name.downcase}/app"
end

#installObject


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

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

#tmp_pathObject


17
18
19
# File 'lib/generators/rocket_cms/capify_generator.rb', line 17

def tmp_path
  "/data/#{app_name.downcase}/tmp_dump"
end