Class: Rails::Generators::PluginGenerator

Inherits:
NamedBase show all
Defined in:
railties/lib/rails/generators/rails/plugin/plugin_generator.rb

Instance Method Summary collapse

Methods inherited from NamedBase

#initialize

Methods inherited from Base

base_root, class_option, default_source_root, desc, hook_for, inherited, namespace, remove_hook_for, source_root

Methods included from Actions

#add_source, #capify!, #environment, #gem, #generate, #git, #initializer, #lib, #plugin, #rake, #rakefile, #readme, #route, #vendor

Constructor Details

This class inherits a constructor from Rails::Generators::NamedBase

Instance Method Details

#create_lib_filesObject



21
22
23
# File 'railties/lib/rails/generators/rails/plugin/plugin_generator.rb', line 21

def create_lib_files
  directory 'lib', plugin_dir('lib'), :recursive => false
end

#create_root_filesObject



17
18
19
# File 'railties/lib/rails/generators/rails/plugin/plugin_generator.rb', line 17

def create_root_files
  directory '.', plugin_dir, :recursive => false
end

#create_tasks_filesObject



25
26
27
28
# File 'railties/lib/rails/generators/rails/plugin/plugin_generator.rb', line 25

def create_tasks_files
  return unless options[:tasks]
  directory 'lib/tasks', plugin_dir('lib/tasks')
end

#show_deprecationObject



9
10
11
12
13
# File 'railties/lib/rails/generators/rails/plugin/plugin_generator.rb', line 9

def show_deprecation
  return unless behavior == :invoke
  message = "Plugin generator is deprecated, please use 'rails plugin new' command to generate plugin structure."
  ActiveSupport::Deprecation.warn message
end