Class: LocalPac::LocalStorage
- Inherits:
-
Object
- Object
- LocalPac::LocalStorage
- Defined in:
- lib/local_pac/local_storage.rb
Instance Method Summary collapse
- #find(name) ⇒ Object
-
#initialize(storage = GitStorage.new(LocalPac.config.local_storage)) ⇒ LocalStorage
constructor
A new instance of LocalStorage.
Constructor Details
#initialize(storage = GitStorage.new(LocalPac.config.local_storage)) ⇒ LocalStorage
Returns a new instance of LocalStorage.
10 11 12 |
# File 'lib/local_pac/local_storage.rb', line 10 def initialize(storage = GitStorage.new(LocalPac.config.local_storage)) @storage = storage end |
Instance Method Details
#find(name) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/local_pac/local_storage.rb', line 14 def find(name) name = name.sub(/.pac$/, '').gsub(%r{/}, '::').downcase.to_sym LocalPac.ui_logger.debug "Using the following name to find pac file: \":#{name}\"." file = storage[name] LocalPac.ui_logger.debug "Returning the following file: \"#{file.path || 'not found' }\"." file end |