Class: Core::LayoutGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/core/layout/layout_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ LayoutGenerator

Returns a new instance of LayoutGenerator.



10
11
12
13
# File 'lib/generators/core/layout/layout_generator.rb', line 10

def initialize(*args, &block)
  super
  @file_name = name
end

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



4
5
6
# File 'lib/generators/core/layout/layout_generator.rb', line 4

def file_name
  @file_name
end

Instance Method Details

#copy_buttonsObject



27
28
29
# File 'lib/generators/core/layout/layout_generator.rb', line 27

def copy_buttons
  directory "images", "public/images"
end

#copy_core_helperObject



23
24
25
# File 'lib/generators/core/layout/layout_generator.rb', line 23

def copy_core_helper
  template 'core_helper.rb', File.join('app/helpers', "core_helper.rb")
end

#copy_layout_fileObject



15
16
17
# File 'lib/generators/core/layout/layout_generator.rb', line 15

def copy_layout_file
  template "views/#{view_language}/layout.html.#{view_language}", "app/views/layouts/#{name}.html.#{view_language}"
end

#copy_sidebar_fileObject



19
20
21
# File 'lib/generators/core/layout/layout_generator.rb', line 19

def copy_sidebar_file
  template "views/#{view_language}/_sidebar.html.#{view_language}", "app/views/shared/_sidebar.html.#{view_language}"
end

#copy_static_filesObject



31
32
33
34
# File 'lib/generators/core/layout/layout_generator.rb', line 31

def copy_static_files
  directory "stylesheets", "app/stylesheets/#{file_name}"
  copy_file 'core.js', "public/javascripts/core.js"
end