class Fontist::RepoCLI

Public Instance Methods

list() click to toggle source
# File lib/fontist/repo_cli.rb, line 37
def list
  Repo.list.each do |name|
    Fontist.ui.say(name)
  end
  CLI::STATUS_SUCCESS
end
remove(name) click to toggle source
# File lib/fontist/repo_cli.rb, line 26
def remove(name)
  Repo.remove(name)
  Fontist.ui.success(
    "Fontist repo '#{name}' has been successfully removed.",
  )
  CLI::STATUS_SUCCESS
rescue Errors::RepoNotFoundError
  handle_repo_not_found(name)
end
setup(name, url) click to toggle source
# File lib/fontist/repo_cli.rb, line 6
def setup(name, url)
  Repo.setup(name, url)
  Fontist.ui.success(
    "Fontist repo '#{name}' from '#{url}' has been successfully set up.",
  )
  CLI::STATUS_SUCCESS
end
update(name) click to toggle source
# File lib/fontist/repo_cli.rb, line 15
def update(name)
  Repo.update(name)
  Fontist.ui.success(
    "Fontist repo '#{name}' has been successfully updated.",
  )
  CLI::STATUS_SUCCESS
rescue Errors::RepoNotFoundError
  handle_repo_not_found(name)
end

Private Instance Methods

handle_repo_not_found(name) click to toggle source
# File lib/fontist/repo_cli.rb, line 46
def handle_repo_not_found(name)
  Fontist.ui.error("Fontist repo '#{name}' is not found.")
  CLI::STATUS_REPO_NOT_FOUND
end