Class: Lbrt::CLI::Space

Inherits:
Thor
  • Object
show all
Includes:
Utils::CLIHelper
Defined in:
lib/lbrt/cli/space.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



20
21
22
23
24
25
26
# File 'lib/lbrt/cli/space.rb', line 20

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

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

#export(file = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/lbrt/cli/space.rb', line 29

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

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

#listObject



8
9
10
# File 'lib/lbrt/cli/space.rb', line 8

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

#pecoObject



13
14
15
# File 'lib/lbrt/cli/space.rb', line 13

def peco
  client(Lbrt::Space).peco
end