Sha256: 6cfdd087ad6ad01c45155a4b2c19fbdf01ec5963338f4132d8dce1ae38400cd2

Contents?: true

Size: 486 Bytes

Versions: 32

Compression:

Stored size: 486 Bytes

Contents

module Unipept
  class Configuration

    attr_reader :config
    attr_reader :file_name

    def initialize
      @file_name = File.join(Dir.home, ".unipeptrc")
      if !File.exists? file_name
        @config = {}
      else
        @config = YAML.load_file file_name
      end
    end

    def save
      File.open(file_name, 'w') { |f| f.write config.to_yaml }
    end

    def [](*args)
      config.[](*args)
    end

    def []=(*args)
      config.[]=(*args)
    end

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
unipept-0.7.1 lib/unipept/configuration.rb
unipept-0.7.0 lib/unipept/configuration.rb
unipept-0.6.4 lib/unipept/configuration.rb
unipept-0.6.2 lib/unipept/configuration.rb
unipept-0.6.1 lib/unipept/configuration.rb
unipept-0.5.7 lib/unipept/configuration.rb
unipept-0.5.6 lib/unipept/configuration.rb
unipept-0.5.5 lib/unipept/configuration.rb
unipept-0.5.4 lib/unipept/configuration.rb
unipept-0.5.3 lib/unipept/configuration.rb
unipept-0.5.2 lib/unipept/configuration.rb
unipept-0.5.1 lib/unipept/configuration.rb
unipept-0.5.0 lib/unipept/configuration.rb
unipept-0.4.2 lib/unipept/configuration.rb
unipept-0.4.1 lib/unipept/configuration.rb
unipept-0.4.0 lib/unipept/configuration.rb
unipept-0.3.5 lib/unipept/configuration.rb
unipept-0.3.4 lib/unipept/configuration.rb
unipept-0.3.3 lib/unipept/configuration.rb
unipept-0.3.2 lib/unipept/configuration.rb