Sha256: 4578605305a25953f23a7b731622f43f355e85589fca15860ae796927369d4b7

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 Bytes

Contents

# load configuration information from $HOME/.whimsy

require 'yaml'

module ASF

  class Config
    @home = ENV['HOME'] || Dir.pwd

    @config = YAML.load_file("#@home/.whimsy") rescue {}

    # default :svn for backwards compatibility
    @config[:svn] ||= ['/srv/svn/*', '/home/whimsysvn/svn/*', "#{@home}/svn/*"]

    # add libraries to RUBYLIB, load path
    (@config[:lib] || []).reverse.each do |lib|
      next unless File.exist? lib
      ENV['RUBYLIB']=([lib] + ENV['RUBYLIB'].to_s.split(':')).uniq.join(':')
      $LOAD_PATH.unshift lib.untaint unless $LOAD_PATH.include? lib
    end

    def self.get(value)
      @config[value]
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
whimsy-asf-0.0.74 lib/whimsy/asf/config.rb
whimsy-asf-0.0.73 lib/whimsy/asf/config.rb
whimsy-asf-0.0.72 lib/whimsy/asf/config.rb
whimsy-asf-0.0.71 lib/whimsy/asf/config.rb
whimsy-asf-0.0.70 lib/whimsy/asf/config.rb