class Velcro::Symlinker

Symlink files from your dotfiles directory to $HOME

Attributes

dryrun[R]
force[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/velcro/symlinker.rb, line 6
def initialize(options = {})
  @dryrun = options[:dryrun]
  @force  = options[:force]
end

Public Instance Methods

skip?(target) click to toggle source
# File lib/velcro/symlinker.rb, line 37
def skip?(target)
  return false unless File.exist?(target)

  if force
    puts "#{target} exists. Forcing removal"
    return false
  end

  puts "#{target} exists. Skipping"
  true
end
symlinked?(symlink) click to toggle source
# File lib/velcro/symlinker.rb, line 31
def symlinked?(symlink)
  filename = File.basename(symlink, '.symlink')
  target   = File.join(Velcro.home, ".#{filename}")
  File.exist?(target)
end