Class: SimpleWorkerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/simple_worker/simple_worker_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_worker_fileObject



5
6
7
8
9
10
11
12
# File 'lib/generators/simple_worker/simple_worker_generator.rb', line 5

def create_worker_file
  # file_name needs to be classified
  @camel = file_name.camelize
  if not File.directory? "#{Rails.root}/app/workers"
    Dir.mkdir "#{Rails.root}/app/workers"
  end
  template "template_worker.erb", "app/workers/#{file_name}.rb" 
end