Class: Daemonz::Generators::DaemonGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/daemonz/generators/daemon/daemon_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/daemonz/generators/daemon/daemon_generator.rb', line 7

def self.source_root
  @source_root ||= File.expand_path 'templates', File.dirname(__FILE__)
end

Instance Method Details

#create_harnessObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/daemonz/generators/daemon/daemon_generator.rb', line 11

def create_harness
  empty_directory 'config/daemonz'
  template "config.yml", "config/daemonz/#{file_name}.yml"

  empty_directory 'script/background'
  template 'daemon.rb.erb', "script/background/#{file_name}.rb"

  empty_directory 'test/integration'
  template 'integration_test.rb.erb', "test/integration/#{file_name}_test.rb"
end