Module: Dextery::Generator

Defined in:
lib/dextery/generator.rb

Class Method Summary collapse

Class Method Details

.manifest(args, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/dextery/generator.rb', line 3

def self.manifest(args, options = {})
  raise ArgumentError.new("You must specify a path") if args.empty?

  new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
  if preserve_source_location?(new_blog_path, options)
    Dextery.logger.error "Conflict: #{new_blog_path} exists and is not empty."
  else
    clean_directory(new_blog_path) if options[:force]
    copy_bootstrap(new_blog_path)
    notify_success
  end
end