Sha256: 39eeb2cef4979015b08fdc6051f3d72b70c086da40ee1ae5367c2c6a99c3338b

Contents?: true

Size: 457 Bytes

Versions: 32

Compression:

Stored size: 457 Bytes

Contents

class SimpleWorkerGenerator < Rails::Generators::NamedBase
  source_root File.expand_path("../templates", __FILE__)
 
  desc "Creates a new skeleton worker - NAME is camelized"
  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
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
simple_worker-3.0.0 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.10 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.9 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.8 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.6 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.5 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.4 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.3 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.2 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.1 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.17 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-1.0.14 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.16 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.15 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-1.0.13 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.11 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.10 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.9 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-2.0.0.beta.8 lib/generators/simple_worker/simple_worker_generator.rb
simple_worker-1.0.12 lib/generators/simple_worker/simple_worker_generator.rb