public
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/halorgium/mephisto.git
Search Repo:
francois (author)
Mon Mar 10 20:36:57 -0700 2008
commit  a1407eb22655e040d394c2b34b203d190891eda7
tree    2e680301c13e14008146bd016dbc268622e68d7e
parent  3bbe3ca69a5aa2e4346e62a988edab0b3d9451b8
mephisto / config / initializers / mephisto_init.rb
100644 40 lines (32 sloc) 1.328 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# this is for standard library loading and configuration. All the hardcore monkey patching is in the mephisto plugin.
require 'tzinfo'
require 'zip/zipfilesystem'
require 'action_controller/dispatcher'
require 'coderay'
require 'ruby_pants'
require 'xmlrpc_patch'
 
ActiveRecord::Base.observers = [:article_observer, :comment_observer]
 
# temporarily moved to vendor/plugins/aaa/init.rb to make sure
# it's loaded before all other plugins
# Object::RAILS_PATH = Pathname.new(File.expand_path(RAILS_ROOT))
 
class ActionController::Dispatcher
  def self.register_liquid_tags
    Mephisto.liquid_filters.each { |mod| Liquid::Template.register_filter mod }
    Mephisto.liquid_tags.each { |name, klass| Liquid::Template.register_tag name, klass }
  end
  
  def cleanup_application_with_plugins(force = false)
    returning cleanup_application_without_plugins(force) do
      self.class.register_liquid_tags
    end
  end
  
  alias_method_chain :cleanup_application, :plugins
end
 
ActionController::Dispatcher.register_liquid_tags
 
Inflector.inflections do |inflect|
  #inflect.plural /^(ox)$/i, '\1en'
  #inflect.singular /^(ox)en/i, '\1'
  #inflect.irregular 'person', 'people'
  inflect.uncountable %w( audio )
end
 
Dependencies.autoloaded_constants.delete "Mephisto"
Dependencies.autoloaded_constants.delete "Mephisto::Plugin"