Class: Juno::Installation

Inherits:
Object
  • Object
show all
Defined in:
lib/juno/installation.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_pathname, opts = {}) ⇒ Installation

Returns a new instance of Installation.



7
8
9
10
# File 'lib/juno/installation.rb', line 7

def initialize(root_pathname, opts={})
  @root = Pathname.new(root_pathname)
  @opts = opts
end

Instance Method Details

#usersObject



12
13
14
15
16
17
18
19
# File 'lib/juno/installation.rb', line 12

def users
  return @users if defined? @users
  @users = Pathname.glob(@root + 'USER*').select do |p|
    p.directory? && p.basename.to_s.match(/^USER\d{4}$/)
  end.map do |user_path|
    User.new(user_path)
  end
end