23 lines
457 B
Ruby
23 lines
457 B
Ruby
require 'lxc'
|
|
|
|
module LXC
|
|
class <<self
|
|
def containers &exe
|
|
return to_enum __method__ unless block_given?
|
|
LXC.
|
|
list_containers.
|
|
map( &LXC::Container.method( :new)).
|
|
each &exe
|
|
end
|
|
|
|
def running_containers &exe
|
|
return to_enum __method__ unless block_given?
|
|
LXC.
|
|
list_containers.
|
|
map( &LXC::Container.method( :new)).
|
|
select( &:running?).
|
|
each &exe
|
|
end
|
|
end
|
|
end
|