<?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>funkensturm. &#187; ruby on rails</title>
	<atom:link href="http://funkensturm.de/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://funkensturm.de</link>
	<description>Das funkensturm. Weblog</description>
	<lastBuildDate>Tue, 15 Nov 2011 15:04:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>XML Sitemap Generator for&#160;Rails</title>
		<link>http://funkensturm.de/2010/01/10/xml-sitemap-generator-for-rails/</link>
		<comments>http://funkensturm.de/2010/01/10/xml-sitemap-generator-for-rails/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 22:56:52 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Google Sitemaps]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[XML Sitemaps]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=263</guid>
		<description><![CDATA[I realy like the way the Google (XML) Sitemaps Generator for WordPress handles the generation of my sitemaps and informs Google about the changes on my blog. I was missing this in the Rails world for a long time, so I decided to build my own Rails plugin. Here it is: &#8220;XML Sitemap Generator for [...]]]></description>
			<content:encoded><![CDATA[<p>I realy like the way the <a href="http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/" title="Google (XML) Sitemaps Generator for WordPress" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/?referer=');">Google (XML) Sitemaps Generator for WordPress</a> handles the generation of my sitemaps and informs Google about the changes on my blog.</p>
<p>I was missing this in the Rails world for a long time, so I decided to build my own Rails plugin.</p>
<p>Here it is: <a href="http://github.com/fsmanuel/xml_sitemap_generator" title="XML Sitemap Generator for Rails" target="_blank" onclick="pageTracker._trackPageview('/outgoing/github.com/fsmanuel/xml_sitemap_generator?referer=');">&#8220;XML Sitemap Generator for Rails&#8221;</a></p>
<p>It&#8217;s just a quick implementation of all the functionality you need to let your Rails App generate a XML Sitemap and ping Google about the updates.<br />
It&#8217;s not made to be scale more to give your small site the abillitiy to have a sitemap.</p>
<p>I&#8217;ll work on it in the future to make it easy to add some custom URL&#8217;s and maybe to have a version to scale&#8230;</p>
<p>Check it out on: <a href="http://github.com/fsmanuel/xml_sitemap_generator" title="XML Sitemap Generator for Rails @ GitHub.com" target="_blank" onclick="pageTracker._trackPageview('/outgoing/github.com/fsmanuel/xml_sitemap_generator?referer=');">GitHub</a><br />
If you have any suggestions fork the project and send me a pull request.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2010/01/10/xml-sitemap-generator-for-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>render_nested_form&#160;Helper</title>
		<link>http://funkensturm.de/2009/08/27/render_nested_form-helper/</link>
		<comments>http://funkensturm.de/2009/08/27/render_nested_form-helper/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 16:57:06 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rails 2.3]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[accepts_nested_attributes_for]]></category>
		<category><![CDATA[nested forms]]></category>
		<category><![CDATA[render_nested_form]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=216</guid>
		<description><![CDATA[Die in Rails 2.3 eingeführten Nested Forms haben mir am Anfang sehr viele Kopfschmerzen bereitet und tun dies immer mal wieder. Dank schorsch vom SalesKing muss ich mir um diese Dinge keine Sorgen mehr machen. Sein render_nested_form Helper übernimmt alles und hat ein paar sehr nette Options. # Options are: # * &#60;tt&#62;:new&#60;/tt&#62; - specify [...]]]></description>
			<content:encoded><![CDATA[<p>Die in Rails 2.3 eingeführten Nested Forms haben mir am Anfang sehr viele Kopfschmerzen bereitet und tun dies immer mal wieder.</p>
<p>Dank schorsch vom <a href="http://www.salesking.eu" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.salesking.eu?referer=');">SalesKing</a> muss ich mir um diese Dinge keine Sorgen mehr machen.<br />
Sein <a href="http://gist.github.com/134652" target="_blank" onclick="pageTracker._trackPageview('/outgoing/gist.github.com/134652?referer=');">render_nested_form Helper</a> übernimmt alles und hat ein paar sehr nette Options.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Options are:</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:new&lt;/tt&gt; - specify a certain number of new elements to be added to the form. Useful for displaying a few blank elements at the bottom.</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:name&lt;/tt&gt; - override the name of the association, both for the field names, and the name of the partial</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:partial&lt;/tt&gt; - specify the name of the partial in which the form is located.</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:fields_for&lt;/tt&gt; - specify additional options for the fields_for_associated call</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:locals&lt;/tt&gt; - specify additional variables to be passed along to the partial</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:render&lt;/tt&gt; - specify additional options to be passed along to the render :partial call</span>
<span style="color:#008000; font-style:italic;"># * &lt;tt&gt;:skip&lt;/tt&gt; - array of elements which will be skipped, usefull if you already rendered a partial in the same form with parts of the data. eg. obj.addresses, render the firt address on top of form, render all the other addresses at the bottom</span>
&nbsp;
f.<span style="color:#9900CC;">render_nested_form</span><span style="color:#006600; font-weight:bold;">&#40;</span>@project.<span style="color:#9900CC;">tasks</span>, :<span style="color:#5A0A0A; font-weight:bold;">new</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">3</span>, <span style="color:#ff3333; font-weight:bold;">:partial</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">'some_partial'</span>, <span style="color:#ff3333; font-weight:bold;">:locals</span><span style="color:#006600; font-weight:bold;">=&gt;</span>..<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p><strong>Update:</strong><br />
Ich hab den Helper geforked und die Option :as hinzugefügt. Damit kann man den Namen der lokalen Variable definieren, wenn man den Partial z.B. für unterschiedliche Objekte und Attribute nutzt (bei mir ist das ein Upload Form).<br />
Hier findet ihr den <a href="http://gist.github.com/193443" target="_blank" onclick="pageTracker._trackPageview('/outgoing/gist.github.com/193443?referer=');">Fork</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/08/27/render_nested_form-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get HTTP Headers in&#160;Ruby</title>
		<link>http://funkensturm.de/2009/08/27/get-http-headers/</link>
		<comments>http://funkensturm.de/2009/08/27/get-http-headers/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:15:11 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[schublade]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[NET::HTTP]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=202</guid>
		<description><![CDATA[Ein kleiner Schnipsel, um nur den Header eines HTTP Aufrufes zu erhalten. url = URI.parse&#40;'http://manuel.funkensturm.de/'&#41; req = Net::HTTP::Get.new&#40;url.path&#41; res = Net::HTTP.start&#40;url.host, url.port&#41; &#123; &#124;http&#124; http.request_head&#40;'/feed/'&#41; &#125; res.to_yaml Interessant sind in meinen Augen folgende Werte: &#62;&#62; res&#91;'last-modified'&#93; =&#62; &#34;Tue, 11 Aug 2009 16:09:01 GMT&#34; &#62;&#62; res&#91;'content-type'&#93; =&#62; &#34;application/rss+xml; charset=\&#34;UTF-8\&#34;&#34; &#62;&#62; res&#91;'etag'&#93; =&#62; &#34;\&#34;ca39ca8e3c9d3b858ef0d711956e00ad\&#34;&#34; über last-modified oder [...]]]></description>
			<content:encoded><![CDATA[<p>Ein kleiner Schnipsel, um nur den Header eines HTTP Aufrufes zu erhalten.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">url = <span style="color:#CC00FF; font-weight:bold;">URI</span>.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'http://manuel.funkensturm.de/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
req = <span style="color:#6666ff; font-weight:bold;">Net::HTTP::Get</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>url.<span style="color:#9900CC;">path</span><span style="color:#006600; font-weight:bold;">&#41;</span>
res = <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span>url.<span style="color:#9900CC;">host</span>, url.<span style="color:#9900CC;">port</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>http<span style="color:#006600; font-weight:bold;">|</span> http.<span style="color:#9900CC;">request_head</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/feed/'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
res.<span style="color:#9900CC;">to_yaml</span></pre></div></div>

<p>Interessant sind in meinen Augen folgende Werte:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;&gt;</span> res<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'last-modified'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;Tue, 11 Aug 2009 16:09:01 GMT&quot;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> res<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'content-type'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;application/rss+xml; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>UTF-8<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> res<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'etag'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>ca39ca8e3c9d3b858ef0d711956e00ad<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span></pre></div></div>

<p>über last-modified oder den etag kann man dann schauen, ob man den Feed abholt oder die Aktion durchführt&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/08/27/get-http-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funkenrailsdav: Webdav with Rails e.g. for&#160;ical</title>
		<link>http://funkensturm.de/2009/06/08/funkenrailsdav-webdav-with-rails-eg-for-ical/</link>
		<comments>http://funkensturm.de/2009/06/08/funkenrailsdav-webdav-with-rails-eg-for-ical/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 20:14:33 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rails 2.3]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[abonemment]]></category>
		<category><![CDATA[abonnieren]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[icalendar]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[railsdav]]></category>
		<category><![CDATA[synchronisieren]]></category>
		<category><![CDATA[synchronize]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=189</guid>
		<description><![CDATA[So you want a rails application to give you a webdav? Good, railsdav can do this for you. However, it might take you an hour or two as well to figure out how it works :) This plugin is a copy of the original railsdav plugin with some modifications to make it run out-of-the-box. Just [...]]]></description>
			<content:encoded><![CDATA[<p>So you want a rails application to give you a webdav? Good, <a href="http://github.com/stueccles/railsdav" onclick="pageTracker._trackPageview('/outgoing/github.com/stueccles/railsdav?referer=');">railsdav</a> can do this for you. However, it might take you an hour or two as well to figure out how it works :)</p>
<p>This plugin is a copy of the original railsdav plugin with some modifications to make it run out-of-the-box. Just drop this plugin into your newly created rails application and it becomes a webdav-server. It comes with Authentication, so you can publish and synchronize your ical-files without fear :)</p>
<p>This was done using Rails 2.3.2.</p>
<p>Get it here: <a href="http://github.com/funkensturm/railsdav" onclick="pageTracker._trackPageview('/outgoing/github.com/funkensturm/railsdav?referer=');">http://github.com/funkensturm/railsdav</a></p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/06/08/funkenrailsdav-webdav-with-rails-eg-for-ical/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Presenting: The Funkengallery Demo&#160;App</title>
		<link>http://funkensturm.de/2009/02/19/presenting-the-funkengallery-demo-app/</link>
		<comments>http://funkensturm.de/2009/02/19/presenting-the-funkengallery-demo-app/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 21:14:54 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[introducing]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rails 2.3]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[funkengallery]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=180</guid>
		<description><![CDATA[Still in beta mode, but we are proud to present a Rails 2.3 application, modularized in plugins, fully I18n (German, English, Swedish), and of course published at github. This funkengallery demo application includes demonstration of all our plugins: acts_as_category acts_as_identifiable funkengallery funkenlogin funkenlogin irobot manipulify Again, this is beta still, which means that for example [...]]]></description>
			<content:encoded><![CDATA[<p>Still in beta mode, but we are proud to present a <strong>Rails 2.3</strong> application, modularized in plugins, fully I18n (German, English, Swedish), and of course published at <a href="http://www.github.com/funkensturm" onclick="pageTracker._trackPageview('/outgoing/www.github.com/funkensturm?referer=');">github</a>.</p>
<p>This funkengallery demo application includes demonstration of all our plugins:</p>
<ul>
<li>acts_as_category</li>
<li>acts_as_identifiable</li>
<li>funkengallery</li>
<li>funkenlogin</li>
<li>funkenlogin</li>
<li>irobot</li>
<li>manipulify</li>
</ul>
<p>Again, this is beta still, which means that for example the admin area wants your models to be called exactly &#8220;Category&#8221; and &#8220;User&#8221;. So not 100% modularized yet, but we&#8217;re getting there and you can already use it as a perfect standalone application ;)</p>
<p>What&#8217;s so special about this gallery is the very dynamic user rights management and the simplicity. It is designed for a complex category tree with many thousands of pictures. However, you might expect flickr design and you get&#8230; well&#8230; funkengallery. It is different and simpler, but really neat if you want to share your pictures quick, private and with individual user rights.</p>
<h4>Screenshots and Demo</h4>
<p>Check out our <a href="http://blog.funkensturm.de/downloads/">Downloads</a> site to see how you can easily test your local demo.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/02/19/presenting-the-funkengallery-demo-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails: JPG Bilder kaputt beim Upload (grauer&#160;Balken)</title>
		<link>http://funkensturm.de/2009/02/17/rails-jpg-bilder-kaputt-beim-upload-grauer-balken/</link>
		<comments>http://funkensturm.de/2009/02/17/rails-jpg-bilder-kaputt-beim-upload-grauer-balken/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 11:46:22 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[bild]]></category>
		<category><![CDATA[corrupt]]></category>
		<category><![CDATA[datei]]></category>
		<category><![CDATA[file.open]]></category>
		<category><![CDATA[file.write]]></category>
		<category><![CDATA[grau]]></category>
		<category><![CDATA[grauer balken]]></category>
		<category><![CDATA[gray]]></category>
		<category><![CDATA[hochladen]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[korrupt]]></category>
		<category><![CDATA[params]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[speichern]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[zerstört]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=157</guid>
		<description><![CDATA[Völlig zufällig wurden Bilder beim Upload in Rails mit einem grauen Balken versehen. Mal viel grau, mal wenig grau. Mann muss genau hinschauen bei diesem Beispiel, ganz unten rechts: Zuerst dachte ich, es sei RMagick, dass versucht das Bild zu verkleinern (resize) und irgendwann merkte ich, dass der Upload an sich schon fehlerhaft war. Dann [...]]]></description>
			<content:encoded><![CDATA[<p>Völlig zufällig wurden Bilder beim Upload in Rails mit einem grauen Balken versehen.</p>
<p>Mal viel grau, mal wenig grau. Mann muss genau hinschauen bei diesem Beispiel, ganz unten rechts:</p>
<p><img src="http://blog.funkensturm.de/wp-content/uploads/2009/02/dsc01326jzyuu.jpg" alt="dsc01326jzyuu" title="dsc01326jzyuu" width="500" height="375" class="alignnone size-full wp-image-158" /></p>
<p>Zuerst dachte ich, es sei RMagick, dass versucht das Bild zu verkleinern (resize) und irgendwann merkte ich, dass der Upload an sich schon fehlerhaft war. Dann dachte ich es sei der YUI Uploader, habe aber zum Glück das Problem gefunden.</p>
<p>Zum speichern der Datei habe ich das hier verwendet:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>target, <span style="color:#996600;">&quot;wb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:upload</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Das darf man nicht! :)<br />
Man muss es so machen:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>target, <span style="color:#996600;">&quot;wb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
file.<span style="color:#9900CC;">write</span> params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:upload</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">read</span>
file.<span style="color:#9900CC;">close</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/02/17/rails-jpg-bilder-kaputt-beim-upload-grauer-balken/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passenger für Ruby on Rails aus TextMate &#8220;automatisch&#8221; neu&#160;starten</title>
		<link>http://funkensturm.de/2009/01/27/passenger-fur-ruby-on-rails-aus-textmate-automatisch-neu-starten/</link>
		<comments>http://funkensturm.de/2009/01/27/passenger-fur-ruby-on-rails-aus-textmate-automatisch-neu-starten/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 11:37:00 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[autorun]]></category>
		<category><![CDATA[autostart]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[prefpane]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=132</guid>
		<description><![CDATA[Manchmal möchte man seine Ruby-on-Rails-Applikation im Passenger manuell neu starten. Sprich eine Datei my_app/tmp/restart.txt anlegen. Ich habe ein kleines Command-Skript für TextMate dafür geschrieben. Wenn man es ausführt (in diesem Beispiel mit APFEL+R), wird beim nächsten Browseraufruf alles neu geladen. Praktisch wenn man Plugins entwickelt :) Hier der Command in TextMate: Und hier der Code [...]]]></description>
			<content:encoded><![CDATA[<p>Manchmal möchte man seine Ruby-on-Rails-Applikation im Passenger manuell neu starten. Sprich eine Datei <code>my_app/tmp/restart.txt</code> anlegen. Ich habe ein kleines Command-Skript für TextMate dafür geschrieben. Wenn man es ausführt (in diesem Beispiel mit APFEL+R), wird beim nächsten Browseraufruf alles neu geladen. Praktisch wenn man Plugins entwickelt :)</p>
<p>Hier der Command in TextMate:</p>
<p><img src="http://blog.funkensturm.de/wp-content/uploads/2009/01/restart_passenger.png" alt="restart_passenger" title="restart_passenger" width="500" class="alignnone size-full wp-image-131" /></p>
<p>Und hier der Code dafür</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;#{ENV['TM_BUNDLE_SUPPORT']}/lib/rails_bundle_tools.rb&quot;</span>
f = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RailsPath.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">rails_root</span>, <span style="color:#996600;">&quot;tmp&quot;</span>, <span style="color:#996600;">&quot;restart.txt&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#996600;">&quot;w&quot;</span>
f.<span style="color:#9900CC;">close</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Rails Application will be reloaded!&quot;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2009/01/27/passenger-fur-ruby-on-rails-aus-textmate-automatisch-neu-starten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveSupport::Memoizable Cache&#160;löschen</title>
		<link>http://funkensturm.de/2008/11/23/activesupportmemoizable-cache-loschen/</link>
		<comments>http://funkensturm.de/2008/11/23/activesupportmemoizable-cache-loschen/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 01:11:21 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[introducing]]></category>
		<category><![CDATA[Rails 2.2]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[memoizable]]></category>
		<category><![CDATA[memoize]]></category>
		<category><![CDATA[memoize_all]]></category>
		<category><![CDATA[unmemoize]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=100</guid>
		<description><![CDATA[Auch wenn es vielen von vorn herein klar ist, mir war es nicht sofort klar :) Das tolle Memoizable in Rails 2.2 macht das Caching von Methoden einfacher. Ich bin dabei auf eine Frage gestoßen: Wie lösche ich den Cache? Als ich mir den Quellcode von Memoizable angeschaut habe, dachte ich auf den ersten Blick, [...]]]></description>
			<content:encoded><![CDATA[<p>Auch wenn es vielen von vorn herein klar ist, mir war es nicht sofort klar :)</p>
<p>Das tolle <a href="http://www.railway.at/articles/2008/09/20/a-guide-to-memoization" onclick="pageTracker._trackPageview('/outgoing/www.railway.at/articles/2008/09/20/a-guide-to-memoization?referer=');">Memoizable</a> in Rails 2.2 macht das Caching von Methoden einfacher. Ich bin dabei auf eine Frage gestoßen:</p>
<p>Wie lösche ich den Cache?</p>
<p>Als ich mir den <a href="http://github.com/josh/rails/tree/master/activesupport%2Flib%2Factive_support%2Fmemoizable.rb" onclick="pageTracker._trackPageview('/outgoing/github.com/josh/rails/tree/master/activesupport_2Flib_2Factive_support_2Fmemoizable.rb?referer=');">Quellcode von Memoizable</a> angeschaut habe, dachte ich auf den ersten Blick, dass memoize_all ALLE Methoden einer Klasse memoizen würde und unmemoize_all alles wieder deaktiviert.</p>
<p>Nun, tatsächlich löscht unmemoize_all nur den gesamten Cache und er wird automatisch mit jedem Aufruf einer Methode Stück für Stück wieder aufgebaut. Wenn man also z. B. eine Änderung vornimmt, sollte man unmemoize_all ausführen.</p>
<p>memoize_all hingegen, führt alle gecachten Methoden auf einmal aus (!) und speichert die Ergebnisse im Cache. Aber das kann doch nicht sein, oder? Kann mir<a href="http://github.com/josh/rails/tree/master/activesupport%2Flib%2Factive_support%2Fmemoizable.rb#L21" onclick="pageTracker._trackPageview('/outgoing/github.com/josh/rails/tree/master/activesupport_2Flib_2Factive_support_2Fmemoizable.rb_L21?referer=');"> das hier mal</a> jmd. erklären :)</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2008/11/23/activesupportmemoizable-cache-loschen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nützliche Terminal&#160;Befehle</title>
		<link>http://funkensturm.de/2008/04/17/nutzliche-terminal-befehle/</link>
		<comments>http://funkensturm.de/2008/04/17/nutzliche-terminal-befehle/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 15:34:20 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[mac os x]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[schublade]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[mx record]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/?p=60</guid>
		<description><![CDATA[Hier soll eine Liste mit nützlichen Terminal Befehlen entstehen, da man so manche einfach jedes mal vergisst und dann suchen muss. Nameserver einer Domain herausfinden nslookup funkensturm.de MX Record einer Domain herausfinden nslookup -query=mx funkensturm.de DNS Cache flushen dscacheutil -flushcache Prozesse (zu einem Command) mit PID&#8217;s herausfinden ps aux &#124; grep -i ruby &#124; grep [...]]]></description>
			<content:encoded><![CDATA[<p>Hier soll eine Liste mit nützlichen Terminal Befehlen entstehen, da man so manche einfach jedes mal vergisst und dann suchen muss.</p>
<p><strong>Nameserver einer Domain herausfinden</strong><br />
nslookup funkensturm.de</p>
<p><strong>MX Record einer Domain herausfinden</strong><br />
nslookup -query=mx funkensturm.de</p>
<p><strong>DNS Cache flushen</strong><br />
dscacheutil -flushcache</p>
<p><strong>Prozesse (zu einem Command) mit PID&#8217;s herausfinden</strong><br />
ps aux | grep -i ruby<br />
| grep -i command nur wenn man die Prozesse zu einem Command haben will</p>
<p><strong>Prozesse beenden</strong><br />
kill -9 PID<br />
killall command</p>
<p>mit den zwei fang ich mal an. Wird aber immer schön erweitert. Wenn ihr welche habt einfach in die Comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2008/04/17/nutzliche-terminal-befehle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>FINALLY! RailsICalendar ical ics publish with ruby on&#160;rails</title>
		<link>http://funkensturm.de/2008/02/10/finally-railsicalendar-ical-ics-publish-with-ruby-on-rails/</link>
		<comments>http://funkensturm.de/2008/02/10/finally-railsicalendar-ical-ics-publish-with-ruby-on-rails/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 23:05:39 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[introducing]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[icalendar]]></category>
		<category><![CDATA[occurences]]></category>
		<category><![CDATA[ocurrs_within]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[recurrence]]></category>
		<category><![CDATA[rrule]]></category>
		<category><![CDATA[vpim]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2008/02/10/finally-railsicalendar-ical-ics-publish-with-ruby-on-rails/</guid>
		<description><![CDATA[Das hat echt was Nerven gekostet, aber ich bin mehr als zufrieden mit dem Resultat. Ich darf vorstellen: Wenn man seinen Kalender in Mac OS X (z. B. per Webdav) auf seinen Server lädt (bzw. synchronisiert) und auf diesem Server auch Ruby on Rails läuft, dann kann man seinen Kalender jetzt auf seiner Webseite veröffentlichen. [...]]]></description>
			<content:encoded><![CDATA[<p>Das hat echt was Nerven gekostet, aber ich bin mehr als zufrieden mit dem Resultat.</p>
<p>Ich darf vorstellen: Wenn man seinen Kalender in Mac OS X (z. B. per Webdav) auf seinen Server lädt (bzw. synchronisiert) und auf diesem Server auch Ruby on Rails läuft, dann kann man seinen Kalender jetzt auf seiner Webseite veröffentlichen.</p>
<p>In fact I just realize I should better speak english, because someone&#8217;s German might be somewhat rusty :)</p>
<p>So again: You have ics files on your server (e.g. via webdav) and Ruby on Rails is running? Great, let&#8217;s publish your calendar. The idea came from the great PHPicalendar script.</p>
<p>This is what it will somewhat look like:<br />
<a href='http://blog.funkensturm.de/wp-content/uploads/2008/02/bild-1.png' title='bild-1.png'><img src='http://blog.funkensturm.de/wp-content/uploads/2008/02/bild-1.thumbnail.png' alt='bild-1.png' /></a></p>
<p>I am sorry to not have made a plugin out of this yet, but, hey, the basics are there, help yourself :) If you have any questions feel free to comment.</p>
<p>Requirements:</p>
<ul>
<li>Vpim plugin with <code>sudo gem install vpim</code></li>
</ul>
<p>Features:</p>
<ul>
<li>Read several ICS files from a directory on the server</li>
<li>Parse all the ical events in them</li>
<li>Cache the current calendar in yaml files</li>
<li>(The cache will be refreshed when a ICS file was updated meanwhile)</li>
<li>HTML will be presented for the calendar</li>
<li>Currently you can only choose a date and see the next X days</li>
</ul>
<p><b>A word on recurrence of events</b></p>
<ul>
<li>It does do most of the recurrence rules!</li>
<li>Specifically: All that <a href="http://vpim.rubyforge.org/" onclick="pageTracker._trackPageview('/outgoing/vpim.rubyforge.org/?referer=');">VPIM</a> supports</li>
<li><b>PLUS:</b> EXDATE is also supported!</li>
</ul>
<p><strong>The Code</strong></p>
<p><strong><em>Initializer</em></strong> (config/initializers/any_filename.rb)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Path to icalendar *.ics files on your server</span>
PATH_ICS       = <span style="color:#996600;">&quot;#{RAILS_ROOT}/private/calendars/&quot;</span>
PATH_ICS_CACHE = <span style="color:#996600;">&quot;#{RAILS_ROOT}/tmp/calendars/&quot;</span>
<span style="color:#CC00FF; font-weight:bold;">FileUtils</span>::mkdir_p<span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS<span style="color:#006600; font-weight:bold;">&#41;</span>       <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC00FF; font-weight:bold;">FileUtils</span>::mkdir_p<span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS_CACHE<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS_CACHE<span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p><strong><em>Controller</em></strong> (app/controllers/calendars_controller.rb)</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
</pre></td><td class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'vpim'</span>
<span style="color:#9966CC; font-weight:bold;">class</span> CalendarsController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> index
    <span style="color:#008000; font-style:italic;"># Load parameters if submitted</span>
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_year</span><span style="color:#006600; font-weight:bold;">&#93;</span>  = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(1i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(1i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">empty</span>?
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_month</span><span style="color:#006600; font-weight:bold;">&#93;</span> = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(2i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(2i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">empty</span>?
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_day</span><span style="color:#006600; font-weight:bold;">&#93;</span>   = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(3i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:options</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;date(3i)&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">empty</span>?
&nbsp;
    <span style="color:#008000; font-style:italic;"># Load standard if nothing submitted</span>
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_year</span><span style="color:#006600; font-weight:bold;">&#93;</span>  = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">year</span>  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_year</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>?
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_month</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#5A0A0A; font-weight:bold;">month</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_month</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>?
    <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_day</span><span style="color:#006600; font-weight:bold;">&#93;</span>   = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#5A0A0A; font-weight:bold;">day</span>   <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_day</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>?
&nbsp;
    <span style="color:#008000; font-style:italic;"># Set variables</span>
    <span style="color:#0066ff; font-weight:bold;">@scope</span>     = <span style="color:#006666;">7</span>
    <span style="color:#0066ff; font-weight:bold;">@events</span>   = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#0066ff; font-weight:bold;">@today</span>    = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">gm</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_year</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_month</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#5A0A0A; font-weight:bold;">session</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:date_day</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    cachefile = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS_CACHE, <span style="color:#996600;">&quot;#{@today.to_s(:ical)}_#{@scope}.yml&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Kill cache if outdated</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>cachefile<span style="color:#006600; font-weight:bold;">&#41;</span>
      killcache = <span style="color:#0000FF; font-weight:bold;">false</span>
      <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS, <span style="color:#996600;">'*.ics'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#5A0A0A; font-weight:bold;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
        killcache = <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">mtime</span><span style="color:#006600; font-weight:bold;">&#40;</span>file<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">mtime</span><span style="color:#006600; font-weight:bold;">&#40;</span>cachefile<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;">if</span> killcache
        <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS_CACHE, <span style="color:#996600;">'*.*'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#5A0A0A; font-weight:bold;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
          <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#5A0A0A; font-weight:bold;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>file<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>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Load calendar from cache</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>cachefile<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@events</span> = <span style="color:#CC00FF; font-weight:bold;">YAML</span>.<span style="color:#9900CC;">load_file</span> cachefile 
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#008000; font-style:italic;"># No cache, parse each icalendar *.ics file in PATH_ICS and check for event occurences</span>
      <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>PATH_ICS, <span style="color:#996600;">'*.ics'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#5A0A0A; font-weight:bold;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
        category = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>file, <span style="color:#996600;">'.ics'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#6666ff; font-weight:bold;">Vpim::Icalendar</span>.<span style="color:#9900CC;">decode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>file<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#5A0A0A; font-weight:bold;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>calendar<span style="color:#006600; font-weight:bold;">|</span>
          calendar.<span style="color:#9900CC;">components</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>event<span style="color:#006600; font-weight:bold;">|</span>
            <span style="color:#9966CC; font-weight:bold;">for</span> <span style="color:#5A0A0A; font-weight:bold;">day</span> <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#006666;">0</span>..@scope
              <span style="color:#9966CC; font-weight:bold;">if</span> start = event.<span style="color:#9900CC;">occurs_in</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>@today<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">24</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#5A0A0A; font-weight:bold;">day</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0066ff; font-weight:bold;">@today</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">24</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">24</span><span style="color:#006600; font-weight:bold;">*</span><span style="color:#5A0A0A; font-weight:bold;">day</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
                myend = start <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="color:#9900CC;">dtend</span> <span style="color:#006600; font-weight:bold;">-</span> event.<span style="color:#9900CC;">dtstart</span><span style="color:#006600; font-weight:bold;">&#41;</span>
                <span style="color:#0066ff; font-weight:bold;">@events</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
                  <span style="color:#996600;">'category'</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> category,
                  <span style="color:#996600;">'day'</span>      <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#5A0A0A; font-weight:bold;">day</span>,
                  <span style="color:#996600;">'start'</span>    <span style="color:#006600; font-weight:bold;">=&gt;</span> start,
                  <span style="color:#996600;">'duration'</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="color:#9900CC;">dtend</span> <span style="color:#006600; font-weight:bold;">-</span> event.<span style="color:#9900CC;">dtstart</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006666;">60</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">round</span>, <span style="color:#008000; font-style:italic;"># In minutes</span>
                  <span style="color:#996600;">'end'</span>      <span style="color:#006600; font-weight:bold;">=&gt;</span> myend,
                  <span style="color:#996600;">'allday'</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> start.<span style="color:#9900CC;">hour</span> == <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> start.<span style="color:#9900CC;">min</span> == <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> start.<span style="color:#9900CC;">sec</span> == <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> myend.<span style="color:#9900CC;">hour</span> == <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> myend.<span style="color:#9900CC;">min</span> == <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> myend.<span style="color:#9900CC;">sec</span> == <span style="color:#006666;">0</span>,
                  <span style="color:#996600;">'data'</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> event
                <span style="color:#006600; font-weight:bold;">&#125;</span>
              <span style="color:#9966CC; font-weight:bold;">end</span>
            <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#0066ff; font-weight:bold;">@events</span> = <span style="color:#0066ff; font-weight:bold;">@events</span>.<span style="color:#9900CC;">uniq</span> <span style="color:#008000; font-style:italic;"># Just in case :)</span>
      <span style="color:#008000; font-style:italic;"># Save cache</span>
      <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>cachefile, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC00FF; font-weight:bold;">YAML</span>.<span style="color:#9900CC;">dump</span><span style="color:#006600; font-weight:bold;">&#40;</span>@events, f<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</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;">end</span></pre></td></tr></table></div>

<p><strong><em>Single View</em></strong> (view/calendars/index.html.erb)</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
</pre></td><td class="code"><pre class="rails" style="font-family:monospace;">&lt; %
  width  = 110      # Width of one day
  height = 6        # height of 15 minutes in pixels
  buffer = 28       # free space for dates in day column (at top of each day)
  minh   = 20       # Minimum of event height
  cutmornings = 120 # I don't have events between 0:00 and 6:00, cut these pixels off
%&gt;
&nbsp;
&lt;div id=&quot;action&quot;&gt;
&nbsp;
&lt; % for day in 0...@scope + 1 do 
  today = (@today+(60*60*24*day))
  case today.wday  
    when 0  
      dayclass = 'class=&quot;sunday&quot;'
    when 6  
      dayclass = 'class=&quot;saturday&quot;'
    else  
      dayclass = 'class=&quot;otherday&quot;'
  end
  %&gt;
  &lt;div id=&quot;ical_day&quot; <span style="color:#006600; font-weight:bold;">&lt;%</span>= dayclass <span style="color:#006600; font-weight:bold;">%&gt;</span>
    style=&quot; width:  &lt; %= width %&gt;px;
            height: &lt; %= height*96 + buffer - cutmornings %&gt;px;
            left:   &lt; %= day*width + day*10 %&gt;px;&quot;&gt;
    &lt; % if today.year == Time.now.year &amp;&amp; today.month == Time.now.month &amp;&amp; today.day == Time.now.day %&gt;
      &lt;b&gt;&lt; %= 'Today' %&gt;&lt;/b&gt;
    &lt; % else %&gt;
      &lt; %= _(today.strftime(&quot;%a&quot;)) +', '+ today.to_s(:date) %&gt;
    &lt; % end %&gt;
  &lt;/div&gt;
&lt; % end %&gt;
&nbsp;
&lt; % tops = Array.new(@scope + 1, '')
@events.each do |event|
&nbsp;
  # Exclude recurrence rule hack
  today = (@today+(60*60*24*event['day']))
  exme = false
  event['data'].propvaluearray('EXDATE').each do |exdate|
    exdate = exdate.to_time
    exme = true if today.year == exdate.year &amp;&amp; today.mon == exdate.mon &amp;&amp; today.day == exdate.day
  end
  next if exme # Skip this event
&nbsp;
  if event['allday']
    # All-day events will be inserted later
    tops[event['day']] += '&amp;nbsp; ' + event['data'].summary.to_s + '&lt;br/&gt;'
  else 
    eventheight = ((event['duration']/15)*height).round
    eventheight = minh if eventheight &lt; minh
    %&gt;
    &lt;div id=&quot;ical_event&quot;
      style=&quot; background: #<span style="color:#006600; font-weight:bold;">&lt;%</span>= eventcolor<span style="color:#006600; font-weight:bold;">&#40;</span>event<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'category'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>;
              width:  &lt; %= width-2 %&gt;px;
              height: &lt; %= eventheight.to_s %&gt;px;
              top:    &lt; %= event['start'].hour*height*4 + (event['start'].min/15)*6 + buffer - cutmornings %&gt;px;
              left:   &lt; %= event['day']*width + event['day']*10 %&gt;px;&quot;&gt;
      &lt; %= '&lt;b&gt;'+ event['start'].to_s(:time) +' - '+ event['end'].to_s(:time) +'&lt;br /&gt;' %&gt;
      &lt; %= event['data'].summary %&gt;
    &lt;/div&gt;
  &lt; % end %&gt;
&lt; % end %&gt;
&nbsp;
&lt; % tops.each_with_index do |top, day| %&gt;
    &lt;div id=&quot;ical_event_top&quot;
      style=&quot; width: <span style="color:#006600; font-weight:bold;">&lt;%</span>= width<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>px;
              height: &lt; %= height %&gt;px;
              top: &lt; %= buffer %&gt;px;
              left: &lt; %= day * width + day * 10 %&gt;px;&quot;&gt;
      &lt; %= top %&gt;
    &lt;/div&gt;
&lt; % end %&gt;
&nbsp;
&lt;div id=&quot;vertical_spacer&quot; style=&quot;height: <span style="color:#006600; font-weight:bold;">&lt;%</span>= height<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">96</span> <span style="color:#006600; font-weight:bold;">+</span> buffer<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">-</span> cutmornings <span style="color:#006600; font-weight:bold;">%&gt;</span>px;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&nbsp;
&lt;/div&gt;</pre></td></tr></table></div>

<p><strong><em>Layout View</em></strong> (views/layouts/calendars.html.erb)</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">        <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span> form_tag <span style="color:#ff3333; font-weight:bold;">:controller</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'calendars'</span>, <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">nil</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
          <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span>= date_select<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;options&quot;</span>, <span style="color:#996600;">&quot;date&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@today</span>, <span style="color:#ff3333; font-weight:bold;">:order</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span>:<span style="color:#5A0A0A; font-weight:bold;">day</span>, :<span style="color:#5A0A0A; font-weight:bold;">month</span>, <span style="color:#ff3333; font-weight:bold;">:year</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
            <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span>= submit_tag <span style="color:#996600;">'Show'</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">' &amp;raquo;'</span>, :<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'date_button'</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
        <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p><strong><em>Helper (for coloring events)</em></strong> (app/helpers/calendar_helper.rb)</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="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> CalendarsHelper
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> eventcolor<span style="color:#006600; font-weight:bold;">&#40;</span>category<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">case</span> category  
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#996600;">'Wichtig'</span>   <span style="color:#008000; font-style:italic;"># This is the name of the .ics file</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'f66'</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#996600;">'Sonstiges'</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'4f4'</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#996600;">'Studium'</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'fb4'</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#996600;">'Privat'</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'77f'</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#996600;">'Freunde'</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'f4f'</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>  
        <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">'fb4'</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;">end</span></pre></td></tr></table></div>

<p><strong><em>Stylesheet</em></strong> (public/stylesheets/calendar.css)</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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**************** DIVs ***************************/</span>
&nbsp;
div<span style="color: #cc00cc;">#action</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #cc00cc;">#ical_day</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.otherday</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.sunday</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fdd</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.saturday</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddf</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#ical_event</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#555</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fb4</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#ical_event_top</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">9px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**************** Fonts ***************************/</span>
&nbsp;
<span style="color: #cc00cc;">#title</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ddd</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">11px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#title</span> <span style="color: #6666ff;">.description</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#777</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><strong><em>Routes (could be optional)</em></strong> (config/routes.rb)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="rails" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># CALENDAR Controllers</span>
  map.<span style="color:#9900CC;">connect</span> <span style="color:#996600;">'calendar'</span>, <span style="color:#ff3333; font-weight:bold;">:controller</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'calendars'</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2008/02/10/finally-railsicalendar-ical-ics-publish-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>cap deploy &#8220;permission denied&#8221; nach upgrade auf capistrano&#160;2.1</title>
		<link>http://funkensturm.de/2008/01/09/cap-deploy-permission-denied-nach-upgrade-auf-capistrano-21/</link>
		<comments>http://funkensturm.de/2008/01/09/cap-deploy-permission-denied-nach-upgrade-auf-capistrano-21/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 20:58:59 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[capistrano]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[permission denied]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2008/01/09/cap-deploy-permission-denied-nach-upgrade-auf-capistrano-21/</guid>
		<description><![CDATA[Hier habe ich endlich gefunden wieso aus heiterem Himmel bei einem cap deploy mit ssh und svn (und public key authentication) immer folgender Fehler auftrat: In die /config/deploy.rb muss folgende Option mit aufgenommen werden: Wenn ihr wissen wollt wieso, müsst ihr im original Beitrag nachschauen. Es hat mit den Rechten bei der shell zu tun [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://groups.google.com/group/capistrano/browse_thread/thread/13b029f75b61c09d" onclick="pageTracker._trackPageview('/outgoing/groups.google.com/group/capistrano/browse_thread/thread/13b029f75b61c09d?referer=');">Hier</a> habe ich endlich gefunden wieso aus heiterem Himmel bei einem <b>cap deploy</b> mit ssh und svn (und public key authentication) immer folgender Fehler auftrat:</p>
<p> ** [err] Permission denied, please try again.<br />
 ** [err] Permission denied, please try again.<br />
 ** [err] Permission denied (publickey,password).<br />
 ** [err] svn: Netzwerkverbindung wurde unerwartet geschlossen</p>
<p>In die <i>/config/deploy.rb</i> muss folgende Option mit aufgenommen werden:</p>
<p>   default_run_options[:pty] = true</p>
<p>Wenn ihr wissen wollt wieso, müsst ihr im <a href="http://groups.google.com/group/capistrano/browse_thread/thread/13b029f75b61c09d" onclick="pageTracker._trackPageview('/outgoing/groups.google.com/group/capistrano/browse_thread/thread/13b029f75b61c09d?referer=');">original Beitrag</a> nachschauen. Es hat mit den Rechten bei der shell zu tun und jetzt werden auch die user profile auf dem server vorher geladen.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2008/01/09/cap-deploy-permission-denied-nach-upgrade-auf-capistrano-21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gem1.8 install mysql (MySql Ruby C bindings) in&#160;debian</title>
		<link>http://funkensturm.de/2008/01/03/gem18-install-mysql-mysql-ruby-c-bindings-in-debian/</link>
		<comments>http://funkensturm.de/2008/01/03/gem18-install-mysql-mysql-ruby-c-bindings-in-debian/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 17:01:38 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[c bindings]]></category>
		<category><![CDATA[gem install mysql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2008/01/03/gem18-install-mysql-mysql-ruby-c-bindings-in-debian/</guid>
		<description><![CDATA[Hier habe ich endlich gefunden, wieso genau die C Bindings für mysql nicht geklappt haben. Es fehlte noch ein apt Paket vorher (bzw. ich benutze aptitude). Hier lag des Rätsels Lösung: Und erst dann hat man die mysql_config wie folgt zur Hand: Wie gesagt, &#8220;aptitude&#8221; muss für den ein oder anderen &#8220;apt get&#8221; sein und [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.slashdotdash.net/articles/2007/02/17/install-mysql-ruby-c-bindings-on-debian" onclick="pageTracker._trackPageview('/outgoing/www.slashdotdash.net/articles/2007/02/17/install-mysql-ruby-c-bindings-on-debian?referer=');">Hier</a> habe ich endlich gefunden, wieso genau die C Bindings für mysql nicht geklappt haben. Es fehlte noch ein apt Paket vorher (bzw. ich benutze aptitude).</p>
<p>Hier lag des Rätsels Lösung:</p>
<p>aptitude install libmysqlclient15-dev</p>
<p>Und erst dann hat man die mysql_config wie folgt zur Hand:</p>
<p>gem1.8 install mysql &#8212; &#8211;with-mysql-config=/usr/bin/mysql_config</p>
<p>Wie gesagt, &#8220;aptitude&#8221; muss für den ein oder anderen &#8220;apt get&#8221; sein und wenn man nicht als root eingeloggt ist, kommt noch ein &#8220;sudo&#8221; vor jeden Befehl.</p>
<p><b>Hinweis:</b> Welches Paket man sich mit apt installieren muss (dieser Post muss ja nicht der aktuellste sein ;), kann man mit diesem Befehl herausfinden. Dann nimmt man einfach die neuste Version von dem oben genannten.</p>
<p>aptitude show libmysql</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2008/01/03/gem18-install-mysql-mysql-ruby-c-bindings-in-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sessions aufräumen &#8211; Stale Sessions Clean&#160;Up</title>
		<link>http://funkensturm.de/2007/12/28/sessions-aufraumen-stale-sessions-clean-up/</link>
		<comments>http://funkensturm.de/2007/12/28/sessions-aufraumen-stale-sessions-clean-up/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 02:48:28 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[advanced]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[stale session clean]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/12/28/sessions-aufraumen-stale-sessions-clean-up/</guid>
		<description><![CDATA[Wenn man den ganz normalen Session Handler von Rails benutzt, dann werden die Sessions unter tmp/sessions/ abgelegt. Rails räumt dieses Session Verzeichnis aber nicht selber auf. Das kann zu einem Problem werden, wenn man plötzlich tausende von Sessionfiles in diesem Verzeichnis findet. Erst einmal wird die Application dadurch langsamer und zum Zweiten kann es auch [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man den ganz normalen Session Handler von Rails benutzt, dann werden die Sessions unter tmp/sessions/ abgelegt. Rails räumt dieses Session Verzeichnis aber nicht selber auf. Das kann zu einem Problem werden, wenn man plötzlich tausende von Sessionfiles in diesem Verzeichnis findet. Erst einmal wird die Application dadurch langsamer und zum Zweiten kann es auch das File System des Servers belasten, wenn der nämlich plötzlich keine Nodes mehr machen kann.</p>
<p>Eine einfach Lösung für dieses Problem ist ein Cron Job der das Verzeichnis regelmäßig aufräumt und alle alten (stale) Sessions löscht.</p>
<p>Hierfür habe ich ein Shell Script geschrieben, was ich in den Script Ordner meines Rails Projektes abgelegt habe. So sieht es aus:<br />
<tt>script/remove_stale_sessions.sh</tt></p>
<p>#!/bin/sh<br />
find ../tmp/sessions/ruby_sess.* -mtime +1 -print | xargs rm -rf</p>
<p>Das Script löscht alle Sessions die seit 1 Tag nicht mehr benutzt wurden. Jetzt fehlt noch der Cron Job, der das Script alle paar Minuten aufruft. Ich hab ihn mal auf alle 10 Minuten gestellt. Mit crontab -e ruft man den Cron Job Manager auf. Jetzt i drücken, damit man in den INSERT Mode kommt und in die letzte Zeile folgenden Code schreiben:</p>
<p>*/10 * * * * sh /pfad/zur/app/script/remove_stale_sessions.sh</p>
<p>esc drücken um den INSERT Mode zu verlassen und :wq zum speichern und schon sollte der neue Cron installiert sein.</p>
<p><strong>Update:</strong><br />
Ach so&#8230; vielleicht sollte man dafür gleich nen Deployment Task oder so was schreiben&#8230; irgendwas, damit man halt nicht bei jedem Projekt dran denken muss&#8230; wenn jemand Vorschläge hat&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/12/28/sessions-aufraumen-stale-sessions-clean-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Localization Plugin: Improved&#160;generate_l10n_file</title>
		<link>http://funkensturm.de/2007/12/24/improved-generate_l10n_file/</link>
		<comments>http://funkensturm.de/2007/12/24/improved-generate_l10n_file/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 12:38:43 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[l14n]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[localize]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/12/24/improved-generate_l10n_file/</guid>
		<description><![CDATA[Das Localization Plugin hat eine Methode generate_l10n_file um die zu lokalisierenden Strings auszulesen. Leider macht sie dies nicht besonders gut. Auf die Schnelle habe ich sie etwas abgeändert und siehe da: def self.generate_l10n_file &#34;Localization.define('de') do &#124;l&#124;&#34; &#60; &#60; Dir.glob(&#34;#{RAILS_ROOT}/app/**/*.*&#34;).collect do &#124;f&#124; [&#34;# #{f}&#34;] &#60;&#60; File.read(f).scan(/(&#60;%=_ &#124;_\&#40;&#41;&#91;\&#34;\'](.*?)[\&#34;\']/) end.uniq.flatten.collect do &#124;g&#124; g.starts_with?('#') ? &#34;&#34; : &#34; l.store [...]]]></description>
			<content:encoded><![CDATA[<p>Das <a href="http://dev.rubyonrails.org/browser/plugins/localization" onclick="pageTracker._trackPageview('/outgoing/dev.rubyonrails.org/browser/plugins/localization?referer=');">Localization Plugin</a> hat eine Methode generate_l10n_file um die zu lokalisierenden Strings auszulesen. Leider macht sie dies nicht besonders gut.</p>
<p>Auf die Schnelle habe ich sie etwas abgeändert und siehe da:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">def self.generate_l10n_file
  &quot;Localization.define('de') do |l|&quot; &lt; &lt;
  Dir.glob(&quot;#{RAILS_ROOT}/app/**/*.*&quot;).collect do |f| 
    [&quot;# #{f}&quot;] &lt;&lt; File.read(f).scan(/(<span style="color:#006600; font-weight:bold;">&lt;%</span>=_ <span style="color:#006600; font-weight:bold;">|</span>_\<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span>\<span style="color:#996600;">&quot;<span style="color:#000099;">\'</span>](.*?)[<span style="color:#000099;">\&quot;</span><span style="color:#000099;">\'</span>]/)
  end.uniq.flatten.collect do |g|
    g.starts_with?('#') ? &quot;</span><span style="color:#996600;">&quot; : &quot;</span>  l.<span style="color:#9900CC;">store</span> <span style="color:#996600;">'#{g}'</span>, <span style="color:#996600;">''</span><span style="color:#996600;">&quot;
  end.uniq.sort.join(&quot;</span>\n<span style="color:#996600;">&quot;).gsub(&quot;</span>  l.<span style="color:#9900CC;">store</span> <span style="color:#996600;">'_('</span>, <span style="color:#996600;">''</span><span style="color:#996600;">&quot;,'').gsub(&quot;</span>  l.<span style="color:#9900CC;">store</span> <span style="color:#996600;">'&lt;%=_ '</span>, <span style="color:#996600;">''</span><span style="color:#996600;">&quot;,'') &lt;&lt; &quot;</span>\nend<span style="color:#996600;">&quot;
end</span></pre></div></div>

<p>Jetzt werden sämtliche Controller ausgelesen und es werden deutlich mehr Strings gefunden (nämlich auch die wo nicht %= davor steht).</p>
<p>UPDATE: Zu &#8220;#{RAILS_ROOT}/app/**/*.*&#8221; müsste man noch &#8220;#{RAILS_ROOT}/app/views/**/*.*&#8221; irgendwie hinzunehmen.</p>
<p>Hier noch ein rake task dafür:
</pre>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">namespace <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:l10n</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    desc <span style="color:#996600;">'Verbose localization file (experimental)'</span>
    task <span style="color:#ff3333; font-weight:bold;">:generate</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'Creating localization file...'</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'----------- SNIP -----------'</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> Localization.<span style="color:#9900CC;">generate_l10n_file</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'----------- SNAP -----------'</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'Finished.'</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/12/24/improved-generate_l10n_file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Capistrano überschreibt meine Dateien&#160;immer!&#8221;</title>
		<link>http://funkensturm.de/2007/12/23/capistrano-uberschreibt-meine-dateien-immer/</link>
		<comments>http://funkensturm.de/2007/12/23/capistrano-uberschreibt-meine-dateien-immer/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 21:16:02 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[capistrano]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[syslink]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/12/23/capistrano-uberschreibt-meine-dateien-immer/</guid>
		<description><![CDATA[Wer seit Neuestem mit Capistrano seine rails app deployed, der kam vielleicht auch schon dahinter, dass dann alle Dateien weg sind, die man in ein bestimmtes Verzeichnis geschrieben oder hochgeladen hat. &#8220;meinprojekt&#8221; ist im Folgenden das Verzeichnis auf dem Server, wohin deployed wurde. Standardmäßig ist das glaube ich /u/apps/meinprojekt. Also zum Beispiel meinprojekt/public/uploads wird nach [...]]]></description>
			<content:encoded><![CDATA[<p>Wer seit Neuestem mit Capistrano seine rails app deployed, der kam vielleicht auch schon dahinter, dass dann alle Dateien weg sind, die man in ein bestimmtes Verzeichnis geschrieben oder hochgeladen hat.</p>
<p>&#8220;meinprojekt&#8221; ist im Folgenden das Verzeichnis auf dem Server, wohin deployed wurde. Standardmäßig ist das glaube ich <tt>/u/apps/meinprojekt</tt>.</p>
<p>Also zum Beispiel <tt>meinprojekt/public/uploads</tt> wird nach dem deploy einfach gelöscht und alle Dateien sind weg (nicht wirklich weg, man muss nur im Verzeichnis <tt>meinprojekt/releases</tt> danach suchen ;).</p>
<p>Um das zu verhindern (<a href="http://blog.vixiom.com/2007/03/13/stop-uploaded-files-getting-deleted-with-capistrano/" onclick="pageTracker._trackPageview('/outgoing/blog.vixiom.com/2007/03/13/stop-uploaded-files-getting-deleted-with-capistrano/?referer=');">hier gefunden</a>) muss man im <tt>meinprojekt/shared</tt> Verzeichnis auf dem Server wo man es deployed hat die Verzeichnisse erstellen, die solche wichtigen Sachen enthalten.</p>
<p>Also z. B. <tt>mkdir meinprojekt/shared/public/uploads</tt>. Anschließend passt man seine deploy.rb wie folgt an:</p>
<p>task :after_update_code, :roles => :app do<br />
  run &#8220;ln -nfs #{deploy_to}/shared/public/uploads #{release_path}/public/uploads&#8221;<br />
end</p>
<p>Dadurch wird nachdem der Code deployed (also hochgeladen) wurde, ein Hardlink von dem deployten uploads-Verzeichnis auf <tt>/u/apps/meinprojekt/shared/public/uploads</tt> gemacht. Also sozusagen ein weiterverweisen auf das shared Verzeichnis.</p>
<p>Immer wenn jetzt jemand was hochläd, wird es in shared gespeichert, anstatt in current. Beim nächsten Deploy wird der Link wieder auf shared gesetzt und keine Daten gehen verloren.</p>
<p>Hier mal ein Beispiel für meine Gallery:</p>
<p>namespace :deploy do<br />
   [task :start...]<br />
   after &#8220;deploy:update_code&#8221;, :link_to_shared<br />
end</p>
<p># Create hard links to data in shared<br />
desc &#8220;Link in critical data&#8221;<br />
task :link_to_shared do<br />
  run &#8220;ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml&#8221;<br />
  run &#8220;ln -nfs #{deploy_to}/shared/backup #{release_path}/backup&#8221;<br />
  run &#8220;ln -nfs #{deploy_to}/shared/private #{release_path}/private&#8221;<br />
  run &#8220;ln -nfs #{deploy_to}/shared/public/images/gallery #{release_path}/public/images/gallery&#8221;<br />
  run &#8220;ln -nfs #{deploy_to}/shared/public/images/pending #{release_path}/public/images/pending&#8221;<br />
end</p>
<p>Super. Danke Capistrano 2, dass du das kannst :)</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/12/23/capistrano-uberschreibt-meine-dateien-immer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin: acts_as_list_in_tree und descendants in&#160;acts_as_tree</title>
		<link>http://funkensturm.de/2007/12/15/acts_as_list_in_tree-und-descendants-in-acts_as_tree/</link>
		<comments>http://funkensturm.de/2007/12/15/acts_as_list_in_tree-und-descendants-in-acts_as_tree/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 11:38:54 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails 2.0]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[acts_as_tree]]></category>
		<category><![CDATA[act_as_list_in_tree]]></category>
		<category><![CDATA[descendants]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/12/15/acts_as_list_in_tree-und-descendants-in-acts_as_tree/</guid>
		<description><![CDATA[Ich habe eine Kategorienliste mit Unterkategorien. Nun möchte ich acts_as_list verwenden, um die Reihenfolge mit den Feld &#8220;position&#8221; leichter ändern zu können. Das geht auch soweit (Dann hat man so tolle Funktionen wie Category.move_higher). Leider gibt es da aber immer wieder Probleme, da eine neu hinzugefügte Kategorie die Position max(alle_positionen)+1 erhält. Also die höchste ALLER [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe eine Kategorienliste mit Unterkategorien. Nun möchte ich acts_as_list verwenden, um die Reihenfolge mit den Feld &#8220;position&#8221; leichter ändern zu können. Das geht auch soweit (Dann hat man so tolle Funktionen wie Category.move_higher).</p>
<p>Leider gibt es da aber immer wieder Probleme, da eine neu hinzugefügte Kategorie die Position max(alle_positionen)+1 erhält. Also die höchste ALLER Positionen +1. Ich möchte aber, dass eine neu hinzugefügte Kategorie die position+1 bezogen auf seine Vaterkategorie erhält!</p>
<p>Also sich als Liste verhält, aber nur in Bezug auf seine Geschwister!</p>
<p>Dafür muss man das Plugin (Rails 2.0) &#8220;acts_as_list&#8221; ändern. Und zwar muss man die Zeile 64, auskommentieren:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">##{scope_condition_method}</span></pre></div></div>

<p>Und die Funktion scope_condition() in Zeile 186 wie folgt ändern:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Overwrite this method to define the scope of the list changes</span>
<span style="color:#008000; font-style:italic;">#def scope_condition() &quot;1&quot; end</span>
<span style="color:#9966CC; font-weight:bold;">def</span> scope_condition<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#996600;">&quot;parent_id = #{self.parent_id}&quot;</span> <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>So habe ich mir mein eigenes <a href='http://blog.funkensturm.de/wp-content/uploads/2007/12/acts_as_list_in_tree.zip' title='acts_as_list_in_tree.zip'>acts_as_list_in_tree (download)</a> Plugin gebaut.</p>
<p>Vielleicht noch als Anmerkung:<br />
In acts_as_tree gibt es KEINE DESCENDANTS Funktion! Das heißt, man kann sich in einem Tree nicht die Nachkommen ausgeben lassen. Die Vorfahren schon, mit .ancestors, aber halt nicht die Nachkommen.</p>
<p>Siehe da <a href="http://dev.rubyonrails.org/ticket/8345" target='_blank' onclick="pageTracker._trackPageview('/outgoing/dev.rubyonrails.org/ticket/8345?referer=');">HIER</a> habe ich die Lösung gefunden. Ich hatte nur gehofft, sie sei in Rails 2.0 schon implementiert, ist sie aber nicht!</p>
<p>Also selber hinzufügen (am besten unter die ancestors funktion) in<br />
/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Bugfix - Returns list of descendants</span>
<span style="color:#9966CC; font-weight:bold;">def</span> descendants 
  descendants = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> 
  <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">children</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>child<span style="color:#006600; font-weight:bold;">|</span> descendants <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006600; font-weight:bold;">&#91;</span>child<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> child.<span style="color:#9900CC;">descendants</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">children</span>.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">0</span> 
  descendants
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Wenn es in Rails 2.x übernommen wird, kann man es wieder löschen ;)</p>
<p>Das war&#8217;s für heute :)</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/12/15/acts_as_list_in_tree-und-descendants-in-acts_as_tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BasicAuth + ProxyPath (Apache +&#160;Mongrel)</title>
		<link>http://funkensturm.de/2007/11/30/basicauth-proxypath-apache-mongrel/</link>
		<comments>http://funkensturm.de/2007/11/30/basicauth-proxypath-apache-mongrel/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 00:50:04 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[advanced]]></category>
		<category><![CDATA[rails 2.0]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[basic auth]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[proxypath]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/11/30/basicauth-proxypath-apache-mongrel/</guid>
		<description><![CDATA[Ich bin gerade dabei ein Rails Projekt mit Apache und Mongrel zum laufen zu bringen. Das ganze soll aber erst mal hinter nem htaccess Passwort Schutz sein. Ich hab nun Ewigkeiten gesucht um das hin zu bekommen, denn wenn ich es einfach in die .htaccess im public Verzeichnis meines Rails Projektes ablege, geht es natürlich [...]]]></description>
			<content:encoded><![CDATA[<p>Ich bin gerade dabei ein Rails Projekt mit Apache und Mongrel zum laufen zu bringen.<br />
Das ganze soll aber erst mal hinter nem htaccess Passwort Schutz sein. Ich hab nun Ewigkeiten gesucht um das hin zu bekommen, denn wenn ich es einfach in die .htaccess im public Verzeichnis meines Rails Projektes ablege, geht es natürlich nicht, da die BasicAuth ja vom Apache gemacht wird und der hat die Anfrage ja schon an Mongrel übergeben&#8230;</p>
<p>Das ganze ist aber eigentlich recht einfach. Jetzt steht der BasicAuth Code im vhost drin und das sieht dann so aus:</p>
<p>&#60;proxy *&#62;<br />
AuthName &#8220;Nur mit Passwort&#8221;<br />
AuthType Basic<br />
AuthUserFile /pfad/zur/.htpasswd<br />
require valid-user<br />
&#60;/proxy&#62;</p>
<p>ProxyRequests Off<br />
ProxyPreserveHost On</p>
<p>ProxyPass / http://0.0.0.0:3000/<br />
ProxyPassReverse / http://0.0.0.0:3000/<br />
ErrorLog /pfad/zum/server.log</p>
<p>wichtig war die Direktive &#60;proxy *&#62; in der der BasicAuth Code stehen muss. Sonst wird es einfach ignoriert!</p>
<p><strong>Update:</strong><br />
Und so wird es dann in Rails 2.0 gemacht: <a href="http://railscasts.com/episodes/82" onclick="pageTracker._trackPageview('/outgoing/railscasts.com/episodes/82?referer=');">HTTP Basic Authentication</a></p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/11/30/basicauth-proxypath-apache-mongrel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: ImageMagick + RMagick via Macports für&#160;Tiger</title>
		<link>http://funkensturm.de/2007/11/12/howto-imagemagick-rmagick-via-macports-fur-tiger/</link>
		<comments>http://funkensturm.de/2007/11/12/howto-imagemagick-rmagick-via-macports-fur-tiger/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 09:46:20 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[tiger]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/11/12/howto-imagemagick-rmagick-via-macports-fur-tiger/</guid>
		<description><![CDATA[Nach dem ich nun auch RMagick für ein aktuelles Projekt brauchte, dachte ich ich nehm einfach die Anleitung von hier (ok steht ja schon im Posttitel ist für Leopard und nicht für Tiger) Das hat natürlich nicht funktioniert und mich min. 2 h gekostet. Deshalb hier die Anleitung für Mac OS X Tiger: Dauert ewig, [...]]]></description>
			<content:encoded><![CDATA[<p>Nach dem ich nun auch RMagick für ein aktuelles Projekt brauchte, dachte ich ich nehm einfach die Anleitung von <a href="http://nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os-x-leopard/" onclick="pageTracker._trackPageview('/outgoing/nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os-x-leopard/?referer=');">hier</a> (ok steht ja schon im Posttitel ist für Leopard und nicht für Tiger) Das hat natürlich nicht funktioniert und mich min. 2 h gekostet. Deshalb hier die Anleitung für Mac OS X Tiger:</p>
<p>Dauert ewig, für ImageMagick wird erst mal das ganze XFree86 Zeug und noch sonstige Sachen runter geladen. RMagick muss dann noch die ganzen Fonts einbinden, das dauert auch&#8230;</p>
<p><code><br />
sudo port install ImageMagick<br />
sudo port install libwmf<br />
sudo port install lcms<br />
sudo port install ghostscript<br />
sudo gem install rmagick -y<br />
</code></p>
<p>Das Problem war einfach, dass die 3 anderen Port-Installationen gefehlt haben. Ich glaub es lag eigentlich nur an der fehlenden ghostscript Installation.</p>
<p>Dank geht <a href="http://blog.labratz.net/articles/2006/10/10/really-truly-getting-imagemagick-rmagick-working-on-osx-from-source-without-using-macports-darwinports-or-fink" onclick="pageTracker._trackPageview('/outgoing/blog.labratz.net/articles/2006/10/10/really-truly-getting-imagemagick-rmagick-working-on-osx-from-source-without-using-macports-darwinports-or-fink?referer=');">hier</a> noch hin, da gab es die Lösung.</p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/11/12/howto-imagemagick-rmagick-via-macports-fur-tiger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Railscasts.com &#8211; die beste Ruby on Rails&#160;Resource</title>
		<link>http://funkensturm.de/2007/11/09/railscastscom-die-beste-ruby-on-rails-resource/</link>
		<comments>http://funkensturm.de/2007/11/09/railscastscom-die-beste-ruby-on-rails-resource/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 06:42:15 +0000</pubDate>
		<dc:creator>manuel</dc:creator>
				<category><![CDATA[introducing]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[railscast]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/11/09/railscastscom-die-beste-ruby-on-rails-resource/</guid>
		<description><![CDATA[Auch wenn es die meisten wohl schon kennen, die Screencasts von Ryan Bates, sind meiner Meinung nach, so ziemlich die beste Resource, was praktische Tipps mit Ruby on Rails angeht. Er spricht so ziemlich alle wichtigen Themen an und bietet auch für etwas erfahrenere Entwickler manch eine Idee. Also unbedingt anschauen, wer es noch nicht [...]]]></description>
			<content:encoded><![CDATA[<p>Auch wenn es die meisten wohl schon kennen, die Screencasts von Ryan Bates, sind meiner Meinung nach, so ziemlich die beste Resource, was praktische Tipps mit Ruby on Rails angeht. Er spricht so ziemlich alle wichtigen Themen an und bietet auch für etwas erfahrenere Entwickler manch eine Idee.<br />
Also unbedingt anschauen, wer es noch nicht kennt:<br />
<a href="http://railscasts.com" target="_blank" onclick="pageTracker._trackPageview('/outgoing/railscasts.com?referer=');">www.railscasts.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/11/09/railscastscom-die-beste-ruby-on-rails-resource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails with Leopard (localhost, sites, mysql,&#160;rmagick)</title>
		<link>http://funkensturm.de/2007/10/27/ruby-on-rails-with-leopard-localhost-sites-apache/</link>
		<comments>http://funkensturm.de/2007/10/27/ruby-on-rails-with-leopard-localhost-sites-apache/#comments</comments>
		<pubDate>Sat, 27 Oct 2007 08:38:11 +0000</pubDate>
		<dc:creator>Captain Future</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[introducing]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rmagick]]></category>

		<guid isPermaLink="false">http://blog.funkensturm.de/2007/10/27/ruby-on-rails-with-leopard-localhost-sites-apache/</guid>
		<description><![CDATA[Ich habe soeben 2 Minuten gebraucht, um intuitiv Rails in Leopard zum Laufen zu kriegen&#8230; Das möchte ich euch natürlich nicht vorenthalten. Du wechselst in das Verzeichnis deines Projektes. Und gibst den Befehl ruby script/server ein. Ergebnis: Fertig! &#8220;Mongrel available at 0.0.0.0:3000&#8243; verrät dir, wo du deine Webseite findest. Da &#8220;0.0.0.0&#8243; das gleiche ist wie [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe soeben 2 Minuten gebraucht, um intuitiv Rails in Leopard zum Laufen zu kriegen&#8230;</p>
<p>Das möchte ich euch natürlich nicht vorenthalten.</p>
<p>Du wechselst in das Verzeichnis deines Projektes.</p>
<p><img src='http://blog.funkensturm.de/wp-content/uploads/2009/10/bild-5.png' alt='bild-5.png' /></p>
<p>Und gibst den Befehl <b>ruby script/server</b> ein.</p>
<p><img src='http://blog.funkensturm.de/wp-content/uploads/2009/10/bild-6.png' alt='bild-6.png' /></p>
<p>Ergebnis:</p>
<p><img src='http://blog.funkensturm.de/wp-content/uploads/2009/10/bild-7.png' alt='bild-7.png' /></p>
<p><b>Fertig!</b></p>
<p>&#8220;Mongrel available at 0.0.0.0:3000&#8243; verrät dir, wo du deine Webseite findest. Da &#8220;0.0.0.0&#8243; das gleiche ist wie &#8220;localhost&#8221;, findest du sie z. B. hier:</p>
<p><img src='http://blog.funkensturm.de/wp-content/uploads/2007/10/bild-8.png' alt='bild-8.png' /></p>
<p><b>Mist war das einfach :/</b></p>
<p><b>MySQL</b></p>
<p><a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg" onclick="pageTracker._trackPageview('/outgoing/dev.mysql.com/downloads/mysql/5.0.html_macosx-dmg?referer=');">HIER</a> könnt ihr mysql runterladen. Kleiner Tip: Intel-Rechner brauchen &#8220;x86&#8243;. Mein PowerBook G4 hat <b>Mac OS X 10.4 (PowerPC, 32-bit)</b> gebraucht.</p>
<p>Package installieren, fertig. Vorsicht, momentan funktioniert das prefpane von mysql in den Systemeinstellungen für Leopard nicht. Das kann man beheben, indem man dem Verzeichnis <b>/usr/local/mysql/data</b> UND UNTERVERZEICHNISSEN Lese- und Schreibrechte für Administratoren (oder halt direkt dir selbst) hinzufügt. Wie geht das? Einen <a href="http://mac.sofotex.com/download-131931.html" onclick="pageTracker._trackPageview('/outgoing/mac.sofotex.com/download-131931.html?referer=');">invisibility toggler</a> runterladen und alle Dateien im Finder sichtbar machen. Auf das Verzeichnis ein &#8220;Apfel + i&#8221; machen und ganz unten die Reche entsprechend hinzufügen.</p>
<p>Nachdem ich jetzt zwei Tage versucht habe einen &#8220;sudo gem install mysql&#8221; durchzuführen, kam ich endlich auf die Lösung. (Danke an <a href="http://weblog.rubyonrails.org/2007/10/26/today-is-leopard-day" onclick="pageTracker._trackPageview('/outgoing/weblog.rubyonrails.org/2007/10/26/today-is-leopard-day?referer=');">rubyonrails.org</a> die schnell genug waren. <a href="http://trac.macosforge.org/projects/ruby/wiki/Troubleshooting#IcannotbuildrubymysqlonLeopardwithmysql.combinaries" onclick="pageTracker._trackPageview('/outgoing/trac.macosforge.org/projects/ruby/wiki/Troubleshooting_IcannotbuildrubymysqlonLeopardwithmysql.combinaries?referer=');">Hier</a> auch nochmal ausführlich.</p>
<p>Kurzum, folgenden langen Befehl im Terminal eingeben:</p>
<p>sudo env ARCHFLAGS=&quot;-arch ppc&quot; gem install mysql &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config</p>
<p>Dort wo &#8220;ppc&#8221; steht muss nicht ppc sondern <b>i386</b> heißen, <b>wenn</b> ihr einen Intel-Prozessor habt (MacBook usw.)</p>
<p><img src='http://blog.funkensturm.de/wp-content/uploads/2009/10/mysqlok.png' alt='mysqlok.png' /></p>
<p>Wenn ihr nur <b>sudo gem install mysql</b> oder <b>sudo gem install mysql &#8212; &#8211;with-mysql-dir=/usr/local/mysql</b> macht, dann kommt ein &#8220;can&#8217;t find ruby header&#8221; Fehler. Danach habe ich gegoogled ohne Ende und nichts gefunden.</p>
<p>Übrigens kann nun ein <b>sudo gem update rails</b> nicht schaden, das updated ein paar gem versionen.</p>
<p>Wie man mit MacPort <b>RMagick</b> installiert, ist <a href="http://nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os-x-leopard/" onclick="pageTracker._trackPageview('/outgoing/nullstyle.com/2007/10/27/how-to-build-imagemagick-and-install-rmagick-with-macports-on-mac-os-x-leopard/?referer=');">hier</a> schön beschrieben.</p>
<p><b>Fertig!</b></p>
]]></content:encoded>
			<wfw:commentRss>http://funkensturm.de/2007/10/27/ruby-on-rails-with-leopard-localhost-sites-apache/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
