Sha256: 6e50d49111d0eea36089dfabe0822b4eaaa7a8f48ecbf45deaf5cbe34fa0a205
Contents?: true
Size: 694 Bytes
Versions: 5
Compression:
Stored size: 694 Bytes
Contents
require 'ftools' module Decoct module Dmeta include Decoct::Dconstants def copy_file(from, to) if from.is_a?(Array) && to.is_a?(Array) from.each_index {|i| copy_file(from[i], to[i])} else File.copy(Dconstants::TEMPLATES + from, to) end end module ClassMethods def create_dir(name) if name.is_a?(Array) name.map {|x| create_dir(x)} else define_method("create_#{name}") do path = "#{@app_name}#{File::SEPARATOR}#{name}" Dir.mkdir(path) if !test(?d, path) puts "Created #{path}" end end end end def self.included(host_class) host_class.extend(ClassMethods) end end end
Version data entries
5 entries across 5 versions & 2 rubygems