<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Rsl's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 07 Aug 2008 20:59:44 GMT</pubDate>
    <description>DZone Snippets: Rsl's Code Snippets</description>
    <item>
      <title>Test RAILS_ENV</title>
      <link>http://snippets.dzone.com/posts/show/3983</link>
      <description>I got tired of typing ENV["RAILS_ENV"] == "test" over and over in my app so I came up with a method for a mixin.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;module Mesclun&lt;br /&gt;  def env?(val)&lt;br /&gt;    ENV["RAILS_ENV"] == case val&lt;br /&gt;      when :dev, :devel, :development: "development"&lt;br /&gt;      when :pro, :prod, :production: "production"&lt;br /&gt;      when :test; "test"&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Pretty simple but a real finger-saver, for me at least. :)</description>
      <pubDate>Thu, 10 May 2007 15:10:21 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3983</guid>
      <author>RSL (RSL)</author>
    </item>
  </channel>
</rss>
