Babylon is a XMPP Component Framework based on EventMachine. It uses the Nokogiri GEM, which is a Ruby wrapper for Libxml2. It implements the MVC paradigm. You can create your own application by running :
$> babylon app_name
This will generate some folders and files for your application. Please see README.rdoc for further instructions
Caches the view files to improve performance.
# File lib/babylon.rb, line 64
64: def self.cache_views
65: @@views= {}
66: Dir.glob('app/views/*/*').each do |f|
67: @@views[f] = File.read(f)
68: end
69: end
Return the configuration for this component.
# File lib/babylon.rb, line 96
96: def self.config
97: @@config
98: end
Set the configuration for this component.
# File lib/babylon.rb, line 90
90: def self.config=(conf)
91: @@config = conf
92: end
Decodes XML special characters.
# File lib/babylon.rb, line 102
102: def self.decode_xml(str)
103: entities = {
104: 'lt' => '<',
105: 'gt' => '>',
106: '#38' => '&',
107: 'amp' => '&',
108: 'quot' => '"',
109: '#13' => "\r",
110: }
111: entities.keys.inject(str) { |string, key|
112: string.gsub(/&#{key};/, entities[key])
113: }
114: end
(Not documented)
# File lib/babylon.rb, line 40
40: def self.environment
41: unless self.class_variable_defined?("@@env")
42: @@env = "development"
43: end
44: @@env
45: end
(Not documented)
# File lib/babylon.rb, line 36
36: def self.environment=(_env)
37: @@env = _env
38: end
Returns a shared logger for this component.
# File lib/babylon.rb, line 80
80: def self.logger
81: unless self.class_variable_defined?("@@logger")
82: @@logger = Log4r::Logger.new("BABYLON")
83: @@logger.add(Log4r::Outputter.stdout) if Babylon.environment == "development"
84: end
85: @@logger
86: end
Retruns the router
# File lib/babylon.rb, line 55
55: def self.router
56: unless self.class_variable_defined?("@@router")
57: @@router = nil
58: end
59: @@router
60: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.