Sha256: 90d2672f0e53ca82c0649cb6ce5e35f671a267c61190ce30f429926004558342
Contents?: true
Size: 572 Bytes
Versions: 12
Compression:
Stored size: 572 Bytes
Contents
require "fileutils" module Ruboty module Commands class Generate < Base def call valid? ? copy : die end private def copy FileUtils.cp_r(templates_directory_path, destination_path) end def die Ruboty.die("#{destination_path} already exists.") end def templates_directory_path File.expand_path("../../../../templates", __FILE__) end def destination_path "./ruboty/" end def valid? !File.exist?(destination_path) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems