Class: PrivateGemServer::Sources
- Inherits:
-
Hash
- Object
- Hash
- PrivateGemServer::Sources
- Defined in:
- lib/private_gem_server/sources.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#temp_path ⇒ Object
readonly
Returns the value of attribute temp_path.
Instance Method Summary collapse
-
#initialize(config, temp_path) ⇒ Sources
constructor
A new instance of Sources.
Constructor Details
#initialize(config, temp_path) ⇒ Sources
Returns a new instance of Sources.
10 11 12 13 14 |
# File 'lib/private_gem_server/sources.rb', line 10 def initialize(config, temp_path) @keys = config['keys'] || {} @temp_path = Pathname(temp_path).tap(&:mkpath).realpath merge! (config['gems'] || {}).map { |k, v| [k, Source.create(k, v, self)] }.to_h end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
7 8 9 |
# File 'lib/private_gem_server/sources.rb', line 7 def keys @keys end |
#temp_path ⇒ Object (readonly)
Returns the value of attribute temp_path.
8 9 10 |
# File 'lib/private_gem_server/sources.rb', line 8 def temp_path @temp_path end |