Class: Archfiend::Generators::Daemon

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/archfiend/generators/daemon.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

Returns Path to templates, used by Thor.

Returns:

  • Path to templates, used by Thor



11
12
13
# File 'lib/archfiend/generators/daemon.rb', line 11

def self.source_root
  File.join(File.dirname(__FILE__), 'daemon', 'templates')
end

Instance Method Details

#createObject

Creates a new daemon



16
17
18
19
20
21
22
23
24
25
# File 'lib/archfiend/generators/daemon.rb', line 16

def create
  # Init phase, creating directory structure and applying templates
  extensions.run_with_init_callbacks do
    create_from_templates
  end
  # Exec phase, running any due setup
  extensions.run_with_exec_callbacks do
    bundle_install unless skip_bundle_install?
  end
end