class Dotrepo::CLI

Public Instance Methods

info() click to toggle source
# File lib/dotrepo/cli.rb, line 13
def info
  config = Dotrepo::ConfigFile.new
  [:source, :destination].each do |attr|
    shell.say_status "#{attr}:", config.send(attr), :bold
  end
end
refresh() click to toggle source
# File lib/dotrepo/cli.rb, line 58
def refresh
  # runs the manager again to symlink new files & prune abandoned files
  DotFileManager.new( config.source, config.destination ).symlink_dotfiles
end
repo() click to toggle source
# File lib/dotrepo/cli.rb, line 64
def repo
  puts File.expand_path(config.source)
end
setup() click to toggle source
# File lib/dotrepo/cli.rb, line 32
def setup
  if options[:repo]
    system "git clone #{options[:repo]} #{config.source}"
  else
    unless options[:"no-repo"]
      shell.say_status "error", "you must specify a repo", :red
      return
    end
  end

  manager = DotFileManager.new( config.source, config.destination )
  manager.symlink_dotfiles

  if options[:files]
    options[:files].each do |file_path|
      file = DotFile.new( file_path, manager )
      unless file.linked?
        file.create_linked_file!
      else
        shell.say_status "info", "#{file_path} already linked", :bold
      end
    end
  end
end
uninstall() click to toggle source
# File lib/dotrepo/cli.rb, line 69
def uninstall
  say "method not implemented yet"
end
version() click to toggle source
# File lib/dotrepo/cli.rb, line 8
def version
  say "Dotrepo::VERSION #{Dotrepo::VERSION}"
end

Private Instance Methods

config() click to toggle source
# File lib/dotrepo/cli.rb, line 75
def config
  @_config ||= Dotrepo::ConfigFile.new
end