blob: d43a8df03fbd891197c15bbe33d7fd7b95866ffd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
class PluginGenerator < Rails::Generator::NamedBase
attr_reader :plugin_path
def initialize(*args)
super
@plugin_path = "vendor/plugins/#{file_name}"
end
def manifest
record do |m|
m.directory "#{plugin_path}/lib"
m.directory "#{plugin_path}/tasks"
m.directory "#{plugin_path}/test"
m.template 'README', "#{plugin_path}/README"
m.template 'Rakefile', "#{plugin_path}/Rakefile"
m.template 'init.rb', "#{plugin_path}/init.rb"
m.template 'plugin.rb', "#{plugin_path}/lib/#{file_name}.rb"
m.template 'tasks.rake', "#{plugin_path}/tasks/#{file_name}_tasks.rake"
m.template 'unit_test.rb', "#{plugin_path}/test/#{file_name}_test.rb"
end
end
end
|