Class: Pu::Eject::LayoutGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
PlutoniumGenerators::Generator
Defined in:
lib/generators/pu/eject/layout/layout_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
24
25
# File 'lib/generators/pu/eject/layout/layout_generator.rb', line 16

def start
  destination_dir = (destination_portal == "main_app") ? "app/views/" : "packages/#{destination_portal}/app/views/"
  [
    "layouts/resource.html.erb"
  ].each do |file|
    copy_file Plutonium.root.join("app", "views", file), Rails.root.join(destination_dir, file)
  end
rescue => e
  exception "#{self.class} failed:", e
end