rbazinet / simplelog

Simple blogging engine written in Ruby on Rails

This URL has Read+Write access

simplelog / config / environment.rb
100644 64 lines (55 sloc) 2.575 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# $Id: environment.rb 328 2007-02-08 22:50:30Z garrett $
 
#--
# Copyright (C) 2006-2007 Garrett Murray
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program (doc/LICENSE); if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
#++
 
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
 
# Some storage for application-wide stuff and constants
SL_CONFIG = Hash.new
@@stored_prefs = Hash.new
@@stored_blacklist = Array.new
 
Rails::Initializer.run do |config|
  # Use the database for sessions instead of the file system
  config.action_controller.session_store = :active_record_store
  # Make Active Record use UTC-base instead of local time
  config.active_record.default_timezone = :utc
  # Use Active Record's schema dumper instead of SQL when creating the test database
  config.active_record.schema_format = :ruby
end
 
##################################################################
# Don't change anything below this line! Seriously! #
##################################################################
 
  # Logging settings (warnings only, otherwise logs get REALLY big)
  RAILS_DEFAULT_LOGGER.level = Logger::WARN
 
  # SimpleLog version
  SL_CONFIG[:VERSION] = '2.0.2'
  # Where to check for updates
  SL_CONFIG[:UPDATES_URL] = 'simplelog.net/updates/version.xml'
  # Where to get the blacklist
  SL_CONFIG[:BLACKLIST_URL] = 'simplelog.net/blacklist/current/'
  # Used in cookies
  SL_CONFIG[:USER_EMAIL_COOKIE] = '_sl_email'
  SL_CONFIG[:USER_HASH_COOKIE] = '_sl_hash'
  
  # we load our site's config now
  require 'server.rb'
 
  # Some required stuff (there are additional requires in the environment sub files)
  require 'taggable' # acts as taggable is required
  require 'htmlentities' # useful string extension
  require 'cgi' # we use this in places
  require 'digest/sha1' # for password hashing
  require 'digest/md5' # for creating MD5 hashes (gravatar)