class ThemesOnRails::Generators::ThemeGenerator

Public Instance Methods

copy_layout_file() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 23
def copy_layout_file
  template_engine = Rails.configuration.app_generators.rails[:template_engine]
  if template_engine == :liquid
    template "layout.html.liquid", "#{theme_views_layout}/#{theme_name}.liquid"
  elsif template_engine == :haml
    template "layout.html.haml", "#{theme_views_layout}/#{theme_name}.html.haml"
  else
    template "layout.html.erb", "#{theme_views_layout}/#{theme_name}.html.erb"
  end
end
copy_manifest_files() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 18
def copy_manifest_files
  copy_file       "all.js", "#{theme_javascripts_directory}/all.js"
  copy_file       "all.css", "#{theme_stylesheets_directory}/all.css"
end
create_theme_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 8
def create_theme_directory
   empty_directory theme_views_layout
   empty_directory theme_images_directory
   empty_directory theme_javascripts_directory
   empty_directory theme_stylesheets_directory
   empty_directory theme_locales_directory
   create_file     "#{theme_images_directory}/.gitkeep", nil
   create_file     "#{theme_locales_directory}/.gitkeep", nil
 end

Private Instance Methods

theme_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 36
def theme_directory
  "app/themes/#{theme_name}"
end
theme_images_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 44
def theme_images_directory
  "#{theme_directory}/assets/images/#{theme_name}"
end
theme_javascripts_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 48
def theme_javascripts_directory
  "#{theme_directory}/assets/javascripts/#{theme_name}"
end
theme_locales_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 56
def theme_locales_directory
  "#{theme_directory}/locales"
end
theme_stylesheets_directory() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 52
def theme_stylesheets_directory
  "#{theme_directory}/assets/stylesheets/#{theme_name}"
end
theme_views_layout() click to toggle source
# File lib/generators/themes_on_rails/theme_generator.rb, line 40
def theme_views_layout
  "#{theme_directory}/views/layouts"
end