Parent

GemInstaller::Config

Public Class Methods

new(yaml) click to toggle source
   # File lib/geminstaller/config.rb, line 3
3:     def initialize(yaml)
4:       @yaml = yaml
5:       @default_install_options_string = nil
6:     end

Public Instance Methods

gems() click to toggle source
    # File lib/geminstaller/config.rb, line 8
 8:     def gems
 9:       parse_defaults
10:       gem_defs = @yaml["gems"]
11:       gems = []
12:       gem_defs.each do |gem_def|
13:         name = gem_def['name']
14:         version = gem_def['version'].to_s
15:         platform = gem_def['platform'].to_s
16:         # get install_options for specific gem, if specified

17:         install_options_string = gem_def['install_options'].to_s
18:         # if no install_options were specified for specific gem, and default install_options were specified...

19:         if install_options_string.empty? &&
20:            !@default_install_options_string.nil? && 
21:            !@default_install_options_string.empty? then
22:           # then use the default install_options

23:           install_options_string = @default_install_options_string
24:         end
25:         install_options_array = []
26:         # if there was an install options string specified, default or gem-specific, parse it to an array

27:         install_options_array = install_options_string.split(" ") unless install_options_string.empty?
28: 
29:         check_for_upgrade = gem_def['check_for_upgrade']
30:         if check_for_upgrade.nil? && defined? @default_check_for_upgrade then
31:           check_for_upgrade = @default_check_for_upgrade
32:         end
33: 
34:         fix_dependencies = gem_def['fix_dependencies']
35:         if fix_dependencies.nil? && defined? @default_fix_dependencies then
36:           fix_dependencies = @default_fix_dependencies
37:         end
38: 
39:         no_autogem = gem_def['no_autogem']
40:         if no_autogem.nil? && defined? @default_no_autogem then
41:           no_autogem = @default_no_autogem
42:         end
43: 
44:         gem = GemInstaller::RubyGem.new(
45:           name, 
46:           :version => version, 
47:           :platform => platform, 
48:           :install_options => install_options_array, 
49:           :check_for_upgrade => check_for_upgrade,
50:           :no_autogem => no_autogem,
51:           :fix_dependencies => fix_dependencies)
52:         gems << gem
53:       end
54:       return gems
55:     end

Protected Instance Methods

parse_defaults() click to toggle source
    # File lib/geminstaller/config.rb, line 59
59:     def parse_defaults
60:       defaults = @yaml["defaults"]
61:       return if defaults.nil?
62:       @default_install_options_string = defaults['install_options']
63:       @default_check_for_upgrade = defaults['check_for_upgrade']
64:       @default_fix_dependencies = defaults['fix_dependencies']
65:       @default_no_autogem = defaults['no_autogem']
66:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.