class Ruboty::Commands::Generate
Public Instance Methods
call()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 6 def call valid? ? copy : die end
Private Instance Methods
copy()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 12 def copy FileUtils.cp_r(templates_directory_path, destination_path) end
destination_path()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 24 def destination_path "./ruboty/" end
die()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 16 def die Ruboty.die("#{destination_path} already exists.") end
templates_directory_path()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 20 def templates_directory_path File.expand_path("../../../../templates", __FILE__) end
valid?()
click to toggle source
# File lib/ruboty/commands/generate.rb, line 28 def valid? !File.exist?(destination_path) end