Sha256: b4713005872576d153596019cf52b989f7deb57899e3e22300453a2fd81406af

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

require 'ftools'
require File.join(File.dirname(__FILE__), "..", 'lib', 'dconstants')

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
					#attr_reader name - tests do not break on commenting this out
					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

1 entries across 1 versions & 1 rubygems

Version Path
andhapp-decoct-1.9.6 lib/dmeta.rb