Created
September 1, 2008 16:15
-
-
Save teamon/8314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gem.clear_paths | |
Gem.path.unshift(Merb.root / "gems") | |
# Merb.push_path(:lib, Merb.root / "lib") | |
dependency 'dm-aggregates' | |
deps = %w[-slices -auth -assets _helpers -haml | |
-action-args _paginate] | |
dependencies deps.map {|d| "merb#{d}"} | |
require 'merb_has_flash' | |
# require "merb_stories" if Merb.environment == "test" | |
Merb::BootLoader.before_app_loads do | |
%w[dm-validations dm-timestamps dm-types dm-is-nested_set].each {|e| require e } | |
require "lib/core_ext" | |
Merb::Slices::config[:merb_auth][:layout] = :application | |
MA[:forgotten_password] = true | |
end | |
Merb::BootLoader.after_app_loads do | |
MA[:use_activation] = true | |
MA[:login_field] = :login | |
Merb::Mailer.config = { | |
:host => 'smtp.creolab.pl', | |
:port => '25', | |
:user => 'ps', | |
:pass => '**', | |
:auth => :plain | |
} | |
Merb::Mailer.delivery_method = :test_send | |
out = STDOUT && File.open('/dev/null', 'w') | |
DataObjects::Postgres.logger = DataObjects::Logger.new(out, Merb.logger.level) | |
end | |
use_orm :datamapper | |
use_test :rspec | |
# | |
# ==== Set up your basic configuration | |
# | |
# IMPORTANT: | |
# | |
# early on Merb boot init file is not yet loaded. | |
# Thus setting PORT, PID FILE and ADAPTER using init file does not | |
# make sense and only can lead to confusion because default settings | |
# will be used instead. | |
# | |
# Please use command line options for them. | |
# See http://wiki.merbivore.com/pages/merb-core-boot-process | |
# if you want to know more. | |
Merb::Config.use do |c| | |
# Sets up a custom session id key which is used for the session persistence | |
# cookie name. If not specified, defaults to '_session_id'. | |
# c[:session_id_key] = '_session_id' | |
# The session_secret_key is only required for the cookie session store. | |
c[:session_secret_key] = '2aa74b19895fac212be6fd480e394275cd7c2d14' | |
# There are various options here, by default Merb comes with 'cookie', | |
# 'memory' or 'memcached'. You can of course use your favorite ORM | |
# instead: 'datamapper', 'sequel' or 'activerecord'. | |
c[:session_store] = 'cookie' | |
end | |
# ==== Tune your inflector | |
# To fine tune your inflector use the word, singular_word and plural_word | |
# methods of Language::English::Inflector module metaclass. | |
# | |
# Here we define erratum/errata exception case: | |
# | |
# Language::English::Inflector.word "erratum", "errata" | |
# | |
# In case singular and plural forms are the same omit | |
# second argument on call: | |
# | |
# Language::English::Inflector.word 'information' | |
# | |
# You can also define general, singularization and pluralization | |
# rules: | |
# | |
# Once the following rule is defined: | |
# Language::English::Inflector.rule 'y', 'ies' | |
# | |
# You can see the following results: | |
# irb> "fly".plural | |
# => flies | |
# irb> "cry".plural | |
# => cries | |
# | |
# Example for singularization rule: | |
# | |
# Language::English::Inflector.singular_rule 'o', 'oes' | |
# | |
# Works like this: | |
# irb> "heroes".singular | |
# => hero | |
# | |
# Example of pluralization rule: | |
# Language::English::Inflector.singular_rule 'fe', 'ves' | |
# | |
# And the result is: | |
# irb> "wife".plural | |
# => wives |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment