Class: Fig::NonRepositoryPackages
- Inherits:
-
Object
- Object
- Fig::NonRepositoryPackages
- Defined in:
- lib/fig/non_repository_packages.rb
Instance Method Summary collapse
- #[](file_path) ⇒ Object
-
#initialize(parser) ⇒ NonRepositoryPackages
constructor
A new instance of NonRepositoryPackages.
- #reset_cached_data ⇒ Object
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. 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_data ⇒ Object
19 20 21 22 23 |
# File 'lib/fig/non_repository_packages.rb', line 19 def reset_cached_data @packages_by_path = {} return end |