Module: Madness::ServerHelper

Included in:
Directory, Document, Item, Navigation, Search, TableOfContents
Defined in:
lib/madness/server_helper.rb

Overview

All the methods that we may need inside of any server route. The module can also be included manually anywhere else.

Instance Method Summary collapse

Instance Method Details

#configObject



6
7
8
# File 'lib/madness/server_helper.rb', line 6

def config 
  @config ||= Settings.instance
end

#docrootObject



10
11
12
# File 'lib/madness/server_helper.rb', line 10

def docroot
  @docroot ||= File.expand_path(config.path, Dir.pwd)
end

#log(obj) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/madness/server_helper.rb', line 14

def log(obj)
  #:nocov:
  open('madness.log', 'a') { |f|
    f.puts obj.inspect
  }
  #:nocov:
end