Mercurial > hg > soundsoftware-site
view .svn/pristine/3e/3e339092f343524c6085cf1a81f2c664a0ae64ee.svn-base @ 1625:808a40a7cac7 live
Have a go at fixing #570 Can't delete downloadable file from version in project with no issue tracker
author | Chris Cannam |
---|---|
date | Thu, 07 Feb 2019 13:48:00 +0000 |
parents | 038ba2d95de8 |
children |
line wrap: on
line source
class RedminePluginControllerGenerator < Rails::Generators::NamedBase source_root File.expand_path("../templates", __FILE__) argument :controller, :type => :string argument :actions, :type => :array, :default => [], :banner => "ACTION ACTION ..." attr_reader :plugin_path, :plugin_name, :plugin_pretty_name def initialize(*args) super @plugin_name = file_name.underscore @plugin_pretty_name = plugin_name.titleize @plugin_path = "plugins/#{plugin_name}" @controller_class = controller.camelize end def copy_templates template 'controller.rb.erb', "#{plugin_path}/app/controllers/#{controller}_controller.rb" template 'helper.rb.erb', "#{plugin_path}/app/helpers/#{controller}_helper.rb" template 'functional_test.rb.erb', "#{plugin_path}/test/functional/#{controller}_controller_test.rb" # View template for each action. actions.each do |action| path = "#{plugin_path}/app/views/#{controller}/#{action}.html.erb" @action_name = action template 'view.html.erb', path end end end