module Amber
A navigation menu class
adapted from github.com/tenderlove/rails_autolink MIT license
bracket links are links in the form [[label => target]] or [[page-name]]
bracket links are links in the form [[label => target]] or [[page-name]]
Haml::Options.defaults = :html5
class StaticPage
represents a static website page. see also static_page/*.rb
A simple class to hold a set of properties for a page.
There is a separate property set for each locale. The PageProperties object holds many PropertySets, one for each locale.
When the template for a page is evaluated, all the member variabled defined in that template are loaded as member variables of the PropertySet instance. (e.g. properties are eval'ed in context of PropertySet instance)
the “@this” variable is to set variables that should not be inherited
Constants
- DEFAULT_HOST
- DEFAULT_PORT
- PAGE_SUFFIXES
Possible page suffixes. Only files with these suffixes are treated as pages
- POSSIBLE_LANGUAGES
Languages that might possibly be supported.
en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers
- POSSIBLE_LANGUAGE_CODES
Although everywhere else we use symbols for locales, this array should be strings:
- VAR_SUFFIXES
Possible variable file suffixes. Only files with these suffixesare treated as variable files.
- VERSION
Public Class Methods
# File lib/amber.rb, line 31 def self.env if defined?(TESTING) && TESTING==true :test elsif defined?(Amber::Server) :developmet else :production end end
# File lib/amber/logger.rb, line 16 def self.log_exception(e) Amber.logger.error(e) Amber.logger.error(e.backtrace.join("\n ")) end
# File lib/amber/logger.rb, line 5 def self.logger @logger ||= begin logger = Logger.new(STDOUT) logger.level = Logger::INFO logger.formatter = proc do |severity, datetime, progname, msg| "#{severity}: #{msg}\n" end logger end end