Sha256: d29f739d74722dac89135e6c643c01f6353f307aa32f77df0f309c88c8adf41f

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

require 'time'
require 'pathname'

require 'couchrest'

$:.unshift File.dirname(__FILE__) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

module Exegesis
  autoload :Document,   'exegesis/document'
  autoload :Design,     'exegesis/design'
  
  extend self
  
  def designs_directory= dir
    @designs_directory = Pathname.new(dir)
  end
  
  def designs_directory
    @designs_directory ||= Pathname.new(ENV["PWD"])
    @designs_directory
  end
  
  def design_file name
    File.read(designs_directory + name)
  end
  
  def database_template= template
    @db_template = template
  end
  
  def database_template
    @db_template ||= "http://localhost:5984/%s"
  end
  
  def database_for name
    database_template % name
  end
  
  def document_classes
    @document_classes ||= Hash.new(Exegesis::Document)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mattly-exegesis-0.0.10 lib/exegesis.rb