Class: Fig::NonRepositoryPackages

Inherits:
Object
  • Object
show all
Defined in:
lib/fig/non_repository_packages.rb

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ NonRepositoryPackages

Returns a new instance of NonRepositoryPackages.



11
12
13
14
15
16
17
# File 'lib/fig/non_repository_packages.rb', line 11

def initialize(parser)
  @parser           = parser

  reset_cached_data

  return
end

Instance Method Details

#[](file_path) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fig/non_repository_packages.rb', line 25

def [](file_path)
  file_path = File.expand_path file_path
  if package = @packages_by_path[file_path]
    return package
  end

  if ! File.exist? file_path
    return
  end

  load_package file_path

  return @packages_by_path[file_path]
end

#reset_cached_dataObject



19
20
21
22
23
# File 'lib/fig/non_repository_packages.rb', line 19

def reset_cached_data
  @packages_by_path = {}

  return
end