class DPN::Bagit::Settings

A class that manages the various settings required by dpn-bagit.

Public Class Methods

new() click to toggle source
# File lib/dpn/bagit/settings.rb, line 10
def initialize
  @config = nil
  config
end

Public Instance Methods

[](key) click to toggle source
# File lib/dpn/bagit/settings.rb, line 26
def [](key)
  config[key]
end
[]=(key,value) click to toggle source
# File lib/dpn/bagit/settings.rb, line 30
def []=(key,value)
  config[key] = value
end
config() click to toggle source
# File lib/dpn/bagit/settings.rb, line 16
def config
  if @config == nil
    @config = Configliere::Param.new
    @config[:root] = get_project_root
    @config.read File.join @config[:root], "/lib/dpn/bagit/defaults.config.yml"
    @config.resolve!
  end
  @config
end

Protected Instance Methods

get_project_root() click to toggle source

Get the path to the project root.

# File lib/dpn/bagit/settings.rb, line 36
def get_project_root
  return Bundler.rubygems.find_name('dpn-bagit').first.full_gem_path
end