Class: Ucode::Cli::Cache

Inherits:
Thor
  • Object
show all
Defined in:
lib/ucode/cli.rb

Overview

─────────────── cache ───────────────

Instance Method Summary collapse

Instance Method Details

#info(version) ⇒ Object



472
473
474
475
476
477
478
479
# File 'lib/ucode/cli.rb', line 472

def info(version)
  result = Commands::CacheCommand.new.info(version)
  if result.nil?
    puts "Nothing cached for #{version}"
  else
    puts JSON.pretty_generate(result.to_h)
  end
end

#listObject



467
468
469
# File 'lib/ucode/cli.rb', line 467

def list
  Commands::CacheCommand.new.list.each { |v| puts v }
end

#remove(version) ⇒ Object



482
483
484
485
# File 'lib/ucode/cli.rb', line 482

def remove(version)
  ok = Commands::CacheCommand.new.remove(version)
  puts(ok ? "Removed #{version}" : "#{version} not in cache")
end