Class: PrivateGemServer::Sources

Inherits:
Hash
  • Object
show all
Defined in:
lib/private_gem_server/sources.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keysObject (readonly)

Returns the value of attribute keys.



7
8
9
# File 'lib/private_gem_server/sources.rb', line 7

def keys
  @keys
end

#temp_pathObject (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