Class: Curly::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/curly/install/install_generator.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name


9
10
11
# File 'lib/generators/curly/install/install_generator.rb', line 9

def app_name
  @app_name
end

Instance Method Details

#generate_layoutObject


11
12
13
14
15
16
17
# File 'lib/generators/curly/install/install_generator.rb', line 11

def generate_layout
  app = ::Rails.application
  @app_name = app.class.to_s.split("::").first
  remove_file 'app/views/layouts/application.html.erb'
  template "layout.html.curly.erb", "app/views/layouts/application.html.curly"
  template "layout_presenter.rb.erb", "app/presenters/layouts/application_presenter.rb"
end