Sha256: 410d8c283fd802b289e20d7ca614776dbf6a64771e47b8429f77110af9a2f7e6

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require "gurk/version"
require "gurk/router"
require "gurk/parser"
require "gurk/page"
require "tilt"
require "tilt/erb"

module Gurk

  Tilt.register Tilt::ERBTemplate, '.html.erb'

  def self.root
    Dir.pwd
  end

  # The default template
  @@default_view_engine = :erb

  def self.default_view_engine
    @@default_view_engine
  end

  def self.default_view_engine=(new_default_view_engine)
    @@default_view_engine = new_default_view_engine
  end

  # The default view path
  @@view_path = self.root + "/app/views"

  def self.view_path
    @@view_path 
  end

  def self.view_path=(new_view_path)
    @@view_path = new_view_path
  end

  @@feature_paths = Dir.glob("#{Dir.pwd}/features/*.feature")

  def self.feature_paths
    @@feature_paths   
  end

  def self.feature_paths=(new_feature_path)
    @@feature_paths = new_feature_path
  end

  @@router ||= Gurk::Router.new

  def self.router
    @@router
  end

  def self.run
    puts self.feature_paths
    parsed = Gurk::Parser.new(self.feature_paths).parse!

    parsed.each do |p|
      router.add Gurk::Page.new(p)
    end

    self.router
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gurk-0.0.1 lib/gurk.rb