Skip to content

tobias/rails_habitat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rails_habitat plugin

A stupid simple plugin based on the idea behind Coda Hale’s rails_environments plugin

This plugin adds the following functionality to the Rails module to
help with determining the current enviroment, and is feature
compatible with rails_environments:

  >> Rails.environment       # a convenience alias to Rails.env
  => "development"
  >> Rails.development?
  => true
  >> Rails.not_development?
  => false
  >> Rails.production?
  => false
  >> Rails.not_production?
  => true
  >> Rails.test?
  => false
  >> Rails.not_test?
  => true

Not only does it provide env? and not_env? methods for the standard
environments, it also provides those methods for any environment you
define in config/environments/ (in fact that is how it learns about all
of the environments, including the standard three). So if you define
new environments in config/environments/ they will be picked up
automatically.

The value of this plugin is diminished by rails 2.2, which allows you
to do Rails.env.development?.

Install with: script/plugin install git://github.com/tobias/rails_habitat.git

Copyright © 2009 Tobias Crawley, released under the MIT license

About

A simple rails plugin that adds Rails.<env>? and Rails.not_<env>? for config/environments/*.rb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages