Sha256: d66316d2046da9e42d0563dcef56b745d44c52cba27f9ab0c2a8faf38311d2a4
Contents?: true
Size: 919 Bytes
Versions: 3
Compression:
Stored size: 919 Bytes
Contents
class TheCommentsGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) # argument :xname, type: :string, default: :xname def generate_controllers if gen_name == 'install' cp_setup cp_controllers elsif gen_name == 'controllers' cp_controllers else puts 'TheComments Generator - wrong Name' puts 'Try to use [install|controllers]' end end private def gen_name name.to_s.downcase end def cp_setup copy_file 'the_comments.rb', 'config/initializers/the_comments.rb' end def cp_controllers copy_file 'comments_controller.rb', 'app/controllers/comments_controller.rb' copy_file 'ip_black_lists_controller.rb', 'app/controllers/ip_black_lists_controller.rb' copy_file 'user_agent_black_lists_controller.rb', 'app/controllers/user_agent_black_lists_controller.rb' end end
Version data entries
3 entries across 3 versions & 1 rubygems