class Profile

Attributes

folder[RW]

Public Class Methods

new(folder) click to toggle source
# File lib/profile.rb, line 4
def initialize(folder)
  @folder = folder
end

Public Instance Methods

execute() click to toggle source
# File lib/profile.rb, line 8
def execute
  prepare_folder
  create_symlinks(@files)
end
path() click to toggle source
# File lib/profile.rb, line 44
def path
  File.expand_path("~/#{folder}")
end
prepare_folder() click to toggle source
# File lib/profile.rb, line 13
def prepare_folder
  @files = []
  Dir.foreach(path) do |file|
    unless file == '.git'
      remove_old_symlinks(file)
      remove_existing_files(file)
    end
  end
end
remove_existing_files(file) click to toggle source
# File lib/profile.rb, line 29
def remove_existing_files(file)
  if File.exist?("#{path}/../#{file}")
    puts "The #{file} already exists"
  else
    @files << file
  end
end