1. Welcome
  2. Getting Started [+/-]
    1. Installing from RubyGems
    2. Installing from GitHub.com
    3. Installing with Sake
  3. The Basics [+/-]
    1. Hello World
      1. Application Generation Options
    2. Paths
    3. Environments
    4. Rake
  4. Configuration [+/-]
    1. Configatron
    2. Initializers
      1. Gems
      2. Mime-Types
  5. Routing [+/-]
    1. Default Routes
    2. Named Routes
    3. RESTful/Resource Routes
    4. Nested Resource Routes
    5. Regex Routes
    6. Wildcard Routes
    7. Blocks in Routes
    8. Redirecting
    9. Error Handling
    10. Deferred? Routes
    11. Misc. Routing
  6. Controllers [+/-]
    1. Actions
    2. Headers/Status
    3. Handling Content Types
    4. Filters
    5. Helpers
    6. Layouts
    7. Tell Messaging
    8. Redirecting
    9. Rendering
      1. Engines
        1. Erubis
        2. XML Builder
        3. Extending
          1. Case Study: PDF Writer
      2. Types
        1. :action
        2. :text
        3. :inline
        4. :xml
        5. :url
        6. :partial
        7. :template
        8. :public
        9. Extending
          1. Case Study: PDF Writer
  7. Views [+/-]
    1. Helpers
    2. Layouts
    3. Assets Host
    4. Assets Management
    5. Form Builders
  8. Sessions [+/-]
    1. Session Store API
  9. Request/Response [+/-]
    1. Cookies
  10. Testing [+/-]
    1. RSpec
    2. Test::Unit::TestCase
  11. Porlets [+/-]
    1. Developing
    2. Testing
    3. Packaging
    4. Using
  12. Plugins [+/-]
    1. Extending
      1. Case Study: PDF Writer
  13. Deploying [+/-]
    1. Thin
    2. Passenger (mod_rails)
    3. Joyent Accelerator
  14. Mack More [+/-]
    1. mack-active_record
    2. mack-asset_packager
    3. mack-caching
    4. mack-data_factory
    5. mack-data_mapper
    6. mack-distributed
    7. mack-encryption
    8. mack-facets
    9. mack-haml
    10. mack-javascript
    11. mack-localization
    12. mack-markaby
    13. mack-notifier
    14. mack-orm
    15. mack-pdf_writer
  15. Rails to Mack Cheat Sheet
  16. Contributing
  17. APIs [+/-]

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:

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
This guide was written for Mack version 0.8.2