lib/generators/ucasy/install/install_generator.rb in ucasy-0.0.1 vs lib/generators/ucasy/install/install_generator.rb in ucasy-0.0.3
- old
+ new
@@ -2,20 +2,19 @@
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("templates", __dir__)
desc "Generates a application use case base."
def create_use_case_base
- copy_file "use_case_base.rb", use_case_path
- copy_file ".rspec", Rails.root.join(".rspec")
+ copy_file "use_case_base.rb.tt", use_case_path
end
private
def use_case_path
- Rails.root.join("app/#{GENERATOR_FOLDER_NAME}/use_case_base.rb")
+ Rails.root.join("app/#{generator_folder_name}/use_case_base.rb")
end
- def GENERATOR_FOLDER_NAME
+ def generator_folder_name
return Ucasy::GENERATOR_FOLDER_NAME if defined?(Ucasy::GENERATOR_FOLDER_NAME)
Ucasy::DEFAULT_GENERATOR_FOLDER_NAME
end
end