Class: Capsium::Cli::Package

Inherits:
Thor
  • Object
show all
Extended by:
ThorExt::Start
Defined in:
lib/capsium/cli.rb

Instance Method Summary collapse

Methods included from ThorExt::Start

extended, start

Instance Method Details

#info(path_to_package) ⇒ Object



19
20
21
22
23
24
# File 'lib/capsium/cli.rb', line 19

def info(path_to_package)
  package = Capsium::Package.new(path_to_package)
  puts "Package Path: #{package.path}"
  puts "Routes: #{package.routes.as_json}"
  puts "Manifest: #{package.manifest.as_json}"
end

#manifest(path_to_package) ⇒ Object



29
30
31
32
# File 'lib/capsium/cli.rb', line 29

def manifest(path_to_package)
  package = Capsium::Package.new(path_to_package)
  puts JSON.pretty_generate(package.manifest.as_json)
end

#metadata(path_to_package) ⇒ Object



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

def (path_to_package)
  package = Capsium::Package.new(path_to_package)
  puts JSON.pretty_generate(package..as_json)
end

#pack(path_to_package) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/capsium/cli.rb', line 58

def pack(path_to_package)
  package = Capsium::Package.new(path_to_package)
  packager = Capsium::Packager.new
  packager.pack(package, options)
rescue StandardError => e
  puts e
  puts e.inspect
  puts e.backtrace
end

#routes(path_to_package) ⇒ Object



43
44
45
46
# File 'lib/capsium/cli.rb', line 43

def routes(path_to_package)
  package = Capsium::Package.new(path_to_package)
  puts JSON.pretty_generate(package.routes.as_json)
end

#storage(path_to_package) ⇒ Object



36
37
38
39
# File 'lib/capsium/cli.rb', line 36

def storage(path_to_package)
  package = Capsium::Package.new(path_to_package)
  puts JSON.pretty_generate(package.storage.as_json)
end