Class: Nsweb::Generators::PluginGenerator
- Defined in:
- lib/generators/nsweb/plugin/plugin_generator.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #create_engine ⇒ Object
- #create_plugin ⇒ Object
- #create_routes ⇒ Object
-
#initialize(*args, &block) ⇒ PluginGenerator
constructor
A new instance of PluginGenerator.
Methods inherited from Base
Constructor Details
#initialize(*args, &block) ⇒ PluginGenerator
Returns a new instance of PluginGenerator.
7 8 9 |
# File 'lib/generators/nsweb/plugin/plugin_generator.rb', line 7 def initialize(*args, &block) super end |
Instance Method Details
#create_engine ⇒ Object
21 22 23 |
# File 'lib/generators/nsweb/plugin/plugin_generator.rb', line 21 def create_engine template 'engine.rb', File.join(plugin_path, 'lib/engine.rb') end |
#create_plugin ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/nsweb/plugin/plugin_generator.rb', line 11 def create_plugin template 'plugin.rb', "#{plugin_path}.rb" #File.join(plugin_path, "#{plugin_file_name}.rb") if test_framework == :rspec template 'tests/rspec.rb', File.join('spec', "#{plugin_path}_spec.rb") #, "#{plugin_file_name}_spec.rb") else end end |
#create_routes ⇒ Object
25 26 27 |
# File 'lib/generators/nsweb/plugin/plugin_generator.rb', line 25 def create_routes template 'routes.rb', File.join(plugin_path, 'config/routes.rb') end |