Class: SchedulerTaskGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/scheduler_daemon/rails/generators/scheduler_task/scheduler_task_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



9
10
11
# File 'lib/scheduler_daemon/rails/generators/scheduler_task/scheduler_task_generator.rb', line 9

def self.source_root
  File.dirname(File.expand_path(__FILE__))
end

Instance Method Details

#create_taskObject



4
5
6
7
# File 'lib/scheduler_daemon/rails/generators/scheduler_task/scheduler_task_generator.rb', line 4

def create_task
  template File.join(source_dir, 'example_task.rb'), "scheduled_tasks/#{file_name}_task.rb"
  readme(File.join(template_dir, 'README'))
end