Module: Hyper

Extended by:
Hyper
Included in:
Hyper
Defined in:
lib/hyper.rb,
lib/hyper/utils.rb,
lib/hyper/static.rb,
lib/hyper/version.rb,
lib/hyper/generator.rb,
lib/hyper/application.rb

Defined Under Namespace

Modules: Utils, Version Classes: Application, Generator, Static

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/hyper.rb', line 12

def call(env)
  builder = Rack::Builder.new do
    use Hyper::Static
    run Hyper::Application.new
  end
  
  builder.to_app.call(env)
end

#rootObject



21
22
23
# File 'lib/hyper.rb', line 21

def root
  @root ||= Pathname.new(Dir.pwd)
end

#root=(path) ⇒ Object



25
26
27
# File 'lib/hyper.rb', line 25

def root=(path)
  @root = Pathname.new(path)
end

#template_rootObject



29
30
31
# File 'lib/hyper.rb', line 29

def template_root
  @template_root ||= root.join('templates')
end

#template_root=(path) ⇒ Object



33
34
35
# File 'lib/hyper.rb', line 33

def template_root=(path)
  @template_root = Pathname.new(path)
end

#view_rootObject



37
38
39
# File 'lib/hyper.rb', line 37

def view_root
  @view_root ||= template_root.join('views')
end