class Theme

Constants

DEFAULT_NAME

Public Class Methods

new(theme_name = nil) click to toggle source
# File lib/wp_scaffold/models/generators/theme.rb, line 14
def initialize(theme_name = nil)
        self.name = theme_name.nil? ? DEFAULT_NAME : theme_name.downcase
        self.destination = ""
        self.template_path = "theme"
        self.relative_to_cwd = true
end

Public Instance Methods

generate() click to toggle source
Calls superclass method Generator#generate
# File lib/wp_scaffold/models/generators/theme.rb, line 5
def generate
        super
        # rename the theme's root folder
        base_path = USER_DIRECTORY + self.destination
        File.rename(base_path + "/custom_theme", base_path + "/" + self.name.to_underscore)
end