Class: Dotpack::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/dotpack/package.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/dotpack/package.rb', line 5

def path
  @path
end

Class Method Details

.allObject



9
10
11
12
13
14
15
16
# File 'lib/dotpack/package.rb', line 9

def self.all
  return @packages unless @packages.nil?
  repos = Repo.all
  packages = repos.map{|x| Dir[x.path + "/*"]}.flatten
  packages.select!{|x| File.exist? x + "/Dotpackfile"}
  @packages = packages.map{|x| Package.new(x)}
  @packages
end