<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>huesler informatik</title>
	
	<link>http://www.huesler-informatik.ch</link>
	<description>Software development and consulting</description>
	<lastBuildDate>Fri, 29 Jan 2010 17:19:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/huesler-informatik" /><feedburner:info uri="huesler-informatik" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Quicktip: Use RubyGems default options to save you some typing</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/X0W5MR3o7RE/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/29/quicktip-use-rubygems-default-options-to-save-you-some-typing/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:18:59 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Quicktips]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Rubygems]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[quicktip]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=205</guid>
		<description><![CDATA[
  I hardly ever use the local RDoc documentation of my installed Ruby gems. Typing in &#8211;no-rdoc &#8211;no-ri every time I install a gem is cumbersome. The gem takes longer to install and it uses up unnecessary disk space. That annoyance goes doubly when installing gems on a server.

Luckily, RubyGems allows to set default [...]]]></description>
			<content:encoded><![CDATA[<p>
  I hardly ever use the local <a href="http://rdoc.sourceforge.net/" title="RDoc - Document Generator for Ruby Source" target="_BLANK">RDoc</a> documentation of my installed Ruby gems. Typing in <em>&#8211;no-rdoc &#8211;no-ri</em> every time I install a gem is cumbersome. The gem takes longer to install and it uses up unnecessary disk space. That annoyance goes doubly when installing gems on a server.
</p>
<p>Luckily, <a href="http://docs.rubygems.org/" title="RubyGems Manuals" target="_BLANK">RubyGems</a> allows to set default options in a file called <em>.gemrc</em> which should be placed in your home directory. The syntax is in <a href="http://www.yaml.org/" title="The Official YAML Web Site" target="_BLANK">YAML</a> format, therefore straightforward for a Ruby programmer. Just add this line to <em>.gemrc</em> and you are golden.</p>
<pre>
    gem: --no-rdoc --no-ri
  </pre>
</p>
<p>A list of all options can be found <a href="http://docs.rubygems.org/read/chapter/11" title="gem Command Reference |  RubyGems Manuals" target="_BLANK">here.</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fquicktip-use-rubygems-default-options-to-save-you-some-typing%2F&amp;title=Quicktip%3A+Use+RubyGems+default+options+to+save+you+some+typing" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/X0W5MR3o7RE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/29/quicktip-use-rubygems-default-options-to-save-you-some-typing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/29/quicktip-use-rubygems-default-options-to-save-you-some-typing/</feedburner:origLink></item>
		<item>
		<title>HallenProjektStatus: An OSX status bar application for hallenprojekt.de</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/qCq-pxfQ-jQ/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/29/hallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:49:44 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=203</guid>
		<description><![CDATA[I have been writing Ruby applications exclusively for awhile now, so I thought it is time to try out something new. As a result, I have developed an OSX Cocoa application for hallenprojekt.de, a website that aggregates different co working spaces. It is an application that lives in the status bar and allows easy checking [...]]]></description>
			<content:encoded><![CDATA[<p>I have been writing Ruby applications exclusively for awhile now, so I thought it is time to try out something new. As a result, I have developed an OSX Cocoa application for <a href="http://hallenprojekt.de/" title="Showing places &raquo; hallenprojekt.de | Neue Orte für neues Arbeiten" target="_BLANK">hallenprojekt.de,</a> a website that aggregates different co working spaces. It is an application that lives in the status bar and allows easy checking into the available co working spaces.</p>
<p>It was fun and sometimes painful to learn how to achieve things with Objective-C and Cocoa in particular. And of course, learn how to automate packaging and deployment of new releases including automatic updates. Ironically, I ended up doing most of those tasks with Ruby. I will write a few blog posts covering my endeavors.</p>
<p>The source is available on <a href="http://github.com/phuesler/Hallenprojektstatus" title="phuesler's Hallenprojektstatus at master - GitHub" target="_BLANK">github</a> and the application itself can be downloaded <a href="http://hallenprojekt.huesler-informatik.ch/HallenprojektStatus.dmg" title="" target="_BLANK">here.</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F29%2Fhallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de%2F&amp;title=HallenProjektStatus%3A+An+OSX+status+bar+application+for+hallenprojekt.de" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/qCq-pxfQ-jQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/29/hallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/29/hallenprojektstatus-an-osx-status-bar-application-for-hallenprojekt-de/</feedburner:origLink></item>
		<item>
		<title>Quicktip: Search in your shell history</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/5f8pUY7bOA4/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/27/quicktip-search-in-your-shell-history/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:39:03 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Quicktips]]></category>
		<category><![CDATA[quicktip]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=201</guid>
		<description><![CDATA[Another neat trick I keep forgetting. If you want to search your shell history, just type in control-r and then your search query. You can browse through the search results by repeatedly pressing control-r. A big time saver if you ask me.










]]></description>
			<content:encoded><![CDATA[<p>Another neat trick I keep forgetting. If you want to search your shell history, just type in <em>control-r</em> and then your search query. You can browse through the search results by repeatedly pressing <em>control-r</em>. A big time saver if you ask me.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-search-in-your-shell-history%2F&amp;title=Quicktip%3A+Search+in+your+shell+history" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/5f8pUY7bOA4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/27/quicktip-search-in-your-shell-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/27/quicktip-search-in-your-shell-history/</feedburner:origLink></item>
		<item>
		<title>Quicktip: Preview files directly from the terminal on OSX</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/VU3bRtaAFls/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/27/quicktip-preview-files-directly-from-the-terminal-on-osx/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:34:42 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Quicktips]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[quick look]]></category>
		<category><![CDATA[quicktip]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=199</guid>
		<description><![CDATA[This is quick tip week. Have you ever wanted to preview a file on OSX with quick view without leaving the console. Well here is how:
qlmanage -p file
So if you wanted to preview the file image.png you would type:
qlmanage -p image.png
If you want to see the thumbnail preview of a file instead, just use -t [...]]]></description>
			<content:encoded><![CDATA[<p>This is quick tip week. Have you ever wanted to preview a file on OSX with quick view without leaving the console. Well here is how:</p>
<pre>qlmanage -p file</pre>
<p>So if you wanted to preview the file <em>image.png</em> you would type:</p>
<pre>qlmanage -p image.png</pre>
<p>If you want to see the thumbnail preview of a file instead, just use <em>-t</em> instead of <em>-p</em>.<br />
To close the window either click the cross on the upper right corner or hit <em>control-c</em> to cancel the process. Happy previewing!</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-preview-files-directly-from-the-terminal-on-osx%2F&amp;title=Quicktip%3A+Preview+files+directly+from+the+terminal+on+OSX" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/VU3bRtaAFls" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/27/quicktip-preview-files-directly-from-the-terminal-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/27/quicktip-preview-files-directly-from-the-terminal-on-osx/</feedburner:origLink></item>
		<item>
		<title>Quicktip: Flush DNS cache on OSX systems</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/-Qv1M3dx4QE/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/27/quicktip-flush-dns-cache-on-osx-systems/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:20:52 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Quicktips]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[flush]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicktip]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=197</guid>
		<description><![CDATA[Just in case you want to flush the DNS cache on an OSX system for whatever reason, this command gets the job done:

    dscacheutil -flushcache
  










]]></description>
			<content:encoded><![CDATA[<p>Just in case you want to flush the DNS cache on an OSX system for whatever reason, this command gets the job done:</p>
<pre>
    dscacheutil -flushcache
  </pre></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-flush-dns-cache-on-osx-systems%2F&amp;title=Quicktip%3A+Flush+DNS+cache+on+OSX+systems" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/-Qv1M3dx4QE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/27/quicktip-flush-dns-cache-on-osx-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/27/quicktip-flush-dns-cache-on-osx-systems/</feedburner:origLink></item>
		<item>
		<title>Quicktip: Access .plist files with RubyCocoa</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/YT7Unzucnjo/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/27/quicktip-access-plist-files-with-rubycocoa/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:10:24 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Quicktips]]></category>
		<category><![CDATA[RubyCocoa]]></category>
		<category><![CDATA[dictionary]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[plist]]></category>
		<category><![CDATA[quicktip]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=190</guid>
		<description><![CDATA[As part of the automated deployment process for a cocoa application, I needed to access a .plist file to change some values before the application gets bundled and uploaded.
Since plist files are plain XML files, I could have used something like libxml to get the job done but since this script runs on a Mac, [...]]]></description>
			<content:encoded><![CDATA[<p>As part of the automated deployment process for a cocoa application, I needed to access a .plist file to change some values before the application gets bundled and uploaded.</p>
<p>Since plist files are plain XML files, I could have used something like <em>libxml</em> to get the job done but since this script runs on a Mac, I have access to <a href="http://rubycocoa.sourceforge.net/HomePage" title="RubyCocoa: Welcome" target="_BLANK">RubyCocoa</a>. That spares me the XML parsing and writing and gives me a simple persistent dictionary instead. This is what I ended up with:<br />
<script src="http://gist.github.com/287995.js?file=ruby_cocoa_plist.rb"></script>
</p>
<p>I think that is pretty neat. However, I ran into a small pitfall when I tried to compare an NSString with a regular expression. I got this warning:</p>
<pre>'NSString#=~' doesn't work correctly. Because it returns byte indexes.
    Please use 'String#=~' instead.</pre>
</p>
<p>The solution is pretty simple, just call <em>to_s</em> on the dictionary values.<br />
  <script src="http://gist.github.com/288008.js?file=nsstring_regular_expression.rb"></script></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Fquicktip-access-plist-files-with-rubycocoa%2F&amp;title=Quicktip%3A+Access+.plist+files+with+RubyCocoa" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/YT7Unzucnjo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/27/quicktip-access-plist-files-with-rubycocoa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/27/quicktip-access-plist-files-with-rubycocoa/</feedburner:origLink></item>
		<item>
		<title>Rails: Testing rescue action in public behavior</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/9QJWkUQkocU/</link>
		<comments>http://www.huesler-informatik.ch/2010/01/27/rails-testing-rescue-action-in-public-behavior/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:49:15 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Action Controller]]></category>
		<category><![CDATA[ActionController]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[controller test]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rescue_action_in_public]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=179</guid>
		<description><![CDATA[
  Rails handles exceptions that occur in production mode by rendering the file public/500.html or one of the other two (404.html and 422.html) if appropriate. Generally this is a good default, but in some cases it is a requirement to redirect the user to, or render specific pages for different types of exceptions. For [...]]]></description>
			<content:encoded><![CDATA[<p>
  Rails handles exceptions that occur in production mode by rendering the file <em>public/500.html</em> or one of the other two (404.html and 422.html) if appropriate. Generally this is a good default, but in some cases it is a requirement to redirect the user to, or render specific pages for different types of exceptions. For instance, when an application provides a JSON API, it would be bad to return a 500.html to the caller when something goes wrong.
</p>
<p>There are generally two ways do this in Rails. Either overwrite <em>rescue_action_in_public</em> in your controller or use the newer <em>rescue_from</em> to map exceptions to a handler. Ryan Daigle wrote a short but comprehensive <a href="http://ryandaigle.com/articles/2007/9/24/what-s-new-in-edge-rails-better-exception-handling#comment-form" title="Ryan's Scraps: What's New in Edge Rails: Better Exception Handling" target="_BLANK">blog post</a> on this topic.</p>
<p>However, testing this is a bit tricky. <em>config.consider_all_requests_local</em> needs to be set to false and <em>local_request?</em> should be set to false as well. Testing this manually in the browser is cumbersome and error prone, so I needed a way to verify the behavior with a controller test. A quick <em>ack &#8211;ruby rescue_action_in_public actionpack-2.3.4</em> turned up <em>/actionpack-2.3.4/test/controller/rescue_test.rb</em> exactly what I needed.</p>
<p>
  As it turns out, this is actually quiet easy to test. Basically, there are four things to consider and you are good to go:
</p>
<p><b>1. Simulate the production environment in a setup method</b></p>
<p>
  <script src="http://gist.github.com/287899.js?file=setup_test_rescue_action_in_public.rb"></script>
</p>
<p><b>2. Create a dummy controller with actions that reproduce the errors you want to test</b></p>
<p>
  <script src="http://gist.github.com/287910.js?file=dummy_controller_rescue_action_in_public.rb"></script>
</p>
<p><b>3. Generate a route for your dummy controller if you have deleted the default routes in <em>routes.rb</em></b></p>
<p>
  <script src="http://gist.github.com/287919.js?file=draw_route_for_dummy_controller.rb"></script>
</p>
<p><b>4. Call those methods in your test cases</b></p>
<p><script src="http://gist.github.com/287916.js?file=assertions_rescue_action_in_public.rb"></script></p>
<p>
  With these four steps we got most uses cases covered. I ran into a problem, where I wanted to test an error that occurred during template rendering and required some special exception handling code. This is what worked for me:<br />
  <script src="http://gist.github.com/287934.js?file=test_template_rendering_errors.rb"></script></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2010%2F01%2F27%2Frails-testing-rescue-action-in-public-behavior%2F&amp;title=Rails%3A+Testing+rescue+action+in+public+behavior" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/9QJWkUQkocU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2010/01/27/rails-testing-rescue-action-in-public-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2010/01/27/rails-testing-rescue-action-in-public-behavior/</feedburner:origLink></item>
		<item>
		<title>simple_app_config: A little ruby helper to define and access the app configuration</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/QsKjXFWBhxQ/</link>
		<comments>http://www.huesler-informatik.ch/2009/10/12/simple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 15:16:19 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[appconfig]]></category>
		<category><![CDATA[configuration]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=173</guid>
		<description><![CDATA[Having a convenient way to store an applications configuration is something I want in every Ruby project. There are plenty of solutions for Ruby on Rails but none of them did really match my taste, because they did way too much. I wanted something  simple that does not depend on Ruby on Rails and [...]]]></description>
			<content:encoded><![CDATA[<p>Having a convenient way to store an applications configuration is something I want in every Ruby project. There are plenty of solutions for Ruby on Rails but none of them did really match my taste, because they did way too much. I wanted something  simple that does not depend on Ruby on Rails and does not try to be too clever.
</p>
<p>Here are my requirements for a configuration lib:</p>
<ul>
<li>Nesting and namespaces</li>
<li>Simple string interpolation</li>
<li>Support for environments e.g testing, production, debug</li>
<li>Defaults for each environment</li>
</ul>
<p>
 And this is what I came up with:</p>
<ul>
<li>Use YAML (defaults, namespaces, scopes)</li>
<li>Parse the YAML file with ERB</li>
<li>Return an OpenStruct object for easy method accessors</li>
</ul>
<p>
The code and and information on how to install and use the lib can be found here: <a href="http://github.com/phuesler/simple_app_config" target="_BLANK">http://github.com/phuesler/simple_app_config</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fsimple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration%2F&amp;title=simple_app_config%3A+A+little+ruby+helper+to+define+and+access+the+app+configuration" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/QsKjXFWBhxQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2009/10/12/simple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2009/10/12/simple_app_config-a-little-ruby-helper-to-define-and-access-the-app-configuration/</feedburner:origLink></item>
		<item>
		<title>A very basic ruby gem for the payone API</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/jXYuKQv0sNU/</link>
		<comments>http://www.huesler-informatik.ch/2009/10/12/a-very-basic-ruby-gem-for-the-payone-api/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:18:36 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[paymentserviceprovider]]></category>
		<category><![CDATA[payone]]></category>
		<category><![CDATA[psp]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=169</guid>
		<description><![CDATA[This is a short post about a small ruby gem I have written awhile ago. It&#8217;s a simple interface to Payone&#8217;s HTTP API. Payone is a payment service provider in Germany that offers several different payment methods like credit card, direct debit and so on and so forth.

The gem is still a little bit rough [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short post about a small ruby gem I have written awhile ago. It&#8217;s a simple interface to <a href="http://www.payone.de/" title="PAYONE ONLINE PAYMENT - Smart. Simple. Safe." target="_BLANK">Payone&#8217;s HTTP API</a>. Payone is a <a href="http://en.wikipedia.org/wiki/Payment_service_provider" title="Payment service provider - Wikipedia, the free encyclopedia" target="_BLANK">payment service provider</a> in Germany that offers several different payment methods like credit card, direct debit and so on and so forth.
</p>
<p>The gem is still a little bit rough around the edges and doesn&#8217;t do much more than sending http post requests. So you still have to know the payone API. There is a lot of room for improvement, I am thinking about an API similar to <a href="http://www.activemerchant.org/" title="Active Merchant" target="_BLANK">ActiveMerchant</a> or even an integration.</p>
<p>For the impatient here is how you install it:<br />
	<code><br />
	  gem install gemcutter<br />
	  gem tumble</p>
<p>	  gem install payone_connect<br />
	</code></p>
<p>	And here is how you use it:<br />
	<code><br />
	  require 'payone_connect'<br />
	  payone = PayoneConnect.new(api_key,params_hash)<br />
	  puts payone.request[:status]<br />
	</code>
</p>
<p>
Enough said, here you can find the code: <a href="http://github.com/phuesler/payone_connect" title="phuesler's payone_connect at master - GitHub" target="_BLANK">http://github.com/phuesler/payone_connect</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F12%2Fa-very-basic-ruby-gem-for-the-payone-api%2F&amp;title=A+very+basic+ruby+gem+for+the+payone+API" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/jXYuKQv0sNU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2009/10/12/a-very-basic-ruby-gem-for-the-payone-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2009/10/12/a-very-basic-ruby-gem-for-the-payone-api/</feedburner:origLink></item>
		<item>
		<title>Globalize bug: Where have my methods gone?</title>
		<link>http://feedproxy.google.com/~r/huesler-informatik/~3/Bp60M2LaCC8/</link>
		<comments>http://www.huesler-informatik.ch/2009/10/10/globalize-bug-where-have-my-methods-gone/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 16:20:12 +0000</pubDate>
		<dc:creator>Patrick Hüsler</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[globalize]]></category>
		<category><![CDATA[globalize2]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.huesler-informatik.ch/?p=161</guid>
		<description><![CDATA[Two weeks ago I stumbled upon a weird globalize2 behavior in a Ruby on Rails application I was working on.
globalize2 creates a has many association on a translated model that points to a proxy class. This proxy class holds the model translation for any given language. So if I tell it to translate a model [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago I stumbled upon a weird <a href="http://globalize-rails.org/" title="Globalize" target="_BLANK">globalize2</a> behavior in a <a href="http://rubyonrails.org/" title="Ruby on Rails" target="_BLANK">Ruby on Rails</a> application I was working on.</p>
<p><a href="http://globalize-rails.org/" title="Globalize" target="_BLANK">globalize2</a> creates a has many association on a translated model that points to a proxy class. This proxy class holds the model translation for any given language. So if I tell it to translate a model called Tag, it will create a class called TagTranslation on the fly.</p>
<p>I needed to add behavior to TagTranslation. I wanted to add a before save hook that makes transformations on an attribute before it gets saved. Therefore, I created an active record model called TagTranslation and added the hook. This worked wonderfully in test environment but not in the development environment. For some reason, the transformations weren&#8217;t made.</p>
<p>A short debugging session in script/console revealed that there was no before save hook on TagTranslation in development mode. More precisely, the class never got loaded. So I dug into the globalize2 code and found out that it just overrides an existing class with the same name.</p>
<p>So what happened? In that particular case, this happened when config.cache_classes was set to false in the rails config. This is the default in the development environment. What is difference then? When config.cache_classes is set to true (Default in production and test) then Rails eager loads the classes at startup. The class Tag gets loaded before TagTranslation and therefore globalize has already created a proxy class. So when our TagTranslation gets loaded it just reopens an existing class and adds stuff to it. What happens in development mode? Rails only loads models when triggered through Object.const_missing. When the constant Tag is referenced somewhere in the code, the class Tag is loaded and globalize creates a proxy class called TagTranslation as well as a has many association. The association normally triggers the associated class to be loaded (our TagTranslation model) but in this case, the class already exists and therefore our TagTranslation model never gets loaded.</p>
<p>How to fix it? I have a fork on github with a failing test and a fix:  <a href="http://github.com/phuesler/globalize2" title="phuesler's globalize2 at master - GitHub" target="_BLANK">http://github.com/phuesler/globalize2</a>. Alternatively you can make sure that your class gets loaded explicitly. You have to do this after you call globalize&#8217;s translate method. Here is how you could do it for the aforementioned Tag model:<br />
<script src="http://gist.github.com/207018.js"></script></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.huesler-informatik.ch%2F2009%2F10%2F10%2Fglobalize-bug-where-have-my-methods-gone%2F&amp;title=Globalize+bug%3A+Where+have+my+methods+gone%3F" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span><img src="http://feeds.feedburner.com/~r/huesler-informatik/~4/Bp60M2LaCC8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.huesler-informatik.ch/2009/10/10/globalize-bug-where-have-my-methods-gone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.huesler-informatik.ch/2009/10/10/globalize-bug-where-have-my-methods-gone/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.989 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-10 09:51:32 -->
