Class: Ecogem::Env
- Inherits:
-
Object
- Object
- Ecogem::Env
- Defined in:
- lib/ecogem/env.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
- #config ⇒ Object
- #git_source_uri_to_alias(uri) ⇒ Object
- #git_sources ⇒ Object
-
#initialize(base, dir) ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize(base, dir) ⇒ Env
Returns a new instance of Env.
12 13 14 15 |
# File 'lib/ecogem/env.rb', line 12 def initialize(base, dir) @base = base @dir = ::File.(dir) end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
10 11 12 |
# File 'lib/ecogem/env.rb', line 10 def dir @dir end |
Instance Method Details
#config ⇒ Object
21 22 23 |
# File 'lib/ecogem/env.rb', line 21 def config @config ||= ::Ecogem::Config.new(@base && @base.config, config_path) end |
#git_source_uri_to_alias(uri) ⇒ Object
29 30 31 32 |
# File 'lib/ecogem/env.rb', line 29 def git_source_uri_to_alias(uri) source = git_sources[uri] (source && source.uri_alias) || uri end |
#git_sources ⇒ Object
25 26 27 |
# File 'lib/ecogem/env.rb', line 25 def git_sources @git_sources ||= ::Hash[config.values.git_sources.map{|i| [i.uri, i]}] end |