Sha256: 87b50f9a1d8d1556fa36edcb59d7228a4e2fd02dcfb2a62c7f552e2fa925f93f

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

__DIR__ = File.dirname(__FILE__)
$:.unshift "#{__DIR__}/integrity", *Dir["#{__DIR__}/../vendor/**/lib"].to_a

require 'rubygems'
require 'json'
require 'dm-core'
require 'dm-validations'
require 'dm-types'
require 'dm-timestamps'
require 'dm-aggregates'

require 'yaml'
require 'digest/sha1'

require "core_ext/object"
require "core_ext/string"
require "core_ext/time"

%w(project build builder scm scm/git notifier version).each &method(:require)

module Integrity
  def self.new
    DataMapper.setup(:default, config[:database_uri])
  end

  def self.root
    File.expand_path(File.join(File.dirname(__FILE__), ".."))
  end

  def self.default_configuration
    @defaults ||= { :database_uri => 'sqlite3::memory:',
                    :export_directory => root / 'exports',
                    :base_uri => 'http://localhost:8910',
                    :use_basic_auth => false }
  end

  def self.config
    @config ||= default_configuration
  end

  def self.config=(file)
    @config = default_configuration.merge(YAML.load_file(file))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
defunkt-integrity-0.1.1 lib/integrity.rb