class Ellen::Commands::Generate

Public Instance Methods

call() click to toggle source
# File lib/ellen/commands/generate.rb, line 6
def call
  valid? ? copy : die
end

Private Instance Methods

copy() click to toggle source
# File lib/ellen/commands/generate.rb, line 12
def copy
  FileUtils.cp_r(templates_directory_path, destination_path)
end
destination_path() click to toggle source
# File lib/ellen/commands/generate.rb, line 24
def destination_path
  "./ellen/"
end
die() click to toggle source
# File lib/ellen/commands/generate.rb, line 16
def die
  Ellen.die("#{destination_path} already exists.")
end
templates_directory_path() click to toggle source
# File lib/ellen/commands/generate.rb, line 20
def templates_directory_path
  File.expand_path("../../../../templates", __FILE__)
end
valid?() click to toggle source
# File lib/ellen/commands/generate.rb, line 28
def valid?
  !File.exists?(destination_path)
end