Class: Image

Inherits:
Thor
  • Object
show all
Defined in:
lib/linecook-gem/cli.rb

Instance Method Summary collapse

Instance Method Details

#fetchObject



21
22
23
24
25
# File 'lib/linecook-gem/cli.rb', line 21

def fetch
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag] )
  image.fetch
end

#keygenObject



7
8
9
# File 'lib/linecook-gem/cli.rb', line 7

def keygen
  puts Linecook::Crypto.keygen
end

#listObject



13
14
15
# File 'lib/linecook-gem/cli.rb', line 13

def list
  puts Linecook::Image.new(nil, nil, nil).list
end

#packageObject



42
43
44
45
46
# File 'lib/linecook-gem/cli.rb', line 42

def package
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag])
  Linecook::Packager.package(image, name: opts[:strategy])
end

#saveObject



53
54
55
56
57
58
# File 'lib/linecook-gem/cli.rb', line 53

def save
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag])
  baker = Linecook::Baker::Baker.new(image, directory: opts[:directory])
  baker.save
end

#uploadObject



31
32
33
34
35
# File 'lib/linecook-gem/cli.rb', line 31

def upload
  opts = options.symbolize_keys
  image = Linecook::Image.new(opts[:name], opts[:group], opts[:tag] )
  image.upload
end