Sha256: 4532ef44a8d4a6c8ce4369f0cf9112ce1ecf887ac4c3aaa31c089984b9a8b6e4

Contents?: true

Size: 630 Bytes

Versions: 3

Compression:

Stored size: 630 Bytes

Contents

module Dotman
  class Collect

    def create_dotman
      if !File.directory?("#{ENV['HOME']}/dotfiles")
        FileUtils.mkdir("#{ENV['HOME']}/dotfiles")
      end
      collect_dotfiles
    end

    def collect_dotfiles
      puts "collecting..."
      Dir.entries("#{ENV['HOME']}").each do |file|
        if file =~ /^.{1}[a-zA-Z1-9]+\z/
          copy_over_dot file
        end
      end
    end

    def copy_over_dot file
      if !File.directory?("#{ENV['HOME']}/#{file}")
        puts "copying #{file} to dotfiles"
        FileUtils.copy "#{ENV['HOME']}/#{file}", "#{ENV['HOME']}/dotfiles"  
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dotman-0.0.3.3 lib/dotman/collect.rb
dotman-0.0.3.2 lib/dotman/collect.rb
dotman-0.0.3.1 lib/dotman/collect.rb