Class: LockJar::CLI

Inherits:
Thor
  • Object
show all
Extended by:
ClassMethods
Defined in:
lib/lock_jar/cli.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from ClassMethods

generate_jarfile_option, generate_lockfile_option, generate_scopes_option, verbose_option

Instance Method Details

#installObject



59
60
61
62
63
# File 'lib/lock_jar/cli.rb', line 59

def install
  handle_verbose(options[:verbose])
  puts "Installing Jars from #{options[:lockfile]} for #{options[:scopes].inspect}"
  LockJar.install(options[:lockfile], options[:scopes])
end

#listObject



69
70
71
72
73
# File 'lib/lock_jar/cli.rb', line 69

def list
  handle_verbose(options[:verbose])
  puts "Listing Jars from #{options[:lockfile]} for #{options[:scopes].inspect}"
  puts LockJar.list(options[:lockfile], options[:scopes]).inspect
end

#lockObject



79
80
81
82
83
# File 'lib/lock_jar/cli.rb', line 79

def lock
  handle_verbose(options[:verbose])
  puts "Locking #{options[:jarfile]} to #{options[:lockfile]}"
  LockJar.lock(options[:jarfile], lockfile: options[:lockfile])
end

#versionObject



51
52
53
# File 'lib/lock_jar/cli.rb', line 51

def version
  puts LockJar::VERSION
end