Class: Pu::Field::RendererGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
PlutoniumGenerators::Generator
Defined in:
lib/generators/pu/field/renderer/renderer_generator.rb

Instance Method Summary collapse

Methods included from PlutoniumGenerators::Generator

included

Methods included from PlutoniumGenerators::Concerns::Logger

#debug, #error, #exception, #info, #success, #warn

Methods included from PlutoniumGenerators::Concerns::Config

#read_config, #write_config

Instance Method Details

#startObject



16
17
18
19
20
21
22
23
# File 'lib/generators/pu/field/renderer/renderer_generator.rb', line 16

def start
  in_root do
    template "renderer.rb", "app/plutonium/fields/renderers/#{name.underscore}_renderer.rb"
    insert_into_file "config/initializers/plutonium.rb", registration_statement, after: /.*# Register components here.*\n/
  end
rescue => e
  exception "#{self.class} failed:", e
end