Configatron
Mack uses the configatron gem to configure itself, and your application. To do configurations there are 4 files that are generated with your Mack application:
- config/configatron/default.rb
- config/configatron/development.rb
- config/configatron/testing.rb
- config/configatron/production.rb
Any configurations you place into the default.rb file will be global across all environments. The settings also override any settings that are 'defaults' in Mack itself. When you start your application, or load the Mack environment, the corresponding file for that environment will be loaded. These settings will override any settings set in default.rb
# default.rb configatron.app_timeout = 10.minutes configatron.log_file = 'error.log' # development.rb configatron.app_timeout = 1.second
When you load your application in development mode the app_timeout will be set to 1 second, whereas in production and test mode it will be set to 10 minutes. Regardless of what environment you're in the log_file setting will be 'error.log'
# development mode: configatron.app_timeout # => 1 configatron.log_file # => 'error.log' # production or test mode: configatron.app_timeout # => 600 configatron.log_file # => 'error.log'
To see what your environment's, default is 'development' configuration settings are you can run this rake task:
$ rake mack:dump:config
which will produce something like this:
configatron.default_secret_key = "3YGAQQ88P437KRPCNLEXWBJK8NF8DPL8NPNETK5LLABMAHZ4GAPWZAA5QEHQQ7RTELRAGP4NKBJHZZP3"
configatron.mack.assets.hosts = ""
configatron.mack.assets.max_distribution = 4
configatron.mack.assets.stamp = 1224688724
configatron.mack.cache_classes = false
configatron.mack.cookie_session_store.expiry_time = 14400
configatron.mack.cookie_values = {:path=>"/"}
configatron.mack.deep_class_reload = false
configatron.mack.disable_forgery_detector = false
configatron.mack.log.colors.completed = :purple
configatron.mack.log.colors.db = :cyan
configatron.mack.log.colors.error = :red
configatron.mack.log.colors.fatal = :red
configatron.mack.log.colors.warn = :yellow
configatron.mack.log.detailed_requests = true
configatron.mack.log.disable_initialization_logging = false
configatron.mack.log.level = :debug
configatron.mack.log.root = "/Users/markbates/foo/log"
configatron.mack.log.time_format = "%Y-%m-%d %H:%M:%S"
configatron.mack.log.use_colors = true
configatron.mack.path = "/"
configatron.mack.portlet.need_tar = false
configatron.mack.portlet.need_zip = false
configatron.mack.portlet.verbose = false
configatron.mack.reload_classes = 1
configatron.mack.render_url_timeout = 5
configatron.mack.rspec_file_pattern = "test/**/*_spec.rb"
configatron.mack.session_id = "_foo_session_id"
configatron.mack.session_store = :cookie
configatron.mack.show_exceptions = true
configatron.mack.site_domain = "http://localhost:3000"
configatron.mack.static_paths = ["/css", "/images", "/files", "/images", "/stylesheets", "/javascripts", "/media", "/favicon.ico"]
configatron.mack.test_case_file_pattern = "test/**/*_test.rb"
configatron.mack.testing_framework = "rspec"
configatron.mack.use_lint = true
configatron.mack.use_sessions = true