Sha256: 2fac01295ab353e124f96e0f4f174b1cf4ffa7f7de9ce9a923468a734076c961

Contents?: true

Size: 628 Bytes

Versions: 40

Compression:

Stored size: 628 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] ||= ['/home/whimsysvn/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

40 entries across 40 versions & 1 rubygems

Version Path
whimsy-asf-0.0.69 lib/whimsy/asf/config.rb
whimsy-asf-0.0.68 lib/whimsy/asf/config.rb
whimsy-asf-0.0.67 lib/whimsy/asf/config.rb
whimsy-asf-0.0.66 lib/whimsy/asf/config.rb
whimsy-asf-0.0.65 lib/whimsy/asf/config.rb
whimsy-asf-0.0.64 lib/whimsy/asf/config.rb
whimsy-asf-0.0.63 lib/whimsy/asf/config.rb
whimsy-asf-0.0.62 lib/whimsy/asf/config.rb
whimsy-asf-0.0.61 lib/whimsy/asf/config.rb
whimsy-asf-0.0.60 lib/whimsy/asf/config.rb
whimsy-asf-0.0.59 lib/whimsy/asf/config.rb
whimsy-asf-0.0.58 lib/whimsy/asf/config.rb
whimsy-asf-0.0.57 lib/whimsy/asf/config.rb
whimsy-asf-0.0.56 lib/whimsy/asf/config.rb
whimsy-asf-0.0.55 lib/whimsy/asf/config.rb
whimsy-asf-0.0.54 lib/whimsy/asf/config.rb
whimsy-asf-0.0.53 lib/whimsy/asf/config.rb
whimsy-asf-0.0.52 lib/whimsy/asf/config.rb
whimsy-asf-0.0.51 lib/whimsy/asf/config.rb
whimsy-asf-0.0.50 lib/whimsy/asf/config.rb