Class: Sidekiq::Generators::WorkerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Sidekiq::Generators::WorkerGenerator
- Defined in:
- lib/generators/sidekiq/worker_generator.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.default_generator_root ⇒ Object
10 11 12 |
# File 'lib/generators/sidekiq/worker_generator.rb', line 10 def self.default_generator_root File.dirname(__FILE__) end |
Instance Method Details
#create_test_file ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/sidekiq/worker_generator.rb', line 18 def create_test_file return unless test_framework if test_framework == :rspec create_worker_spec else create_worker_test end end |
#create_worker_file ⇒ Object
14 15 16 |
# File 'lib/generators/sidekiq/worker_generator.rb', line 14 def create_worker_file template "worker.rb.erb", File.join("app/workers", class_path, "#{file_name}_worker.rb") end |