Class: Lbrt::CLI::Service

Inherits:
Thor
  • Object
show all
Includes:
Utils::CLIHelper
Defined in:
lib/lbrt/cli/service.rb

Constant Summary

Constants included from Utils::CLIHelper

Utils::CLIHelper::REGEXP_OPTIONS

Instance Method Summary collapse

Methods included from Utils::CLIHelper

#client

Instance Method Details

#apply(file) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/lbrt/cli/service.rb', line 13

def apply(file)
  updated = client(Lbrt::Service).apply(file)

  unless updated
    Lbrt::Logger.instance.info('No change'.intense_blue)
  end
end

#export(file = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/lbrt/cli/service.rb', line 22

def export(file = nil)
  dsl = client(Lbrt::Service).export

  if file.nil? or file == '-'
    puts dsl
  else
    open(file, 'wb') {|f| f.puts dsl }
  end
end

#listObject



7
8
9
# File 'lib/lbrt/cli/service.rb', line 7

def list
  client(Lbrt::Service).list
end