class DotMe::Folder

Public Class Methods

incubates?(path) click to toggle source
# File lib/dotme/incubators/folder.rb, line 15
def self.incubates?(path)
  ::File.directory? path
end

Public Instance Methods

incubate(*to) click to toggle source
# File lib/dotme/incubators/folder.rb, line 3
def incubate(*to)
  begin
    require 'git'

    { :git_clone => Git.open( @path ).config['remote.origin.url'], :to => ::File.join( '~', @relative ) }
  rescue
    FileUtils.cp_r @path, ::File.join( to, @basename )

    { :link => @basename, :to => ::File.join( '~', @relative ) }
  end
end