Class: RhoPackages::YmlConfig
- Inherits:
-
Object
- Object
- RhoPackages::YmlConfig
- Defined in:
- rho_packages.rb
Instance Method Summary (collapse)
-
- (YmlConfig) initialize(config_yml_file)
constructor
A new instance of YmlConfig.
- - (Object) package_deps(package_name)
- - (Object) package_file(package_name)
- - (Object) package_load_path(package_name)
- - (Object) repository
Constructor Details
- (YmlConfig) initialize(config_yml_file)
Returns a new instance of YmlConfig
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'rho_packages.rb', line 13 def initialize(config_yml_file) @config = YAML::load_file(config_yml_file) @platfrom_suffix = case RUBY_PLATFORM when /(win|w)32$/ 'win' when /darwin/ 'mac' else fail end end |
Instance Method Details
- (Object) package_deps(package_name)
30 31 32 |
# File 'rho_packages.rb', line 30 def package_deps(package_name) gather([], Set.new, [package_name]).reverse end |
- (Object) package_file(package_name)
34 35 36 37 38 |
# File 'rho_packages.rb', line 34 def package_file(package_name) file = package_name file += ".#{@platfrom_suffix}" if platform_specific?(package_name) file end |
- (Object) package_load_path(package_name)
40 41 42 |
# File 'rho_packages.rb', line 40 def package_load_path(package_name) package(package_name).fetch('ruby_load_path', nil) end |
- (Object) repository
26 27 28 |
# File 'rho_packages.rb', line 26 def repository @config['repository'] end |