Class: Houcho::CLI::OuterRole

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

Constant Summary collapse

@@or =
Houcho::OuterRole.new

Instance Method Summary collapse

Instance Method Details

#attach(*args) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/houcho/cli/outerrole.rb', line 21

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

#detach(*args) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/houcho/cli/outerrole.rb', line 32

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

#details(*args) ⇒ Object



42
43
44
45
# File 'lib/houcho/cli/outerrole.rb', line 42

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

#listObject



14
15
16
# File 'lib/houcho/cli/outerrole.rb', line 14

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

#loadObject



49
50
51
52
# File 'lib/houcho/cli/outerrole.rb', line 49

def load
  Houcho::OuterRole::CloudForecast.load
  Houcho::OuterRole::Yabitz.load
end