Sha256: 2deb3f6368f5acb1d047006a114e0abccdd2c143c5c2967545436f6db7288d7d

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

module Space
  class Config < Hashr
    class << self
      def load(name)
        paths = %W(~/.space/#{name}.yml ./.#{name}.yml).map { |path| File.expand_path(path) }
        unless path = paths.detect { |path| File.exists?(path) }
          puts("Could not find #{name}.yml at either of ~/.space/#{name}.yml and ./.#{name}.yml")
          exit
        end
        new(YAML.load(File.read(path)))
      end
    end

    def paths
      @paths ||= repositories.map { |path| base_dir ? "#{base_dir}/#{path}" : path }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
space-0.0.3 lib/space/config.rb
space-0.0.2 lib/space/config.rb