Class: OffTheGrid::Project

Inherits:
NamedResource show all
Defined in:
lib/off_the_grid/project.rb

Overview

A class to represent SGE Projects

Instance Attribute Summary

Attributes inherited from NamedResource

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NamedResource

#initialize

Methods included from GridResource

#<=>, #delete, #extract_detail, #new?, #save, #validate_before_delete, #validate_before_save

Constructor Details

This class inherits a constructor from OffTheGrid::NamedResource

Class Method Details

.listObject

Get the list of SGE projects



5
6
7
# File 'lib/off_the_grid/project.rb', line 5

def self.list
  `qconf -sprjl`.chomp.split("\n").sort.collect { |name| new(name) }
end

Instance Method Details

#aclsObject



13
14
15
16
17
# File 'lib/off_the_grid/project.rb', line 13

def acls
  extract_detail(:acl).collect do |acl|
    AccessList.new(acl)
  end
end

#detailsObject



9
10
11
# File 'lib/off_the_grid/project.rb', line 9

def details
  `qconf -sprj #{name}`.chomp
end

#usersObject

A Read-only list of users that can use this project Uses ACL association



27
28
29
# File 'lib/off_the_grid/project.rb', line 27

def users
  acls.map(&:users).flatten.uniq
end

#xaclsObject



19
20
21
22
23
# File 'lib/off_the_grid/project.rb', line 19

def xacls
  extract_detail(:xacl).collect do |acl|
    AccessList.new(acl)
  end
end