module Tarpaulin::Helpers

included into TheApp::Helpers module

Constants

CSS
IMAGE

could do all these with a bit of meta-programming

JS

Public Class Methods

included(mod) click to toggle source
# File lib/tarpaulin/camping.rb, line 55
def self.included(mod)
  $DEBUG and $stderr.puts "h:mod is #{@mod}"
  @mod = mod
  $DEBUG and $stderr.puts "now it is #{@mod}"
end

Public Instance Methods

css_dir() click to toggle source
# File lib/tarpaulin/camping.rb, line 81
def css_dir
  File.join(document_root, CSS)
end
document_root() click to toggle source

should be configified

# File lib/tarpaulin/camping.rb, line 62
def document_root # or whatever ...
  '/var/www/localhost/htdocs/'
  # /Users/jollyrotten/Code/poetify/y_ruby
  # File.dirname(__FILE__)
end
hdf_render(*a) click to toggle source
# File lib/tarpaulin/camping.rb, line 137
def hdf_render *a
  block_given? ?
     render(*a, &Proc.new) :
     render(*a) { @@empty_hdf }
end
http_host() click to toggle source

should be configified

# File lib/tarpaulin/camping.rb, line 69
def http_host # or whatever ...
  @env['HTTP_HOST']
end
image_dir() click to toggle source
# File lib/tarpaulin/camping.rb, line 76
def image_dir
  File.join(document_root, IMAGE)
end
js_dir() click to toggle source
# File lib/tarpaulin/camping.rb, line 86
def js_dir
  File.join(document_root, JS)
end
prepare_root() click to toggle source
# File lib/tarpaulin/camping.rb, line 90
def prepare_root
  if @root.length > 0 and @root[0] == '/'.ord
    root = @root.reverse.chop!.reverse
  else
    root = @root
  end
  root
end