<?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>Cory O&#039;Daniel - These are just words</title>
	<atom:link href="http://coryodaniel.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Sat, 31 Jul 2010 00:04:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My Genius Invention to revolutionize using the iPhone 4.</title>
		<link>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/</link>
		<comments>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 02:59:19 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=514</guid>
		<description><![CDATA[So, I'm an Apple Fanboi, so I don't mind finding ways to make their products MORE AWESOME. It's needless to say that the iPhone 4 is revolutionary, but I have made a draft of an invention I am working on that will make the iPhone 4 a truly genius piece of technology.
You'd better sit down. [...]]]></description>
			<content:encoded><![CDATA[<p>So, I'm an Apple Fanboi, so I don't mind finding ways to make their products MORE AWESOME. It's needless to say that the iPhone 4 is revolutionary, but I have made a draft of an invention I am working on that will make the iPhone 4 a truly genius piece of technology.</p>
<p>You'd better sit down. </p>
<p>Your iPhone 4 can do all sorts of cool things like fling angry birds at pigs, help you cook an awesome hamburger, take pictures of girls buts in line at starbucks and send them to your friends, but imagine if you could use the iPhone 4, wait for it, as a phone. </p>
<p>Imagine if you could call people on it and have a conversation without being interrupted by ear muting, ear hangups, holding it wrong and hanging up, or accidentally conference calling your ex girlfriend into a conversation with your current girlfriend with your ear.</p>
<p>Yeah, it'd be a utopian life. So I decided I was going to revolutionize this revolutionary device and low and behold here is what I came up with.</p>
<p>Now, this is just a rough draft. I'm still working on the technicalities. I'm hoping since the internet is a trustworthy place none of you will find this and beat me to the punch on creating this device.<br />
<a href="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg"><img src="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg" alt="" title="i_hate_this_phone" width="484" height="648" class="aligncenter size-full wp-image-517" /></a></p>
<p><a target="_blank" href="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg"><br />
View Full Size Here</a></p>
<p>Apple, if you would like to buy my patent please feel free to contact me. Steve, I know you are completely intrigued by the idea of being able to use the iPhone as a phone. It blew me away too.</p>
<p>Update - Initial reports are in from my prototype. It turns out if you have hair and use the headset it actually shorts out the antenna. So for now its just for bald people. I'm working on a bumper for the head band.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=My+Genius+Invention+to+revolutionize+using+the+iPhone+4.+http://bit.ly/d3IaBF" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;t=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Testing if something is &#8216;true&#8217; to all objects in an array/collection in ruby</title>
		<link>http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/</link>
		<comments>http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 23:08:25 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=512</guid>
		<description><![CDATA[Maybe there is something that does this already. I didnt know, so I whipped it together really quick. Its an extension to the array class that lets you know if something is 'true' to all objects in the array.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Array
&#160;
  def all_true?&#40;&#38;block&#41;
    t_ref = true  
&#160;
    if [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe there is something that does this already. I didnt know, so I whipped it together really quick. Its an extension to the array class that lets you know if something is 'true' to all objects in the array.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">Array</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> all_true?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
    t_ref = <span style="color:#0000FF; font-weight:bold;">true</span>  
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">if</span> block_given?
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>_val_<span style="color:#006600; font-weight:bold;">|</span>
        t_ref <span style="color:#006600; font-weight:bold;">&amp;</span>= !!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>_val_<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>_val_<span style="color:#006600; font-weight:bold;">|</span>
        t_ref <span style="color:#006600; font-weight:bold;">&amp;</span>= !!<span style="color:#006600; font-weight:bold;">&#40;</span>_val_<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    t_ref
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>You can use / test it like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">all_true</span>?  <span style="color:#008000; font-style:italic;">#=&gt; true</span>
<span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#0000FF; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">all_true</span>?  <span style="color:#008000; font-style:italic;">#=&gt; false</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Want to run some other non boolean logic on it?</span>
<span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span>, <span style="color:#006666;">4</span>, <span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">all_true</span>?<span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>val<span style="color:#006600; font-weight:bold;">|</span> val.<span style="color:#CC0066; font-weight:bold;">integer</span>? <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#008000; font-style:italic;">#=&gt; true</span>
<span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#006666;">1</span>, <span style="color:#996600;">'a'</span>, <span style="color:#006666;">3</span>, <span style="color:#006666;">4</span>, <span style="color:#006666;">6</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">all_true</span>?<span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>val<span style="color:#006600; font-weight:bold;">|</span> val.<span style="color:#CC0066; font-weight:bold;">integer</span>? <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#008000; font-style:italic;">#=&gt; false</span></pre></td></tr></table></div>

<p>Yeah, I just need to know is shits the same across the whole collection of active record objects sometimes. Now I can do it, go data.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Testing+if+something+is+%E2%80%98true%E2%80%99+to+all+objects+in+an+array%2Fcollection+in+ruby+http://bit.ly/cIFMdr" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/&amp;title=Testing+if+something+is+%E2%80%98true%E2%80%99+to+all+objects+in+an+array%2Fcollection+in+ruby" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/&amp;t=Testing+if+something+is+%E2%80%98true%E2%80%99+to+all+objects+in+an+array%2Fcollection+in+ruby" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/&amp;title=Testing+if+something+is+%E2%80%98true%E2%80%99+to+all+objects+in+an+array%2Fcollection+in+ruby" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/&amp;title=Testing+if+something+is+%E2%80%98true%E2%80%99+to+all+objects+in+an+array%2Fcollection+in+ruby" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/07/07/testing-if-something-is-true-to-all-objects-in-an-arraycollection-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing 404/500, Error Pages with Webrat visit method</title>
		<link>http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/</link>
		<comments>http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 19:02:09 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webrat]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=508</guid>
		<description><![CDATA[This is a super simple snippet, and maybe there is something built into webrat, but I didn't find it. I needed to test for 404 pages in some of my tests (I was writing tests that made sure a page didnt show for disabled content). Purposely getting 404's can be annoying though since webrat opens [...]]]></description>
			<content:encoded><![CDATA[<p>This is a super simple snippet, and maybe there is something built into webrat, but I didn't find it. I needed to test for 404 pages in some of my tests (I was writing tests that made sure a page didnt show for disabled content). Purposely getting 404's can be annoying though since webrat opens up the 404 page in your default browser. There is a variable available in Webrat's configuration that you can use to temporarily disable this functionality. I wrapped it in the following method:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> visit_but_dont_open<span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>
    Webrat.<span style="color:#9900CC;">configuration</span>.<span style="color:#9900CC;">instance_variable_set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;@open_error_files&quot;</span>, <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    visit url
    Webrat.<span style="color:#9900CC;">configuration</span>.<span style="color:#9900CC;">instance_variable_set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;@open_error_files&quot;</span>, <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Throw that in your test_helper and you can start doing:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">visit_but_dont_open <span style="color:#996600;">&quot;Http://example.com/page/that/doesnt/exist&quot;</span>
assert !response.<span style="color:#9900CC;">ok</span>?</pre></td></tr></table></div>

<p>Yay, 404.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Testing+404%2F500%2C+Error+Pages+with+Webrat+visit+method+http://bit.ly/ay7jfn" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/&amp;title=Testing+404%2F500%2C+Error+Pages+with+Webrat+visit+method" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/&amp;t=Testing+404%2F500%2C+Error+Pages+with+Webrat+visit+method" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/&amp;title=Testing+404%2F500%2C+Error+Pages+with+Webrat+visit+method" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/&amp;title=Testing+404%2F500%2C+Error+Pages+with+Webrat+visit+method" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/06/14/testing-404500-error-pages-with-webrat-visit-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lost finale &#8211; did i get it?</title>
		<link>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/</link>
		<comments>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:15:45 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[lost]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/</guid>
		<description><![CDATA[I think I understood the lost finale? What I understood was that everything that happened on the island was REAL. It all happened. The monster, the time travel, the dharma initiative. Everything. As the losties died off they went to the side world where they could meet up and "move on" together. So when we [...]]]></description>
			<content:encoded><![CDATA[<p>I think I understood the lost finale? What I understood was that everything that happened on the island was REAL. It all happened. The monster, the time travel, the dharma initiative. Everything. As the losties died off they went to the side world where they could meet up and "move on" together. So when we saw the plane leave, those people left the island, went on to have lives and eventually died. Hurley and Ben stayed on the island for however long and eventually died. </p>
<p>This is supported by the following statements I think?</p>
<p>Hurley to Ben - you were a good #2</p>
<p>Christian to Jack - everybody dies some die before you some die way after you</p>
<p>Christian to Jack - the time on the island was the most important part of your life</p>
<p>Am I on the right track?</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Lost+finale+%E2%80%93+did+i+get+it%3F+http://bit.ly/aTnYQY" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;t=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby 1.9 Date#strftime adds a space on %b</title>
		<link>http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/</link>
		<comments>http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/#comments</comments>
		<pubDate>Fri, 07 May 2010 19:15:24 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby19]]></category>
		<category><![CDATA[strftime]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=504</guid>
		<description><![CDATA[So, I had a spec failing in my integration suite and I couldn't figure out what the hell it was - EVERYTHING LOOKED LEGIT. I even logged into the site, and visually verified it. Whats the dilly?
I upgraded to ruby 1.9 from ruby 1.8 and apparently, when doing strftime on date, you get a free [...]]]></description>
			<content:encoded><![CDATA[<p>So, I had a spec failing in my integration suite and I couldn't figure out what the hell it was - EVERYTHING LOOKED LEGIT. I even logged into the site, and visually verified it. Whats the dilly?</p>
<p>I upgraded to ruby 1.9 from ruby 1.8 and apparently, when doing strftime on date, you get a free whitespace character with "%b"</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Ruby 1.8</span>
irb<span style="color:#006600; font-weight:bold;">&#40;</span>main<span style="color:#006600; font-weight:bold;">&#41;</span>:006:<span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">today</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%b %e, %Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;May 7, 2010&quot;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">irb<span style="color:#006600; font-weight:bold;">&#40;</span>main<span style="color:#006600; font-weight:bold;">&#41;</span>:007:<span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">today</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%b %e, %Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;May  7, 2010&quot;</span> <span style="color:#008000; font-style:italic;"># TWO SPACES</span></pre></td></tr></table></div>

<p>Super dumb - wasted a good 10 minutes of my day because I could see the diff between:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#996600;">&quot;May  7, 2010&quot;</span>
<span style="color:#996600;">&quot;May 7, 2010&quot;</span></pre></td></tr></table></div>

<p>In the middle of a web page full of other content.</p>
<p>Why the freebee space character on the %b? Dunno. I just smashed my stftime statement together and my specs are rolling.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">today</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%b%e, %Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Uh, yeah - this is my bug report.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Ruby+1.9+Date%23strftime+adds+a+space+on+%25b+http://bit.ly/deWu7e" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/&amp;title=Ruby+1.9+Date%23strftime+adds+a+space+on+%25b" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/&amp;t=Ruby+1.9+Date%23strftime+adds+a+space+on+%25b" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/&amp;title=Ruby+1.9+Date%23strftime+adds+a+space+on+%25b" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/&amp;title=Ruby+1.9+Date%23strftime+adds+a+space+on+%25b" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/05/07/ruby-1-9-datestrftime-adds-a-space-on-b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Padrino, Compass, and Sass &#8211; Working happily via Ian Serlin</title>
		<link>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/</link>
		<comments>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 22:22:59 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[padrino]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=500</guid>
		<description><![CDATA[My cohort, Ian Serlin, discovered this.  In a project we are working on we could get Compass to play well with PadrinoRb.  It seems like the #sass method doesn't care about the options being passed to it, and we kept getting stack traces rendered into our CSS files. The stack trace was ruby [...]]]></description>
			<content:encoded><![CDATA[<p>My cohort, Ian Serlin, discovered this.  In a project we are working on we could get Compass to play well with PadrinoRb.  It seems like the #sass method doesn't care about the options being passed to it, and we kept getting stack traces rendered into our CSS files. The stack trace was ruby looking for - and failing to find compass/reset.css.</p>
<p>This is the code that DOESN'T work (padrino 0.9.10, compass 0.8.17, sinatra 1.0).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  configure <span style="color:#9966CC; font-weight:bold;">do</span>
    register SassInitializer <span style="color:#008000; font-style:italic;">#The Rack Sass reloader...</span>
&nbsp;
    Compass.<span style="color:#9900CC;">configuration</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
      config.<span style="color:#9900CC;">project_path</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      config.<span style="color:#9900CC;">sass_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">project_type</span> = <span style="color:#ff3333; font-weight:bold;">:stand_alone</span>
      config.<span style="color:#9900CC;">http_path</span> = <span style="color:#996600;">&quot;/&quot;</span>
      config.<span style="color:#9900CC;">css_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">images_dir</span> = <span style="color:#996600;">&quot;images&quot;</span>
      config.<span style="color:#9900CC;">output_style</span> = <span style="color:#ff3333; font-weight:bold;">:compressed</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>   
  get <span style="color:#996600;">'/stylesheets/:file.css'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    content_type <span style="color:#996600;">'text/css'</span>, <span style="color:#ff3333; font-weight:bold;">:charset</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'utf-8'</span>
    <span style="color:#008000; font-style:italic;"># This is the doc on how to give Sass some more load paths to find the compass  files. </span>
    <span style="color:#008000; font-style:italic;">#   it doesnt work :P and for that matter, neither does:</span>
    <span style="color:#008000; font-style:italic;"># sass :file, Compass.sass_engine_options</span>
    <span style="color:#008000; font-style:italic;"># or the set :sass, whatever_hash_here</span>
    sass <span style="color:#ff3333; font-weight:bold;">:file</span>, <span style="color:#ff3333; font-weight:bold;">:sass</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Compass.<span style="color:#9900CC;">sass_engine_options</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Our solution was to force Sass options and Compass options to merge...</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  configure <span style="color:#9966CC; font-weight:bold;">do</span>
    register SassInitializer
&nbsp;
    Compass.<span style="color:#9900CC;">configuration</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
      config.<span style="color:#9900CC;">project_path</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      config.<span style="color:#9900CC;">sass_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">project_type</span> = <span style="color:#ff3333; font-weight:bold;">:stand_alone</span>
      config.<span style="color:#9900CC;">http_path</span> = <span style="color:#996600;">&quot;/&quot;</span>
      config.<span style="color:#9900CC;">css_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">images_dir</span> = <span style="color:#996600;">&quot;images&quot;</span>
      config.<span style="color:#9900CC;">output_style</span> = <span style="color:#ff3333; font-weight:bold;">:compressed</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#6666ff; font-weight:bold;">Sass::Plugin</span>.<span style="color:#9900CC;">options</span>.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>Compass.<span style="color:#9900CC;">sass_engine_options</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  get <span style="color:#996600;">'/stylesheets/:file.css'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    content_type <span style="color:#996600;">'text/css'</span>, <span style="color:#ff3333; font-weight:bold;">:charset</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'utf-8'</span>
    sass <span style="color:#ff3333; font-weight:bold;">:file</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Yay, magic spells - it works. You can check out more ian magic spells at ianserlin.com.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin+http://bit.ly/cdI2jj" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;t=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attaching local or remote files to Paperclip and Milton Models in Rails (Mocking content_type and original_filename in a Tempfile)</title>
		<link>http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/</link>
		<comments>http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 22:53:18 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[content_type]]></category>
		<category><![CDATA[milton]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tempfile]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=495</guid>
		<description><![CDATA[I was working on a project today where I needed to import some data from MySpace accounts (yeah, MySpace), which included importing the users profile image. In the controller that did the importing I was using OpenURI to retrieve the image and then turn it into a Tempfile to be attached the the model, like [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a project today where I needed to import some data from MySpace accounts (yeah, MySpace), which included importing the users profile image. In the controller that did the importing I was using OpenURI to retrieve the image and then turn it into a Tempfile to be attached the the model, like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> import
<span style="color:#008000; font-style:italic;">#...snip</span>
  tempfile = <span style="color:#CC00FF; font-weight:bold;">Tempfile</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> my_filename<span style="color:#006600; font-weight:bold;">&#41;</span>
  tempfile.<span style="color:#9900CC;">write</span> <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> image_url <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">read</span>
  <span style="color:#0066ff; font-weight:bold;">@imported_user</span>.<span style="color:#9900CC;">images</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:file</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> tempfile<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;">#...snip</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>This doesn't work.  It blows up missing one of two methods:</p>
<ol>
<li>#original_filename</li>
<li>#content_type</li>
</ol>
<p>If you inspect a normal file upload in Rails which has these methods, you'll find that is just a regular old Tempfile.  But it has the methods! If you create a Tempfile manually, it won't have the methods.  That's because Rails magics them on.  I am not sure why they don't create a subclass like Rails::Tempfile that contains these methods and just use that.  I guess its because OOP is retarded (sarcasm).</p>
<p>So, I wrote a little subclass that will take a file path, and quack like the magic'd rails Tempfiles you get from an upload so you can attach local files to models or even remote files.</p>
<p>This works pretty straightforward and I'm currently using it in production. It won't work on windows systems because the dependency on the 'file' binary. Also, some linux systems are missing this library by default, so make sure you yum|dpkg|apt|port or whatever to get it installed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'open-uri'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'digest/sha1'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> RemoteFile <span style="color:#006600; font-weight:bold;">&lt;</span> ::<span style="color:#CC00FF; font-weight:bold;">Tempfile</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>path, tmpdir = <span style="color:#CC00FF; font-weight:bold;">Dir</span>::tmpdir<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@original_filename</span>  = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>path<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@remote_path</span>        = path
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">super</span> <span style="color:#6666ff; font-weight:bold;">Digest::SHA1</span>.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span>path<span style="color:#006600; font-weight:bold;">&#41;</span>, tmpdir
    fetch
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> fetch
    string_io = OpenURI.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:open</span>, <span style="color:#0066ff; font-weight:bold;">@remote_path</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">write</span> string_io.<span style="color:#9900CC;">read</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">rewind</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> original_filename
    <span style="color:#0066ff; font-weight:bold;">@original_filename</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> content_type
    mime = <span style="color:#996600;">`file --mime -br #{self.path}`</span>.<span style="color:#9900CC;">strip</span>
    mime = mime.<span style="color:#CC0066; font-weight:bold;">gsub</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;">*</span>: <span style="color:#006600; font-weight:bold;">*/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    mime = mime.<span style="color:#CC0066; font-weight:bold;">gsub</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;">*</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    mime = mime.<span style="color:#CC0066; font-weight:bold;">gsub</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;">*</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    mime
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Usage is pretty simple:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">remote_file = RemoteFile.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
remote_file.<span style="color:#9900CC;">original_filename</span> <span style="color:#008000; font-style:italic;">#=&gt; logo.gif</span>
remote_file.<span style="color:#9900CC;">content_type</span> <span style="color:#008000; font-style:italic;">#= image/gif</span></pre></td></tr></table></div>

<p>Using it in your controller:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> import
  <span style="color:#008000; font-style:italic;">#...snip</span>
  <span style="color:#0066ff; font-weight:bold;">@imported_user</span>.<span style="color:#9900CC;">images</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:file</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> RemoteFile.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> url_to_image <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#008000; font-style:italic;">#...snip</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p align="left"><a class="tt" href="http://twitter.com/home/?status=Attaching+local+or+remote+files+to+Paperclip+and+Milton+Models+in+Rails+%28Mocking+content_type+and+original_filename+i...+http://bit.ly/8ZmCoU" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/&amp;title=Attaching+local+or+remote+files+to+Paperclip+and+Milton+Models+in+Rails+%28Mocking+content_type+and+original_filename+i..." title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/&amp;t=Attaching+local+or+remote+files+to+Paperclip+and+Milton+Models+in+Rails+%28Mocking+content_type+and+original_filename+i..." title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/&amp;title=Attaching+local+or+remote+files+to+Paperclip+and+Milton+Models+in+Rails+%28Mocking+content_type+and+original_filename+i..." title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/&amp;title=Attaching+local+or+remote+files+to+Paperclip+and+Milton+Models+in+Rails+%28Mocking+content_type+and+original_filename+i..." title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/03/05/attaching-local-or-remote-files-to-paperclip-and-milton-models-in-rails-mocking-content_type-and-original_filename-in-a-tempfile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A ruby wrapper for Google AjaxLibs (jquery, jquery ui, mootools, prototype, swfobject, etc) [Lazy GoogleJsApi Wrapper]</title>
		<link>http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 20:13:27 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[ajax libs]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=489</guid>
		<description><![CDATA[I like using the Google AjaxLibs API. Its cool to not host files when I don't have to, especially ones I know a user has already probably cached from Google anyway (even though Google Page speed busts my balls about too many DNS lookups  ).
I do on the other hand hate watching in the [...]]]></description>
			<content:encoded><![CDATA[<p>I like using the Google AjaxLibs API. Its cool to not host files when I don't have to, especially ones I know a user has already probably cached from Google anyway (even though Google Page speed busts my balls about too many DNS lookups <img src='http://coryodaniel.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ).</p>
<p>I do on the other hand hate watching in the bottom of my browser "Waiting for google.com" when using the standard Javascript API for loading the Libraries like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi?key=INSERT-YOUR-KEY&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 google.load(&quot;jquery&quot;, &quot;1.4.2&quot;);
&lt;/script&gt;</pre></td></tr></table></div>

<p>And you don't have to wait, you can totally do something like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;</pre></td></tr></table></div>

<p>Which is why I wrote this little ruby wrapper. Its nothing special. It just encapsulates all the URLs for the libraries and their versions to allow you to not remember the URL and not have to go looking for the documentation when you start a new app or just need an additional library.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Docs: http://code.google.com/apis/ajaxlibs/documentation/index.html</span>
<span style="color:#008000; font-style:italic;">#</span>
<span style="color:#9966CC; font-weight:bold;">class</span> GoogleJsApi
  BaseURL = <span style="color:#996600;">&quot;http://ajax.googleapis.com/ajax/libs&quot;</span>.<span style="color:#9900CC;">freeze</span>
&nbsp;
  Libraries = <span style="color:#006600; font-weight:bold;">&#123;</span> 
    <span style="color:#996600;">&quot;jquery&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.2.3 1.2.6 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/jquery/%s/jquery.min.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/jquery/%s/jquery.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;jqueryui&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.5.2 1.5.3 <span style="color:#006666;">1.6</span> 1.7.0 1.7.1 1.7.2<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/jqueryui/%s/jquery-ui.min.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/jqueryui/%s/jquery-ui.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;prototype&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.6.0.2 1.6.0.3 1.6.1.0<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/prototype/%s/prototype.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;scriptaculous&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.8.1 1.8.2 1.8.3<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/scriptaculous/%s/scriptaculous.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;mootools&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.1.1 1.1.2 1.2.1 1.2.2 1.2.3 1.2.4<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/mootools/%s/mootools-yui-compressed.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/mootools/%s/mootools.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;dojo&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.1.1 1.2.0 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/dojo/%s/dojo/dojo.xd.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/dojo/%s/dojo/dojo.xd.js.uncompressed.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;swfobject&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2.1</span> <span style="color:#006666;">2.2</span><span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/swfobject/%s/swfobject.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/swfobject/%s/swfobject_src.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;yui&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>2.6.0 2.7.0 2.8.0r4<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/yui/%s/build/yuiloader/yuiloader-min.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/yui/%s/build/yuiloader/yuiloader.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;ext-core&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>3.0.0 3.1.0<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/ext-core/%s/ext-core.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/ext-core/%s/ext-core-debug.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#996600;">&quot;chrome-frame&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:versions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>1.0.0 1.0.1 1.0.2<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:compressed_url</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/chrome-frame/%s/CFInstall.min.js&quot;</span>,
      <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/chrome-frame/%s/CFInstall.js&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span> 
  <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">freeze</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#0000FF; font-weight:bold;">self</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, version=<span style="color:#0000FF; font-weight:bold;">nil</span>, compressed=<span style="color:#0000FF; font-weight:bold;">true</span>, validate_version=<span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      name = name.<span style="color:#9900CC;">to_s</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> lib = <span style="color:#6666ff; font-weight:bold;">GoogleJsApi::Libraries</span><span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span>
        version <span style="color:#006600; font-weight:bold;">||</span>= lib<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:versions</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">last</span>
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">if</span> validate_version <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> lib<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:versions</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>version<span style="color:#006600; font-weight:bold;">&#41;</span>
          GoogleJsApi.<span style="color:#9900CC;">url_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, version, compressed<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#9966CC; font-weight:bold;">elsif</span> !validate_version
          GoogleJsApi.<span style="color:#9900CC;">url_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>name, version, compressed<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span>, <span style="color:#996600;">&quot;Invalid version (#{version}) for #{name}&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span>, <span style="color:#996600;">&quot;Unknown Google Javascript Library&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> version_info
      tmp_version = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#6666ff; font-weight:bold;">GoogleJsApi::Libraries</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>k,v<span style="color:#006600; font-weight:bold;">|</span>
        tmp_version<span style="color:#006600; font-weight:bold;">&#91;</span> k <span style="color:#006600; font-weight:bold;">&#93;</span> = v<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:versions</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      tmp_version
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    protected
    <span style="color:#9966CC; font-weight:bold;">def</span> url_for<span style="color:#006600; font-weight:bold;">&#40;</span>name, version, compressed<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#6666ff; font-weight:bold;">GoogleJsApi::BaseURL</span> <span style="color:#006600; font-weight:bold;">+</span>
      <span style="color:#6666ff; font-weight:bold;">GoogleJsApi::Libraries</span><span style="color:#006600; font-weight:bold;">&#91;</span> name <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span> compressed ? <span style="color:#ff3333; font-weight:bold;">:compressed_url</span> : <span style="color:#ff3333; font-weight:bold;">:uncompressed_url</span> <span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">%</span> version
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Here are some tests for it if you are interested in how/if it works:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'pp'</span>
&nbsp;
pp GoogleJsApi.<span style="color:#9900CC;">version_info</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Include the newest version of a library</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'jquery'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Include a specific version of a library</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#996600;">&quot;chrome-frame&quot;</span>, <span style="color:#996600;">&quot;1.0.0&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Include a specific version of a library uncompressed</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#996600;">&quot;chrome-frame&quot;</span>, <span style="color:#996600;">&quot;1.0.0&quot;</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Include a specific version of a library w/o validating the version; useful if this goes out of date :P</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#996600;">&quot;jquery&quot;</span>, <span style="color:#996600;">&quot;NOT_A_VERSION&quot;</span>, <span style="color:#0000FF; font-weight:bold;">false</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">begin</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#ff3333; font-weight:bold;">:jqueryui</span>, <span style="color:#996600;">&quot;1.0&quot;</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> e
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;This should blow up...&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> e.<span style="color:#9900CC;">message</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>If you want to use it in your Rails or Merb app you can do:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Rails</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'google_js_api'</span> <span style="color:#008000; font-style:italic;">#or whatever you named the file when you dropped it in lib</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># In your application layout or whatever</span>
javascript_include_tag GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:jquery</span>, <span style="color:#996600;">&quot;1.4.0&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Merb</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'google_js_api'</span> <span style="color:#008000; font-style:italic;">#or whatever you named the file when you dropped it in lib</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#in your application layout or where ever</span>
require_js GoogleJsApi.<span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:swfobject</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Its simple, its lazy. I like it.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=A+ruby+wrapper+for+Google+AjaxLibs+%28jquery%2C+jquery+ui%2C+mootools%2C+prototype%2C+swfobject%2C+etc%29+%5BLazy+GoogleJsApi+Wrapper%5D+http://bit.ly/cX2ihG" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/&amp;title=A+ruby+wrapper+for+Google+AjaxLibs+%28jquery%2C+jquery+ui%2C+mootools%2C+prototype%2C+swfobject%2C+etc%29+%5BLazy+GoogleJsApi+Wrapper%5D" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/&amp;t=A+ruby+wrapper+for+Google+AjaxLibs+%28jquery%2C+jquery+ui%2C+mootools%2C+prototype%2C+swfobject%2C+etc%29+%5BLazy+GoogleJsApi+Wrapper%5D" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/&amp;title=A+ruby+wrapper+for+Google+AjaxLibs+%28jquery%2C+jquery+ui%2C+mootools%2C+prototype%2C+swfobject%2C+etc%29+%5BLazy+GoogleJsApi+Wrapper%5D" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/&amp;title=A+ruby+wrapper+for+Google+AjaxLibs+%28jquery%2C+jquery+ui%2C+mootools%2C+prototype%2C+swfobject%2C+etc%29+%5BLazy+GoogleJsApi+Wrapper%5D" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/25/a-ruby-wrapper-for-google-ajaxlibs-jquery-jquery-ui-mootools-prototype-swfobject-etc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why the hell can&#8217;t Apple fix this bug? &#8211; Snow Leopard Keyboard hangs when changing spaces</title>
		<link>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 00:49:36 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[die die die]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[kill dock]]></category>
		<category><![CDATA[spaces]]></category>
		<category><![CDATA[suckfest]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=482</guid>
		<description><![CDATA[Everyone knows about this bug, except apparently Apple. 
In Snow Leopard the keyboard hangs occasionally when changing spaces. Sometimes for only a few seconds, sometimes forever. All sorts of people are talking or reporting about this issue. 
Why isn't it being fixed? Hallo there, Apple? Are you there?
There are currently about 100 posts in the [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone knows about this bug, except apparently Apple. </p>
<p>In Snow Leopard the keyboard hangs occasionally when changing spaces. Sometimes for only a few seconds, sometimes forever. All sorts of people are talking or <a href="http://reviews.cnet.com/8301-13727_7-10369937-263.html">reporting</a> <a href="http://reviews.cnet.com/8301-13727_7-10361439-263.html?tag=mncol;txt">about</a> this <a href="http://discussions.apple.com/thread.jspa?threadID=2161076&#038;start=90&#038;tstart=0">issue</a>. </p>
<p>Why isn't it being fixed? Hallo there, Apple? Are you there?</p>
<p>There are currently about 100 posts in the Apple support thread dating back from Sep 15, 2009. You know whats annoying? Killing your Dock constantly while you are working.</p>
<p>Apple: SrSLy 4real. Fix this. Its equivalent to working really hard and someone smacking you in the forehead randomly. It kinda sucks, and its really irritating.</p>
<p>(Note: My keyboard only hung once during this post).</p>
<p><strong><br />
Update: March 3, 2010</strong></p>
<p>After some further research, at least for me and a few others, this bug is tied to an application called <a href="http://getsatisfaction.com/irradiatedsoftware/topics/cinch_causing_switching_spaces_by_hotkey_to_stuck_the_screen_keyboard">Cinch</a>. If you have Cinch installed, try uninstalling it and seeing if this problem goes away. A pretty useful app, but I'd rather resize my windows manually than 'get interrupted' when I'm in my workflow.</p>
<p>I uninstalled Cinch 5 days ago, and the problem has gone away for me. I was having my keyboard hang 4 or 5 times a day with it installed.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces+http://bit.ly/doaABF" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;t=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lower ACL Permissions on Amazon S3 items with ruby</title>
		<link>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 01:10:21 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=473</guid>
		<description><![CDATA[I recently had to change a bunch of permissions on some items on S3. Unfortunately the items were mixed in with items that I didn't want to change the permissions on and the file names are all kinda jumbled, so I couldn't pinpoint what I needed to change by eyeballing the file names. 
So I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to change a bunch of permissions on some items on S3. Unfortunately the items were mixed in with items that I didn't want to change the permissions on and the file names are all kinda jumbled, so I couldn't pinpoint what I needed to change by eyeballing the file names. </p>
<p>So I wrote a little ruby method to go in and change something given a key and bucket name.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'aws/s3'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Base</span>.<span style="color:#9900CC;">establish_connection</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
  <span style="color:#ff3333; font-weight:bold;">:access_key_id</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;YOUR_ACCESS_KEY&quot;</span>,
  <span style="color:#ff3333; font-weight:bold;">:secret_access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;YOUR_SECRET_KEY&quot;</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">AWS::S3</span>
<span style="color:#9966CC; font-weight:bold;">def</span> s3_set_public_read<span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Processing: #{key}&quot;</span>  
&nbsp;
  policy = S3Object.<span style="color:#9900CC;">acl</span><span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket<span style="color:#006600; font-weight:bold;">&#41;</span>
  policy.<span style="color:#9900CC;">grants</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#6666ff; font-weight:bold;">ACL::Grant</span>.<span style="color:#9900CC;">grant</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:public_read</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  policy.<span style="color:#9900CC;">grants</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#6666ff; font-weight:bold;">ACL::Grant</span>.<span style="color:#9900CC;">grant</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:public_read_acp</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  S3Object.<span style="color:#9900CC;">acl</span><span style="color:#006600; font-weight:bold;">&#40;</span>key, bucket, policy<span style="color:#006600; font-weight:bold;">&#41;</span>      
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Now I can just run a loop of ActiveRecord objects around that method and convert them all to public read.</p>
<p>If you want a GUI tool for managing S3 stuff, I totally recommend <a href="http://s3hub.com/">S3Hub</a>. Its a really sexy tool for managing S3.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby+http://bit.ly/aF9nC6" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;t=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/&amp;title=Lower+ACL+Permissions+on+Amazon+S3+items+with+ruby" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/11/lower-acl-permissions-on-amazon-s3-items-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
