class Madness::Commands::Theme

Public Instance Methods

colors_command() click to toggle source
# File lib/madness/commands/theme.rb, line 26
def colors_command
  copy_file 'app/styles/_variables.scss', 'css/colors.css'
end
css_command() click to toggle source
# File lib/madness/commands/theme.rb, line 22
def css_command
  copy_file 'app/public/css/main.css', 'css/main.css'
end
full_command() click to toggle source
# File lib/madness/commands/theme.rb, line 15
def full_command
  raise InitError, "Directory #{theme_path} already exists" if Dir.exist? theme_path

  FileUtils.cp_r File.expand_path('../../../app', __dir__), theme_path
  say "Created g`#{theme_path}` theme folder"
end

Private Instance Methods

copy_file(source, target) click to toggle source
# File lib/madness/commands/theme.rb, line 32
def copy_file(source, target)
  raise InitError, "File #{target} already exists" if File.exist? target

  FileUtils.mkdir_p File.dirname(target)
  FileUtils.cp_r File.expand_path("../../../#{source}", __dir__), target
  say "Created g`#{target}`"
end
theme_path() click to toggle source
# File lib/madness/commands/theme.rb, line 40
def theme_path
  args['PATH'] || '_theme'
end