<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SmartLogic Solutions Blog &#187; rubygem</title>
	<atom:link href="http://blog.smartlogicsolutions.com/tag/rubygem/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Tue, 30 Nov 2010 21:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rack::Rewrite 1.0.0 Released</title>
		<link>http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/#comments</comments>
		<pubDate>Thu, 13 May 2010 15:25:16 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Rack]]></category>
		<category><![CDATA[rack-rewrite]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=893</guid>
		<description><![CDATA[Rack::Rewrite 1.0.0 has just been released. To install simply run: gem install rack-rewrite. Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules. Documentation is hosted at RubyForge. The source code is hosted at GitHub. Updates include: [...]]]></description>
			<content:encoded><![CDATA[<p>Rack::Rewrite 1.0.0 has just been released.  To install simply run: <code>gem install rack-rewrite</code>.</p>
<p>Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules.</p>
<p>Documentation is hosted at <a href="http://johntrupiano.rubyforge.org/rack-rewrite/">RubyForge</a>.  The source code is hosted at <a href="http://github.com/jtrupiano/rack-rewrite">GitHub</a>.</p>
<p>Updates include:</p>
<p><span id="more-893"></span></p>
<p><strong>API</strong></p>
<ul>
<li>Fix rack 1.1.0 / rails3 compatibility by eliminating reliance on REQUEST_URI env param.  Paths are now constructed with PATH_INFO and QUERY_STRING</li>
<li>Follow rack directory/require convention: require &#8216;rack/rewrite&#8217; instead of &#8216;rack-rewrite&#8217;</li>
<li>Include an HTML anchor tag linked to where the URL being redirected to in the body of 301&#8242;s and 302&#8242;s</li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/" rel="bookmark" class="crp_title">Rack::Rewrite 0.2.1 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/" rel="bookmark" class="crp_title">Directory Conventions for Rack Middleware RubyGems</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/16/rack-rewrite-for-site-maintenance-and-downtime/" rel="bookmark" class="crp_title">Rack::Rewrite for Site Maintenance and Downtime</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/" rel="bookmark" class="crp_title">Timecop 0.3.0 Released</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rack::Rewrite 0.2.1 Released</title>
		<link>http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:51:29 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Rack]]></category>
		<category><![CDATA[rack-rewrite]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=820</guid>
		<description><![CDATA[Rack::Rewrite 0.2.1 has just been released. To install simply run: gem install rack-rewrite. Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules. Documentation is hosted at RubyForge. The source code is hosted at GitHub. Updates include: [...]]]></description>
			<content:encoded><![CDATA[<p>Rack::Rewrite 0.2.1 has just been released.  To install simply run: <code>gem install rack-rewrite</code>.</p>
<p>Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules.</p>
<p>Documentation is hosted at <a href="http://johntrupiano.rubyforge.org/rack-rewrite/">RubyForge</a>.  The source code is hosted at <a href="http://github.com/jtrupiano/rack-rewrite">GitHub</a>.</p>
<p>Updates include:</p>
<p><span id="more-820"></span></p>
<p><strong>API</strong></p>
<ul>
<li>Implement $&#038; substitution pattern (thanks to <a href="http://github.com/bhb">Ben Brinckerhoff</a>)</li>
</ul>
<p><strong>Maintenance</strong></p>
<ul>
<li>Ignore empty captures instead of failing during subsitution (thanks to <a href="http://github.com/bhb">Ben Brinckerhoff</a>)</li>
<li>Play nice with Rack::Test requests which only set PATH_INFO and not REQUEST_URI (thanks to <a href="http://github.com/docunext">@docunext</a>)</li>
<li>Use QUERY_STRING instead of QUERYSTRING as per Rack spec.  Closes Issue #1.</li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/" rel="bookmark" class="crp_title">Rack::Rewrite 1.0.0 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/" rel="bookmark" class="crp_title">Directory Conventions for Rack Middleware RubyGems</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/16/rack-rewrite-for-site-maintenance-and-downtime/" rel="bookmark" class="crp_title">Rack::Rewrite for Site Maintenance and Downtime</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/" rel="bookmark" class="crp_title">Timecop 0.3.0 Released</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timecop 0.3.4 Released</title>
		<link>http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 21:39:06 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TATFT]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[rubygem]]></category>
		<category><![CDATA[tatft]]></category>
		<category><![CDATA[timecop]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=794</guid>
		<description><![CDATA[Timecop 0.3.4 has just been released. To install simply run: gem install timecop. Timecop is a RubyGem providing &#8220;time travel&#8221; and &#8220;time freezing&#8221; capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call. Documentation is hosted at RubyForge. The source code [...]]]></description>
			<content:encoded><![CDATA[<p>Timecop 0.3.4 has just been released.  To install simply run: <code>gem install timecop</code>.</p>
<p>Timecop is a RubyGem providing &#8220;time travel&#8221; and &#8220;time freezing&#8221; capabilities, making it dead simple to test time-dependent code.  It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.</p>
<p>Documentation is hosted at <a href="http://johntrupiano.rubyforge.org/timecop/">RubyForge</a>.  The source code is hosted at <a href="http://github.com/jtrupiano/timecop">GitHub</a>.</p>
<p>Updates include:</p>
<p><span id="more-794"></span></p>
<p><strong>Maintenance</strong></p>
<ul>
<li>Fix various timezone-related issues.  Notably, when traveling to a DateTime<br />
    instance specified in a non-local timezone, convert provided DateTime<br />
    instance to a local instance and return that from DateTime.now.<br />
    Code contributed by Michaël Witrant [<a href="http://github.com/piglop">piglop</a>]
</li>
<li>Fix bug that would not allow Timecop to be used when Ruby&#8217;s &#8216;date&#8217;<br />
    library had not been previously loaded.<br />
    Code contributed by Tuomas Kareinen [<a href="http://github.com/tuomas">tuomas</a>]
</li>
<li>Fix bug when traveling to a DateTime across a DST boundary that<br />
    resulted in DateTime&#8217;s being off by an hour.
</li>
<li>Migrate argument parsing into Timecop::TimeStackItem to reduce the<br />
    responsibility of the Timecop class.
</li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/" rel="bookmark" class="crp_title">Timecop 0.3.0 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/" rel="bookmark" class="crp_title">Timecop 0.2.0 Released: Freeze and Rebase Time in Ruby</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/" rel="bookmark" class="crp_title">Timecop: Freeze Time in Ruby for Better Testing</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/" rel="bookmark" class="crp_title">Rack::Rewrite 1.0.0 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/" rel="bookmark" class="crp_title">Rack::Rewrite 0.2.1 Released</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rack::Rewrite for Site Maintenance and Downtime</title>
		<link>http://blog.smartlogicsolutions.com/2009/11/16/rack-rewrite-for-site-maintenance-and-downtime/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/11/16/rack-rewrite-for-site-maintenance-and-downtime/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:36:26 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Rack]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rack-rewrite]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=740</guid>
		<description><![CDATA[Rack::Rewrite is a Rack middleware for defining and applying rewrite rules. Though it&#8217;s not a full replacement for Apache&#8217;s mod_rewrite, a great deal of rules I&#8217;ve previously written in Apache config files can be replaced by Rack::Rewrite. Run gem install rack-rewrite to install the gem. I typically leverage rewrite rules to take my sites offline [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/jtrupiano/rack-rewrite">Rack::Rewrite</a> is a <a href="http://rack.rubyforge.org/">Rack</a> middleware for defining and applying rewrite rules.  Though it&#8217;s not a full replacement for <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">Apache&#8217;s mod_rewrite</a>, a great deal of rules I&#8217;ve previously written in Apache config files can be replaced by Rack::Rewrite.  Run <code>gem install rack-rewrite</code> to install the gem.</p>
<p>I typically leverage rewrite rules to take my sites offline for maintenance.  Most <a href="http://www.capify.org/index.php/Capistrano">capistrano</a> users will be familiar with the following Apache rewrite ruleset.<br />
<span id="more-740"></span></p>
<pre>
  RewriteCond %{REQUEST_URI} !\.(css|jpg|png)$
  RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /system/maintenance.html [L]
</pre>
<p>This ruleset matches requests for non-asset URL&#8217;s and renders a maintenance page if it exists on the filesystem.  When capistrano users run <code>cap deploy:web:disable REASON="site upgrade" UNTIL="2PM"</code> a maintenance page is placed in public/system and this ruleset begins to kick in.  Running <code>cap deploy:web:enable</code> will remove this page and the ruleset ceases to match.</p>
<p>We can replace this ruleset with the following Rack::Rewrite rule:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># Ruby 1.8.x</span>
  maintenance_file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'public'</span>, <span style="color:#996600;">'system'</span>, <span style="color:#996600;">'maintenance.html'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  send_file <span style="color:#006600; font-weight:bold;">/</span>.<span style="color:#006600; font-weight:bold;">*/</span>, maintenance_file, :<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>rack_env<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>maintenance_file<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> rack_env<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'REQUEST_URI'</span><span style="color:#006600; font-weight:bold;">&#93;</span> !~ <span style="color:#006600; font-weight:bold;">/</span>\.<span style="color:#006600; font-weight:bold;">&#40;</span>css<span style="color:#006600; font-weight:bold;">|</span>jpg<span style="color:#006600; font-weight:bold;">|</span>png<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>This rewrite rule uses the <code>send_file</code> method to return the maintenance page, uses a rule guard (the :if proc) to check for the existence of the file, and accesses the rack environment directly (rack_env arg to the Proc) to check the request URI.  Due to the shortcomings of the Ruby 1.8&#8242;s regular expression library (no negative lookahead), we have to leverage the rule guard to allow assets to continue to be served (css, jpg, png).</p>
<p>Using Ruby 1.9, this rule is simpler.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># Ruby 1.9.x</span>
  maintenance_file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'public'</span>, <span style="color:#996600;">'system'</span>, <span style="color:#996600;">'maintenance.html'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  send_file <span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">&#40;</span>?<span style="color:#006600; font-weight:bold;">&lt;</span>!css<span style="color:#006600; font-weight:bold;">|</span>png<span style="color:#006600; font-weight:bold;">|</span>jpg<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span>, maintenance_file, :<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>rack_env<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>maintenance_file<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Users of 1.8.x can leverage <a href="http://oniguruma.rubyforge.org/">Oniguruma</a> to keep the rule simpler.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># Ruby 1.8.x + Oniguruma</span>
  maintenance_file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'public'</span>, <span style="color:#996600;">'system'</span>, <span style="color:#996600;">'maintenance.html'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  send_file <span style="color:#6666ff; font-weight:bold;">Oniguruma::ORegexp</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;(.*)$(?&lt;!css|png|jpg)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, maintenance_file, :<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>rack_env<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>maintenance_file<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/" rel="bookmark" class="crp_title">Rack::Rewrite 0.2.1 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/" rel="bookmark" class="crp_title">Rack::Rewrite 1.0.0 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/" rel="bookmark" class="crp_title">Directory Conventions for Rack Middleware RubyGems</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/" rel="bookmark" class="crp_title">Better setup for environments in Rails</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/11/16/rack-rewrite-for-site-maintenance-and-downtime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Timecop 0.3.0 Released</title>
		<link>http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 03:27:34 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TATFT]]></category>
		<category><![CDATA[rubygem]]></category>
		<category><![CDATA[tatft]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[timecop]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=704</guid>
		<description><![CDATA[Timecop 0.3.0 has just been released. To install simply run: gem install timecop. Timecop is a RubyGem providing &#8220;time travel&#8221; and &#8220;time freezing&#8221; capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call. Documentation is on RubyForge. The source code is [...]]]></description>
			<content:encoded><![CDATA[<p>Timecop 0.3.0 has just been released.  To install simply run: <code>gem install timecop</code>.</p>
<p>Timecop is a RubyGem providing &#8220;time travel&#8221; and &#8220;time freezing&#8221; capabilities, making it dead simple to test time-dependent code.  It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.</p>
<p>Documentation is on <a href="http://johntrupiano.rubyforge.org/timecop/">RubyForge</a>.  The source code is hosted at <a href="http://github.com/jtrupiano/timecop">GitHub</a>.</p>
<p>Updates include:</p>
<p><strong>API</strong></p>
<ul>
<li>Completely remove Timecop#unset_all (deprecated by Timecop#return in 0.2.0)</li>
<li>Return Time.now from #freeze, #travel and #return  &#8212; code contributed by Keith Bennett (<a href="http://github.com/keithrbennett">keithrbennett</a>)</li>
</ul>
<p><strong>Maintenance</strong></p>
<ul>
<li>Fix bug that left Time#mock_time set in some instances</li>
<li>Upped build dependency to jeweler ~> 1.2.1</li>
<li>Don&#8217;t pollute top-level namespace with classes/constants</li>
</ul>
<p><strong>Documentation</strong></p>
<ul>
<li>Clearer examples in the README, better description in the gemspec</li>
<li>Improve RDoc</li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/" rel="bookmark" class="crp_title">Timecop 0.3.4 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/" rel="bookmark" class="crp_title">Timecop 0.2.0 Released: Freeze and Rebase Time in Ruby</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/" rel="bookmark" class="crp_title">Timecop: Freeze Time in Ruby for Better Testing</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/01/06/rack-rewrite-0-2-1-released/" rel="bookmark" class="crp_title">Rack::Rewrite 0.2.1 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/rack-rewrite-1-0-0-released/" rel="bookmark" class="crp_title">Rack::Rewrite 1.0.0 Released</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>environmentalist 0.2.3 released &#8212; supports rails 2.3.2</title>
		<link>http://blog.smartlogicsolutions.com/2009/04/04/environmentalist-023-released-supports-rails-232/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/04/04/environmentalist-023-released-supports-rails-232/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 19:56:44 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[environmentalist]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=574</guid>
		<description><![CDATA[Just a heads up that I&#8217;ve released environmentalist 0.2.3. You can update with: sudo gem install environmentalist The only substantial change in this release is that we moved the loading of postboot.rb to the bottom of the boot.rb file as opposed to the top of config/environment.rb. This was necessary because common db rake tasks like [...]]]></description>
			<content:encoded><![CDATA[<p>Just a heads up that I&#8217;ve released <a href="http://johntrupiano.rubyforge.org/environmentalist/">environmentalist</a> 0.2.3.  You can update with:</p>
<pre><code>
  sudo gem install environmentalist
</code></pre>
<p>The only substantial change in this release is that we moved the loading of postboot.rb to the bottom of the boot.rb file as opposed to the top of config/environment.rb.  This was necessary because common db rake tasks like db:create and db:drop stopped loading the environment in 2.3.2.</p>
<p>As a recap, environmentalist provides an executable that converts a rails app&#8217;s config structure.  The basic idea is that environments themselves are now first-class citizens, allowing you to create several environments (e.g. staging, prodtest, demo, etc.) in a clean, organized fashion.  Each environment is given its own folder where it can store its own set of configuration files (think mongrel configs, apache configs, etc.) without polluting the top-level config/ directory.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/08/04/introducing-environmentalize-an-intuitive-environment-focused-config-structure-for-your-rails-applications/" rel="bookmark" class="crp_title">Introducing environmentalist: an intuitive, environment-focused config structure for your rails applications</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/" rel="bookmark" class="crp_title">Better setup for environments in Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/04/25/reintroducing-sanitize_email-work-with-production-email-without-fear/" rel="bookmark" class="crp_title">Reintroducing sanitize_email | Work with Production Email without Fear</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/" rel="bookmark" class="crp_title">Timecop: Freeze Time in Ruby for Better Testing</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/06/deploying-rails-apps-with-capistrano-without-root-or-sudo-privileges/" rel="bookmark" class="crp_title">Deploying Rails Apps with Capistrano without root or sudo Privileges</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/04/04/environmentalist-023-released-supports-rails-232/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timecop 0.2.0 Released: Freeze and Rebase Time in Ruby</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 06:14:35 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TATFT]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[jtrupiano]]></category>
		<category><![CDATA[rubygem]]></category>
		<category><![CDATA[tatft]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[timecop]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=445</guid>
		<description><![CDATA[I just released version 0.2.0 of Timecop this evening (morning). The primary feature added was the distinction between &#8220;freezing&#8221; and &#8220;rebasing&#8221; time. In 0.1.0, Timecop.travel would actually freeze time. This is no longer the case. Rather, a time offset will be calculated, and a running clock is simulated by always offsetting the time returned by [...]]]></description>
			<content:encoded><![CDATA[<p>I just released version 0.2.0 of <a href="http://github.com/jtrupiano/timecop">Timecop</a> this evening (morning).</p>
<p>The primary feature added was the distinction between &#8220;freezing&#8221; and &#8220;rebasing&#8221; time.  In 0.1.0, <code>Timecop.travel</code> would actually freeze time.  This is no longer the case.  Rather, a time offset will be calculated, and a running clock is simulated by always offsetting the time returned by Time.now (and friends) by the original offset.</p>
<p>(Note that time can still be frozen with <code>Timecop.freeze</code>.)</p>
<p><span id="more-445"></span></p>
<p>To update a previous version:</p>
<pre><code>sudo gem update timecop</code></pre>
<p>To install for the first time: </p>
<pre><code>sudo gem install timecop</code></pre>
<p>The new feature set allows us to avoid the following common pitfalls that were present in 0.1.0. </p>
<ol>
<li>In rails, if you had set up a time mock in the development environment, then every time you invoked <code>script/generate migration</code> (and others), the generator would read your mocked instance of Time.now, and use that date for the migration name.</li>
<li>Any benchmarking/timing code executed within the yielded block would always return times of 0 seconds.  This was due to time being frozen.</li>
</ol>
<p>The other major change to the API was the deprecating of Timecop.unset_all in favor or Timecop.return.</p>
<p>This update also vastly <a href="http://johntrupiano.rubyforge.org/timecop">improves the rdoc</a>, making the public API much more accessible.  The Timecop class has particularly thorough documentation.</p>
<p>For a more complete description of the gem, please refer to the <a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/">introductory blog post</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2009/09/20/timecop-0-3-0-released/" rel="bookmark" class="crp_title">Timecop 0.3.0 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/" rel="bookmark" class="crp_title">Timecop 0.3.4 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/" rel="bookmark" class="crp_title">Timecop: Freeze Time in Ruby for Better Testing</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/05/13/directory-conventions-for-rack-middleware-rubygems/" rel="bookmark" class="crp_title">Directory Conventions for Rack Middleware RubyGems</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/" rel="bookmark" class="crp_title">PureMVCGen 0.1.1 Released &#8211; Now Works on Windows</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

