Class: Nsweb::Generators::PluginGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/nsweb/plugin/plugin_generator.rb

Instance Attribute Summary

Attributes inherited from Base

#plugin_name

Instance Method Summary collapse

Methods inherited from Base

banner, source_root

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_engineObject



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_pluginObject



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_routesObject



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