Class: Houcho::CLI::Host

Inherits:
Thor
  • Object
show all
Defined in:
lib/houcho/cli/host.rb

Constant Summary collapse

@@h =
Houcho::Host.new

Instance Method Summary collapse

Instance Method Details

#attach(*args) ⇒ Object



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

def attach(*args)
  Houcho::CLI::Main.empty_args(self, shell, __method__) if args.empty?
  @@h.attach(args, options[:roles])
rescue RoleExistenceException, SpecFileException, SQLite3::ConstraintException => e
  puts e.message
  exit!
end

#detach(*args) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/houcho/cli/host.rb', line 30

def detach(*args)
  Houcho::CLI::Main.empty_args(self, shell, __method__) if args.empty?
  @@h.detach(args, options[:roles])
rescue RoleExistenceException, SQLite3::ConstraintException => e
  puts e.message
  exit!
end

#details(*args) ⇒ Object



40
41
42
43
# File 'lib/houcho/cli/host.rb', line 40

def details(*args)
  Houcho::CLI::Main.empty_args(self, shell, __method__) if args.empty?
  Houcho::CLI::Main.puts_details(@@h.details(args))
end

#listObject



12
13
14
# File 'lib/houcho/cli/host.rb', line 12

def list
  puts @@h.list.sort.join("\n")
end