Sha256: 2df4fa34c035f2e567baf4b13d6ad0b5baaacc68a1305a0ca9cf1f83cc3ad9be

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

require 'yaml'

module Hyde
  prefix = File.dirname(__FILE__)
  autoload :OStruct,     "#{prefix}/hyde/ostruct"
  autoload :Project,     "#{prefix}/hyde/project"
  autoload :Layout,      "#{prefix}/hyde/layout"
  autoload :Page,        "#{prefix}/hyde/page"
  autoload :PageFactory, "#{prefix}/hyde/page_factory"
  autoload :Renderer,    "#{prefix}/hyde/renderer"
  autoload :Renderers,   "#{prefix}/hyde/renderers"
  autoload :Utils,       "#{prefix}/hyde/utils"
  autoload :Scope,       "#{prefix}/hyde/scope"
  autoload :CLICommand,  "#{prefix}/hyde/clicommand"
  autoload :CLICommands, "#{prefix}/hyde/clicommands"
  autoload :Helpers,     "#{prefix}/hyde/helpers"
  autoload :Partial,     "#{prefix}/hyde/partial"

  Error = Class.new(::StandardError)
  NoGemError  = Class.new(Error)
  NotFound    = Class.new(Error)
  NoRootError = Class.new(Error) 

  class RenderError < Error
    attr_accessor :message
    attr_accessor :line

    def initialize(msg, *args)
      @message = msg
      a = args.inject({}) { |a, i| a.merge! i  if i.is_a? Hash; a }
      @line = a[:line]  if a[:line]
    end

    def to_s
      @line ?
        "line #{@line}: #{@message}" :
        "#{@message}"
    end
  end

  extend self

  def version
    @version ||= File.open(File.join(File.dirname(__FILE__), '..', 'VERSION')) { |f| f.read.strip }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hydeweb-0.0.4 lib/hyde.rb