Sha256: 37065bcfa8258f612d722889e6adfb7e7dd32b6dee3da137598149b52e52c242

Contents?: true

Size: 913 Bytes

Versions: 4

Compression:

Stored size: 913 Bytes

Contents

require 'time'
require 'pathname'

require 'couchrest'
require 'active_support/inflector'

$:.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

4 entries across 4 versions & 1 rubygems

Version Path
mattly-exegesis-0.0.6 lib/exegesis.rb
mattly-exegesis-0.0.7 lib/exegesis.rb
mattly-exegesis-0.0.8 lib/exegesis.rb
mattly-exegesis-0.0.9 lib/exegesis.rb