Class: RhoPackages::YmlConfig
Instance Method Summary collapse
-
#initialize(config_yml_file) ⇒ YmlConfig
constructor
A new instance of YmlConfig.
- #package_deps(package_name) ⇒ Object
- #package_file(package_name) ⇒ Object
- #package_load_path(package_name) ⇒ Object
- #repository ⇒ Object
Constructor Details
#initialize(config_yml_file) ⇒ YmlConfig
Returns a new instance of YmlConfig.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/build/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
#package_deps(package_name) ⇒ Object
30 31 32 |
# File 'lib/build/rho_packages.rb', line 30 def package_deps(package_name) gather([], Set.new, [package_name]).reverse end |
#package_file(package_name) ⇒ Object
34 35 36 37 38 |
# File 'lib/build/rho_packages.rb', line 34 def package_file(package_name) file = package_name file += ".#{@platfrom_suffix}" if platform_specific?(package_name) file end |
#package_load_path(package_name) ⇒ Object
40 41 42 |
# File 'lib/build/rho_packages.rb', line 40 def package_load_path(package_name) package(package_name).fetch('ruby_load_path', nil) end |
#repository ⇒ Object
26 27 28 |
# File 'lib/build/rho_packages.rb', line 26 def repository @config['repository'] end |