GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Adds basic social networking capabilities to your existing application, including users, blogs, photos, clippings, favorites, and more.
Homepage: http://www.communityengine.org
Clone URL: git://github.com/bborn/communityengine.git
bborn (author)
Thu Sep 04 07:52:26 -0700 2008
commit  6eb615836568e9bf94e1ca15618730e30a252038
tree    49d4e4985249c08c89d708418ed12f7cc639e716
parent  661e7702b4c61e315cea5ce2f700e2332ee1ba29
communityengine / init.rb
100644 34 lines (29 sloc) 0.956 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
require 'community_engine'
require 's3_cache_control'
 
Module.class_eval do
  def expiring_attr_reader(method_name, value)
    class_eval(<<-EOS, __FILE__, __LINE__)
def #{method_name}
class << self; attr_reader :#{method_name}; end
@#{method_name} = eval(%(#{value}))
end
EOS
  end
end
 
class ActionView::Base
  def _(s)
    # just call the globalite localize method on the string
    s.localize
  end
end
 
module ApplicationConfiguration
  require 'ostruct'
  require 'yaml'
  if File.exists?( File.join(RAILS_ROOT, 'config', 'application.yml') )
    file = File.join(RAILS_ROOT, 'config', 'application.yml')
    users_app_config = YAML.load_file file
  end
  default_app_config = YAML.load_file(File.join(RAILS_ROOT, 'vendor', 'plugins', 'community_engine', 'engine_config', 'application.yml'))
  
  config_hash = (users_app_config||{}).reverse_merge!(default_app_config)
 
  ::AppConfig = OpenStruct.new config_hash
end