Class: Gel::StoreCatalog
- Inherits:
-
Object
- Object
- Gel::StoreCatalog
- Defined in:
- lib/gel/store_catalog.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #_info(name) ⇒ Object
- #gem_info(name) ⇒ Object
-
#initialize(store) ⇒ StoreCatalog
constructor
A new instance of StoreCatalog.
- #prepare ⇒ Object
Constructor Details
#initialize(store) ⇒ StoreCatalog
Returns a new instance of StoreCatalog.
6 7 8 9 |
# File 'lib/gel/store_catalog.rb', line 6 def initialize(store) @store = store @cache = {} end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
4 5 6 |
# File 'lib/gel/store_catalog.rb', line 4 def store @store end |
Instance Method Details
#_info(name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gel/store_catalog.rb', line 15 def _info(name) info = {} @store.each(name) do |store_gem| info[store_gem.version] = { dependencies: store_gem.dependencies.map do |name, pairs| [name, pairs.map { |op, ver| "#{op} #{ver}" }] end, } end info end |
#gem_info(name) ⇒ Object
11 12 13 |
# File 'lib/gel/store_catalog.rb', line 11 def gem_info(name) @cache.fetch(name) { @cache[name] = _info(name) } end |
#prepare ⇒ Object
29 30 |
# File 'lib/gel/store_catalog.rb', line 29 def prepare end |