Sha256: deac36cf503b7b94b8395f026a3249c5054222d714b0f1cea3a94fb642b2ce2d

Contents?: true

Size: 605 Bytes

Versions: 22

Compression:

Stored size: 605 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] || []).each do |lib|
      next unless File.exist? lib
      ENV['RUBYLIB']=(ENV['RUBYLIB'].to_s.split(':')+[lib]).uniq.join(':')
      $LOAD_PATH << lib unless $LOAD_PATH.include? lib
    end

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

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
whimsy-asf-0.0.23 lib/whimsy/asf/config.rb
whimsy-asf-0.0.22 lib/whimsy/asf/config.rb
whimsy-asf-0.0.21 lib/whimsy/asf/config.rb
whimsy-asf-0.0.20 lib/whimsy/asf/config.rb
whimsy-asf-0.0.19 lib/whimsy/asf/config.rb
whimsy-asf-0.0.18 lib/whimsy/asf/config.rb
whimsy-asf-0.0.17 lib/whimsy/asf/config.rb
whimsy-asf-0.0.16 lib/whimsy/asf/config.rb
whimsy-asf-0.0.15 lib/whimsy/asf/config.rb
whimsy-asf-0.0.14 lib/whimsy/asf/config.rb
whimsy-asf-0.0.13 lib/whimsy/asf/config.rb
whimsy-asf-0.0.12 lib/whimsy/asf/config.rb
whimsy-asf-0.0.11 lib/whimsy/asf/config.rb
whimsy-asf-0.0.10 lib/whimsy/asf/config.rb
whimsy-asf-0.0.9 lib/whimsy/asf/config.rb
whimsy-asf-0.0.8 lib/whimsy/asf/config.rb
whimsy-asf-0.0.7 lib/whimsy/asf/config.rb
whimsy-asf-0.0.6 lib/whimsy/asf/config.rb
whimsy-asf-0.0.5 lib/whimsy/asf/config.rb
whimsy-asf-0.0.4 lib/whimsy/asf/config.rb