class Velcro::Status::Symlinks
Provide information about the symlinked dotfiles
Public Class Methods
installed?()
click to toggle source
# File lib/velcro/status/symlinks.rb, line 17 def self.installed? linker = Velcro::Symlinker.new linker.symlinks.select{|s| !linker.symlinked?(s) }.empty? end
print()
click to toggle source
# File lib/velcro/status/symlinks.rb, line 5 def self.print linker = Velcro::Symlinker.new symlinks = linker.symlinks puts "## Symlinks - #{symlinks.length} symlink files:" length = symlinks.group_by(&:size).max.last[0].length linker.symlinks.each do |symlink| state = linker.symlinked?(symlink) ? "~/.#{File.basename(symlink)}" : 'Unlinked!' print_pair(length, symlink, state, '=>') end end
print_pair(length, first, second, delim = '')
click to toggle source
# File lib/velcro/status/symlinks.rb, line 22 def self.print_pair(length, first, second, delim = '') printf "%-#{length}s #{delim} %s\n", first, second end