class Musako::Cli::Generator

Public Class Methods

process(args) click to toggle source
# File lib/musako/cli/generator.rb, line 4
def self.process(args)
  if args.empty?
    args = ["."]
  end

  path = File.expand_path(args[0], Dir.pwd)

  if !Dir["#{path}/posts"].empty?
    raise "Error: musako project exists and is not empty."
  end

  create_templates path
end

Private Class Methods

create_templates(path) click to toggle source
# File lib/musako/cli/generator.rb, line 20
def self.create_templates(path)
  t = template
  FileUtils.cp_r t + '/.', path
end
template() click to toggle source
# File lib/musako/cli/generator.rb, line 25
def self.template
  File.expand_path("../../templates", File.dirname(__FILE__))
end