<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Luca Guidi - Home</title>
  <id>tag:www.lucaguidi.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://www.lucaguidi.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.lucaguidi.com/" rel="alternate" type="text/html"/>
  <updated>2008-08-29T09:50:02Z</updated>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-08-29:380</id>
    <published>2008-08-29T09:37:00Z</published>
    <updated>2008-08-29T09:50:02Z</updated>
    <category term="Ruby"/>
    <category term="Ruby on Rails"/>
    <category term="&quot;ruby on rails&quot;"/>
    <category term="activerecord"/>
    <category term="cache"/>
    <category term="caching"/>
    <category term="marshaling"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="time"/>
    <link href="http://www.lucaguidi.com/2008/8/29/ruby-time-marshaling-bug-in-pre-1-9" rel="alternate" type="text/html"/>
    <title>Ruby Time marshaling bug in pre-1.9</title>
<content type="html">
            &lt;p&gt;
  Ruby's &lt;strong&gt;&lt;code&gt;Time&lt;/code&gt;&lt;/strong&gt; has a bug: when try to serialize an timezoned time, then unserialize it back, the result will use the server local time, instead of use the original time zone.&lt;br /&gt;&lt;br /&gt;
&lt;code&gt;
&gt;&gt; utc = Time.now.utc&lt;br /&gt;
=&gt; Fri Aug 29 09:07:37 UTC 2008&lt;br /&gt;
&gt;&gt; marshaled = Marshal.dump utc&lt;br /&gt;
=&gt; &quot;\004\bu:\tTime\r\251\037\e\200\344\254T\036&quot;&lt;br /&gt;
&gt;&gt; Marshal.load marshaled&lt;br /&gt;
=&gt; Fri Aug 29 11:07:37 +0200 2008&lt;br /&gt;
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
This bug &lt;a href=&quot;http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9#l158&quot; title=&quot;Timezone information preserved on Marshal.dump/load&quot;&gt;doesn't affects Ruby 1.9&lt;/a&gt;, but we still don't use that version for production purpose. If you use 1.8.x with Rails 2.1.0, your cached timestamps (including ActiveRecord objects), are probably wrong.&lt;br /&gt;&lt;br /&gt;

&lt;code&gt;
&gt;&gt; comment = Comment.first&lt;br /&gt;
=&gt; #&amp;lt;Comment id: 865423346, post_id: 1, text: &quot;Nice post.&quot;, created_at: &quot;2008-08-29 09:27:48&quot;, updated_at: &quot;2008-08-29 09:27:48&quot;&amp;gt;&lt;br /&gt;
&gt;&gt; Rails.cache.write('comment', comment)&lt;br /&gt;
=&gt; true&lt;br /&gt;
&gt;&gt; Rails.cache.read('comment')&lt;br /&gt;&lt;br /&gt;
=&gt; #&amp;lt;Comment id: 865423346, post_id: 1, text: &quot;Nice post.&quot;, created_at: &quot;2008-08-29 09:27:48&quot;, updated_at: &quot;2008-08-29 09:27:48&quot;&amp;gt;&lt;br /&gt;
&gt;&gt; comment.update_attributes :text =&gt; &quot;Nice post!&quot;&lt;br /&gt;
=&gt; true&lt;br /&gt;
&gt;&gt; Rails.cache.write('comment', comment)&lt;br /&gt;
=&gt; true&lt;br /&gt;
&gt;&gt; Rails.cache.read('comment')&lt;br /&gt;
=&gt; #&amp;lt;Comment id: 865423346, post_id: 1, text: &quot;Nice post!&quot;, created_at: &quot;2008-08-29 09:27:48&quot;, updated_at: &quot;2008-08-29 11:28:42&quot;&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;
Look at the last &lt;code&gt;updated_at&lt;/code&gt; attribute, it uses local time instead of UTC time zone.&lt;br /&gt;
The first time everything goes right, because &lt;code&gt;#updated_at&lt;/code&gt; wasn't invoked and casted to a Time instance. It's a string, and the marshaling is ok.&lt;br /&gt;
But, when I update the object, ActiveRecord changes the value of that timestamp, but before, it cast it to a Time, and everything goes wrong.
&lt;/p&gt;

&lt;p&gt;
I submitted a patch for this bug, &lt;a href=&quot;http://github.com/rails/rails/commit/4d71e99d1fc1f57900288e008d7528c339138cf0&quot;&gt;it was committed&lt;/a&gt;, and will be available in the upcoming Rails 2.2.
You are strongly encouraged to update your Rails version.
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-08-08:302</id>
    <published>2008-08-08T19:53:00Z</published>
    <updated>2008-08-08T19:56:23Z</updated>
    <category term="Web"/>
    <category term="humor"/>
    <category term="twitter"/>
    <category term="video"/>
    <category term="web"/>
    <link href="http://www.lucaguidi.com/2008/8/8/twitter-is-down" rel="alternate" type="text/html"/>
    <title>Twitter Is Down</title>
<content type="html">
            &lt;p&gt;&amp;lt;embed src=&quot;http://blip.tv/play/ih_F3GmJ5FQ&quot; height=&quot;335&quot; width=&quot;540&quot;&gt;&amp;lt;/embed&gt;&lt;br /&gt;
via [&lt;a href=&quot;http://www.crunchgear.com/2008/08/08/twitter-is-down-again-mein-fuhrer/&quot;&gt;TechCrunch&lt;/a&gt;]
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-08-06:301</id>
    <published>2008-08-06T23:53:00Z</published>
    <updated>2008-08-06T23:57:37Z</updated>
    <category term="Productivity"/>
    <category term="aphorism"/>
    <category term="citation"/>
    <category term="ferriss"/>
    <category term="laziness"/>
    <category term="less"/>
    <category term="productivity"/>
    <link href="http://www.lucaguidi.com/2008/8/6/less-is-not-laziness" rel="alternate" type="text/html"/>
    <title>Less Is Not Laziness</title>
<content type="html">
            &lt;p&gt;&lt;cite&gt;Doing less meaningless work, so that you can focus on things of greater personal importance, is NOT laziness. This is hard for most to accept, because our culture tends to reward personal sacrifice instead of personal productivity.&lt;/cite&gt;&lt;br /&gt;
&lt;em&gt;--Timothy Ferris&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-07-21:298</id>
    <published>2008-07-21T09:59:00Z</published>
    <updated>2008-08-24T09:00:02Z</updated>
    <category term="Ruby on Rails"/>
    <category term="announcements"/>
    <category term="click_to_globalize"/>
    <category term="globalize"/>
    <category term="i18n"/>
    <category term="l10n"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="rails2.1"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <link href="http://www.lucaguidi.com/2008/7/21/click-to-globalize-ready-for-rails-2-1" rel="alternate" type="text/html"/>
    <title>Click To Globalize: Ready for Rails 2.1!</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://lucaguidi.com/pages/click-to-globalize&quot;&gt;Click to Globalize&lt;/a&gt; is ready for &lt;strong&gt;Rails 2.1&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;
  I spent a lot of time to make this release the best of ever! I know that a lot of time has passed since the latest Rails major release, and I apologize for this.&lt;br /&gt;
  The official &lt;a href=&quot;http://www.globalize-rails.org/&quot; title=&quot;Globalize for Ruby on Rails&quot;&gt;Globalize&lt;/a&gt; it seems dead, but the great work of &lt;a href=&quot;http://nateclark.com/&quot;&gt;Nate Clark&lt;/a&gt; (&lt;em&gt;aka heythisisnate&lt;/em&gt;) has made it &lt;a href=&quot;http://github.com/heythisisnate/globalize/tree&quot; title=&quot;heythisisnate's Globalize at GitHub&quot;&gt;compatible with Rails 2.1&lt;/a&gt;. Thanks Nate!&lt;br /&gt;
  The &lt;a href=&quot;http://lucaguidi.com/2008/7/18/what-s-new-in-rails-edge-i18n&quot; title=&quot;What's New In Rails Edge: i18n&quot;&gt;Rails Edge now includes&lt;/a&gt; a basic support for i18n!
&lt;/p&gt;

&lt;h2&gt;What's Changed?&lt;/h2&gt;
&lt;p&gt;
  The first big change is about the configuration, past versions has cluttered a bit your &lt;code&gt;ApplicationController&lt;/code&gt;, I know, but now Click uses a &lt;a href=&quot;http://www.yaml.org&quot;&gt;YAML&lt;/a&gt; file configuration file for locales.&lt;br /&gt;
&lt;br /&gt;
As you can see, it's more readable than put an &lt;code&gt;Hash&lt;/code&gt; inside your main controller, and it also take the advantage to separate configuration from logic.
&lt;/p&gt;

&lt;p&gt;
  The second change regards the default language, you can use the above file to declare it, or use the Globalize syntax (&lt;code&gt;Globalize::Locale.set_base_language('en-US')&lt;/code&gt;), but you have to choose a locale &lt;strong&gt;before&lt;/strong&gt; the app starts.&lt;br /&gt;
  This because Click needs a secure fallback mechanism, if no active &lt;code&gt;Locale&lt;/code&gt; was set, it's always guarantees your application to work.
&lt;/p&gt;

&lt;p&gt;The third feature is about formatting: you can always choose between &lt;strong&gt;textile&lt;/strong&gt; and &lt;strong&gt;markdown&lt;/strong&gt; without editing &lt;code&gt;ApplicationController&lt;/code&gt;, but using the same configuration file.&lt;/p&gt;

&lt;p&gt;
  I removed the deprecated class method &lt;code&gt;ApplicationController#globalize?&lt;/code&gt; in favor of the instance one.
  This means you can use it to turn on/off Click to Globalize, just returning a boolean value:
  
&lt;/p&gt;

&lt;p&gt;This version also includes tiny fixes, refactoring and cleanup.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

&lt;p&gt;
  You may wish to learn a bit about Click to Globalize, so I encourage you to visit the &lt;a href=&quot;http://lucaguidi.com/pages/click-to-globalize&quot;&gt;official page&lt;/a&gt;. &lt;br /&gt;
  I hope you enjoy your &lt;strong&gt;i18n on Rails&lt;/strong&gt;!
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-07-18:293</id>
    <published>2008-07-18T09:24:00Z</published>
    <updated>2008-07-19T09:20:22Z</updated>
    <category term="Ruby on Rails"/>
    <category term="actionpack"/>
    <category term="activerecord"/>
    <category term="activesupport"/>
    <category term="edge"/>
    <category term="i18n"/>
    <category term="internationalization"/>
    <category term="l10n"/>
    <category term="localization"/>
    <category term="rails"/>
    <category term="ruby on rails"/>
    <category term="what's new"/>
    <link href="http://www.lucaguidi.com/2008/7/18/what-s-new-in-rails-edge-i18n" rel="alternate" type="text/html"/>
    <title>What's New In Rails Edge: i18n</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://rubyonrails.org&quot;&gt;Ruby on Rails&lt;/a&gt; has just integrated a basic support for &lt;strong&gt;i18n&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;ActiveSupport&lt;/h2&gt;
&lt;p&gt;
  &lt;strong&gt;ActiveSupport&lt;/strong&gt; now includes the &lt;a href=&quot;http://github.com/svenfuchs/i18n/tree/master&quot;&gt;i18n gem&lt;/a&gt; which provides the API and the settings for the default locale: &lt;strong&gt;en-US&lt;/strong&gt;.&lt;br /&gt;
  The gem abstracts the repository where the translations are stored, so all the plugin authors could write their own mechanism. The bundled repository is called &lt;code&gt;Simple&lt;/code&gt; and stores all the settings in memory.
&lt;/p&gt;
&lt;p&gt;
  Declaring a locale is quite easy:&lt;br /&gt;
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;I18n.backend.store_translations :'it-IT', {
  :support =&amp;gt; {
    :array =&amp;gt; {
      :sentence_connector =&amp;gt; 'e'
    }
  },
  :date =&amp;gt; {
    :formats =&amp;gt; {
      :default =&amp;gt; &amp;quot;%d/%m/%Y&amp;quot;,
      :short =&amp;gt; &amp;quot;%d %b&amp;quot;,
      :long =&amp;gt; &amp;quot;%d %B %Y&amp;quot;,
    },
    :day_names =&amp;gt; %w(Luned&amp;amp;igrave; Marted&amp;amp;igrave; Mercoled&amp;amp;igrave; Gioved&amp;amp;igrave; Venerd&amp;amp;igrave; Sabato Domenica),
    :abbr_day_names =&amp;gt; %w(Lun Mar Mer Gio Ven Sab Dom),
    :month_names =&amp;gt; %w(Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre).unshift(nil),
    :abbr_month_names =&amp;gt; %w(Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic).unshift(nil),
    :order =&amp;gt; [:day, :month, :year]
  },
  :time =&amp;gt; {
    :formats =&amp;gt; {
      :default =&amp;gt; &amp;quot;%a, %d %b %Y %H:%M:%S %z&amp;quot;,
      :short =&amp;gt; &amp;quot;%d %b %H:%M&amp;quot;,
      :long =&amp;gt; &amp;quot;%B %d, %Y %H:%M&amp;quot;,
    },
    :am =&amp;gt; 'am',
    :pm =&amp;gt; 'pm'
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
  How can I translate or localize?&lt;br /&gt;
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;I18n.locale = 'it-IT'
I18n.t :hello   # =&amp;gt; Ciao
I18n.l Time.now # =&amp;gt; &amp;quot;Ven, 18 Lug 2008 10:58:14 +0200&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
  
  &lt;code&gt;I18n#t&lt;/code&gt; is also useful to fetch locale defaults:&lt;br /&gt;
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;I18n.t :'time.formats.short' # =&amp;gt; %d %b %H:%M&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;h2&gt;ActiveRecord&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;ActiveRecord&lt;/strong&gt; now returns localized error messages for validations.&lt;/p&gt;
&lt;p&gt;
  You may wish to declare your messages:&lt;br /&gt;
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;I18n.backend.store_translations :'it-IT', {
  :active_record =&amp;gt; {
    :error_messages =&amp;gt; {
      :inclusion =&amp;gt; &amp;quot;non &amp;amp;egrave; incluso nella lista&amp;quot;
      # ...
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;h2&gt;ActionPack&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;ActionView&lt;/strong&gt; now supports translations and localization for time and currency helpers (i.e. &lt;code&gt;distance_of_time_in_words&lt;/code&gt;, &lt;code&gt;number_to_currency&lt;/code&gt;).&lt;/p&gt;&lt;br /&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2008-07-19&lt;/strong&gt;: &lt;a href=&quot;http://www.artweb-design.de&quot;&gt;Sven Fuchs&lt;/a&gt; wrote a &lt;a href=&quot;http://www.artweb-design.de/2008/7/18/finally-ruby-on-rails-gets-internationalized&quot; title=&quot;Finally. Ruby on Rails gets internationalized&quot;&gt;i18n Rails manifesto&lt;/a&gt; and a &lt;a href=&quot;http://www.artweb-design.de/2008/7/18/the-ruby-on-rails-i18n-core-api&quot; title=&quot;The Ruby on Rails I18n core api&quot;&gt;technical post&lt;/a&gt; about the &lt;strong&gt;i18n API&lt;/strong&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-07-14:292</id>
    <published>2008-07-14T10:46:00Z</published>
    <updated>2008-07-14T10:47:47Z</updated>
    <category term="Ruby"/>
    <category term="annoucements"/>
    <category term="gem"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="repository"/>
    <category term="ror"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sashimi"/>
    <link href="http://www.lucaguidi.com/2008/7/14/sashimi-0-2-0" rel="alternate" type="text/html"/>
    <title>Sashimi 0.2.0!</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot;&gt;Sashimi&lt;/a&gt; has just hit &lt;a href=&quot;http://github.com/jodosha/sashimi/commits/v0.2.0&quot;&gt;0.2.0&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;This release has no sugar for you! No new features, just test improvements and code robustness.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-06-30:289</id>
    <published>2008-06-30T09:02:00Z</published>
    <updated>2008-06-30T13:07:10Z</updated>
    <category term="Ruby"/>
    <category term="gem"/>
    <category term="getting started"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="repository"/>
    <category term="ror"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sashimi"/>
    <category term="tutorial"/>
    <category term="video"/>
    <link href="http://www.lucaguidi.com/2008/6/30/sashimi-getting-started-tutorial" rel="alternate" type="text/html"/>
    <title>Sashimi: Getting Started Tutorial</title>
<content type="html">
            &lt;p&gt;
  Here a &lt;strong&gt;getting started&lt;/strong&gt; tutorial for &lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot; title=&quot;Sashimi&quot;&gt;Sashimi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;.
  &lt;a href=&quot;http://lucaguidi.com/assets/2008/6/30/sashimi_getting_started.mov&quot; title=&quot;Sashimi getting started&quot;&gt;&lt;img src=&quot;http://lucaguidi.com/assets/2008/6/30/sashimi_getting_started.png&quot; height=&quot;450px&quot; alt=&quot;Sashimi getting started tutorial&quot; width=&quot;600px&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-06-23:285</id>
    <published>2008-06-23T13:58:00Z</published>
    <updated>2008-06-23T18:19:55Z</updated>
    <category term="Ruby"/>
    <category term="gem"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="repository"/>
    <category term="ror"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sashimi"/>
    <link href="http://www.lucaguidi.com/2008/6/23/released-sashimi-0-1-6" rel="alternate" type="text/html"/>
    <title>Released Sashimi 0.1.6</title>
<content type="html">
            &lt;p&gt;
I just released a &lt;strong&gt;new version&lt;/strong&gt; of Sashimi, with tiny fixes and a new home! In fact the project is also hosted on &lt;strong&gt;RubyForge&lt;/strong&gt;, now you can install the gem with:
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ (sudo) gem install sashimi&lt;/code&gt;&lt;/pre&gt;
or with:
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ (sudo) gem install jodosha-sashimi --source=http://gems.github.com&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;If you wish, you can visit the project pages on &lt;a href=&quot;http://github.com/jodosha/sashimi&quot; title=&quot;GitHub Sashimi page&quot;&gt;GitHub&lt;/a&gt; and on &lt;a href=&quot;http://rubyforge.org/projects/sashimi/&quot; title=&quot;RubyForge Sashimi page&quot;&gt;RubyForge&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; The release 0.1.6 is &lt;strong&gt;broken&lt;/strong&gt;, you are strongly encouraged to update your gem with the newest &lt;strong&gt;0.1.7&lt;/strong&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-06-18:283</id>
    <published>2008-06-18T17:23:00Z</published>
    <updated>2008-08-24T08:59:56Z</updated>
    <category term="Annoucements"/>
    <category term="Ruby on Rails"/>
    <category term="2008"/>
    <category term="announcements"/>
    <category term="click_to_globalize"/>
    <category term="conf"/>
    <category term="conferences"/>
    <category term="europe"/>
    <category term="rails"/>
    <category term="railsconf"/>
    <category term="ror"/>
    <category term="rubyonrails"/>
    <link href="http://www.lucaguidi.com/2008/6/18/speaker-at-railsconf-europe-2008" rel="alternate" type="text/html"/>
    <title>Speaker at RailsConf Europe 2008</title>
<content type="html">
            &lt;p&gt;I'm proud to announce my presence as speaker at the &lt;a href=&quot;http://www.railsconfeurope.com/&quot;&gt;RailsConf Europe 2008&lt;/a&gt; with a speech on &lt;a href=&quot;http://lucaguidi.com/pages/click-to-globalize&quot;&gt;Click to Globalize&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-06-03:269</id>
    <published>2008-06-03T16:53:00Z</published>
    <updated>2008-06-04T09:55:32Z</updated>
    <category term="Ruby on Rails"/>
    <category term="fun"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sigle file app"/>
    <category term="snippets"/>
    <category term="tiny"/>
    <link href="http://www.lucaguidi.com/2008/6/3/rails-single-file-app" rel="alternate" type="text/html"/>
    <title>Rails: Single File App</title>
<content type="html">
            &lt;p&gt;I took inspiration from the &lt;a href=&quot;http://m.onkey.org/2008/2/16/single-file-rails-application&quot; title=&quot;Single File Rails Application&quot;&gt;Pratik Naik post&lt;/a&gt;, and realized a more simplistic version of its &lt;a href=&quot;http://rubyonrails.org&quot;&gt;Rails&lt;/a&gt; single file app. My implementation has only &lt;strong&gt;Rails&lt;/strong&gt; as unique dependency.

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;require 'rubygems'
require 'action_controller'
require 'webrick'
require 'webrick_server'

class HelloWorldController &amp;lt; ActionController::Base
  session :off
  def index; render :text =&amp;gt; 'Hello World!' end
end

ActionController::Routing::Routes.draw do |map|
  map.root :controller =&amp;gt; &amp;quot;hello_world&amp;quot;
end

DispatchServlet.dispatch :port =&amp;gt; 3000,
    :server_root  =&amp;gt; File.dirname(__FILE__)&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Update 2008-06-04&lt;/strong&gt;: I just wrote another version which also uses &lt;strong&gt;ActiveRecord&lt;/strong&gt; and a &lt;strong&gt;template&lt;/strong&gt;.
&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;require 'rubygems'
require 'activerecord'
require 'action_controller'
require 'webrick'
require 'webrick_server'

ActiveRecord::Base.establish_connection(
  :adapter  =&amp;gt; 'sqlite3',
  :database =&amp;gt; 'tiny_rails.sqlite3',
  :timeout  =&amp;gt; 5000)

ActiveRecord::Schema.define do
  create_table :people, :force =&amp;gt; true do |t|
    t.string :first_name
  end
end
class Person &amp;lt; ActiveRecord::Base; end
Person.create :first_name =&amp;gt; 'Luca'

File.open('index.html.erb', 'w') do |f|
  f &amp;lt;&amp;lt; &amp;quot;Hello, my name is &amp;lt;%=h @person.first_name %&amp;gt;!\n&amp;quot;
end

class HelloWorldController &amp;lt; ActionController::Base
  session :off
  def index
    @person = Person.find :first
    render :file =&amp;gt; 'index.html.erb'
  end
end

ActionController::Routing::Routes.draw do |map|
  map.root :controller =&amp;gt; &amp;quot;hello_world&amp;quot;
end

DispatchServlet.dispatch :port =&amp;gt; 3000,
    :server_root  =&amp;gt; File.dirname(__FILE__)&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Just start the script and point your browser at &lt;strong&gt;http://localhost:3000&lt;/strong&gt;!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-05-29:268</id>
    <published>2008-05-29T15:12:00Z</published>
    <updated>2008-07-06T10:44:32Z</updated>
    <category term="Ruby"/>
    <category term="class"/>
    <category term="dry"/>
    <category term="methods"/>
    <category term="proxy"/>
    <category term="ruby"/>
    <category term="snippets"/>
    <link href="http://www.lucaguidi.com/2008/5/29/ruby-class-methods-proxy" rel="alternate" type="text/html"/>
    <title>Ruby: Class Methods Proxy</title>
<content type="html">
            &lt;p&gt;
  Did you ever used class methods inside your instance methods? If yes, you probably noticed how &lt;strong&gt;frustrating&lt;/strong&gt; can be to use the &lt;code&gt;self.class.my_class_method&lt;/code&gt; syntax. A solution could be to create a private method which encapsulates the class one.
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;class Repository
  def self.path
    @@path
  end
  
  def print_path
    puts path
  end
  
  private
    def path
      self.class.path
    end
end&lt;/code&gt;&lt;/pre&gt;
  In the above example, &lt;code&gt;#print_path&lt;/code&gt; can print the &lt;code&gt;@@code&lt;/code&gt; value, without worrying about it's a class value, because we have wrapped it.
&lt;/p&gt;

&lt;p&gt;
  When I developed &lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot;&gt;Sashimi&lt;/a&gt; I've widely used this technique, with a bad impact on the code duplication, and in order to DRY-up my code I extended the Ruby's &lt;code&gt;Class&lt;/code&gt; class in this way:
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;class Class
  def class_method_proxy(*method_names)
    method_names.each do |m|
      self.class_eval %{
        # Proxy method for &amp;lt;tt&amp;gt;#{self.class.name}##{m}&amp;lt;/tt&amp;gt;
        def #{m}(*args, &amp;amp;block)
          self.class.#{m}(*args, &amp;amp;block)
        end
        private :#{m}
      }, __FILE__, __LINE__
    end
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
  This approach allow us to annotate our classes, choosing which class methods should be available as private methods.&lt;br /&gt;
  Now, our example class should look like the following:
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;class Repository
  def self.path
    @@path
  end
  class_method_proxy :path

  def print_path
    puts path
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
  Of course you can pass multiple symbols to proxy many methods at the same time.
  &lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;class_method_proxy :path, :another_path, :a_third_one&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2008-07-06:&lt;/strong&gt; I added the &lt;code&gt;&amp;block&lt;/code&gt; argument.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-05-28:265</id>
    <published>2008-05-28T16:58:00Z</published>
    <updated>2008-08-24T08:59:50Z</updated>
    <category term="Javascript"/>
    <category term="benchmark"/>
    <category term="comparision"/>
    <category term="javascript"/>
    <category term="performance"/>
    <category term="string"/>
    <category term="strip"/>
    <category term="trim"/>
    <link href="http://www.lucaguidi.com/2008/5/28/faster-javascript-trim" rel="alternate" type="text/html"/>
    <title>Faster JavaScript Trim</title>
<content type="html">
            &lt;p&gt;I've recently discovered the very interesting &lt;a href=&quot;http://blog.stevenlevithan.com/archives/faster-trim-javascript&quot;&gt;Steven Levithan post&lt;/a&gt; about the &lt;strong&gt;JavaScript's trim&lt;/strong&gt; function of the &lt;strong&gt;String&lt;/strong&gt; class.&lt;/p&gt;
&lt;p&gt;
  So, here my version:

&lt;/p&gt;

&lt;h3&gt;More numbers, please!&lt;/h3&gt;
&lt;p&gt;
  I tested my function against the &lt;a href=&quot;http://stevenlevithan.com/demo/trim.cfm&quot;&gt;benchmarking page&lt;/a&gt; of the original post.&lt;br /&gt;
  &lt;strong&gt;Note&lt;/strong&gt;: times are expressed in &lt;acronym title=&quot;milliseconds&quot;&gt;MS&lt;/acronym&gt; and are the average of ten executions per browser.&lt;br /&gt;
  &lt;strong&gt;Update [2008-05-29]:&lt;/strong&gt; I re-runned all the tests and updated results, because &lt;a href=&quot;http://blog.stevenlevithan.com/&quot;&gt;Steven&lt;/a&gt; noticed that test suite was wrong (few whitespaces).
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Mac&lt;/th&gt;
      &lt;th&gt;Windows&lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
    &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;Safari 3.1&lt;/th&gt;
        &lt;th&gt;Firefox 2.0.0.14&lt;/th&gt;
        &lt;th&gt;Firefox 3.0b5&lt;/th&gt;
        &lt;th&gt;Opera 9.27&lt;/th&gt;
        &lt;th&gt;Opera 9.50b2&lt;/th&gt;
        &lt;th&gt;Internet Explorer 6&lt;/th&gt;
        &lt;th&gt;Internet Explorer 7&lt;/th&gt;
        &lt;th&gt;Firefox 2.0.0.14&lt;/th&gt;
        &lt;th&gt;Opera 9.27&lt;/th&gt;
        &lt;th&gt;Opera 9.50b2&lt;/th&gt;
        &lt;th&gt;Average&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim1&lt;/th&gt;
        &lt;td&gt;25&lt;/td&gt;
        &lt;td&gt;40&lt;/td&gt;
        &lt;td&gt;19&lt;/td&gt;
        &lt;td&gt;100&lt;/td&gt;
        &lt;td&gt;93&lt;/td&gt;
        &lt;td&gt;12&lt;/td&gt;
        &lt;td&gt;12&lt;/td&gt;
        &lt;td&gt;38&lt;/td&gt;
        &lt;td&gt;124&lt;/td&gt;
        &lt;td&gt;111&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;57&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim2&lt;/th&gt;
        &lt;td&gt;25&lt;/td&gt;
        &lt;td&gt;52&lt;/td&gt;
        &lt;td&gt;29&lt;/td&gt;
        &lt;td&gt;100&lt;/td&gt;
        &lt;td&gt;98&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;11&lt;/td&gt;
        &lt;td&gt;44&lt;/td&gt;
        &lt;td&gt;125&lt;/td&gt;
        &lt;td&gt;116&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;61&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim3&lt;/th&gt;
        &lt;td&gt;32&lt;/td&gt;
        &lt;td&gt;54&lt;/td&gt;
        &lt;td&gt;46&lt;/td&gt;
        &lt;td&gt;156&lt;/td&gt;
        &lt;td&gt;148&lt;/td&gt;
        &lt;td&gt;15&lt;/td&gt;
        &lt;td&gt;31&lt;/td&gt;
        &lt;td&gt;57&lt;/td&gt;
        &lt;td&gt;209&lt;/td&gt;
        &lt;td&gt;184&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;93&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim4&lt;/th&gt;
        &lt;td&gt;43&lt;/td&gt;
        &lt;td&gt;43&lt;/td&gt;
        &lt;td&gt;37&lt;/td&gt;
        &lt;td&gt;151&lt;/td&gt;
        &lt;td&gt;139&lt;/td&gt;
        &lt;td&gt;15&lt;/td&gt;
        &lt;td&gt;38&lt;/td&gt;
        &lt;td&gt;49&lt;/td&gt;
        &lt;td&gt;198&lt;/td&gt;
        &lt;td&gt;186&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;90&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim5&lt;/th&gt;
        &lt;td&gt;64&lt;/td&gt;
        &lt;td&gt;102&lt;/td&gt;
        &lt;td&gt;104&lt;/td&gt;
        &lt;td&gt;134&lt;/td&gt;
        &lt;td&gt;116&lt;/td&gt;
        &lt;td&gt;65&lt;/td&gt;
        &lt;td&gt;908&lt;/td&gt;
        &lt;td&gt;323&lt;/td&gt;
        &lt;td&gt;291&lt;/td&gt;
        &lt;td&gt;274&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;238&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim6&lt;/th&gt;
        &lt;td&gt;69&lt;/td&gt;
        &lt;td&gt;115&lt;/td&gt;
        &lt;td&gt;109&lt;/td&gt;
        &lt;td&gt;195&lt;/td&gt;
        &lt;td&gt;171&lt;/td&gt;
        &lt;td&gt;47&lt;/td&gt;
        &lt;td&gt;1.497&lt;/td&gt;
        &lt;td&gt;364&lt;/td&gt;
        &lt;td&gt;436&lt;/td&gt;
        &lt;td&gt;338&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;334&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim7&lt;/th&gt;
        &lt;td&gt;69&lt;/td&gt;
        &lt;td&gt;120&lt;/td&gt;
        &lt;td&gt;107&lt;/td&gt;
        &lt;td&gt;142&lt;/td&gt;
        &lt;td&gt;129&lt;/td&gt;
        &lt;td&gt;31&lt;/td&gt;
        &lt;td&gt;900&lt;/td&gt;
        &lt;td&gt;345&lt;/td&gt;
        &lt;td&gt;330&lt;/td&gt;
        &lt;td&gt;271&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;244&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim8&lt;/th&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;118&lt;/td&gt;
        &lt;td&gt;104&lt;/td&gt;
        &lt;td&gt;112&lt;/td&gt;
        &lt;td&gt;97&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;540&lt;/td&gt;
        &lt;td&gt;255&lt;/td&gt;
        &lt;td&gt;180&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;142&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim9&lt;/th&gt;
        &lt;td&gt;34&lt;/td&gt;
        &lt;td&gt;126&lt;/td&gt;
        &lt;td&gt;116&lt;/td&gt;
        &lt;td&gt;1.825&lt;/td&gt;
        &lt;td&gt;1.218&lt;/td&gt;
        &lt;td&gt;23&lt;/td&gt;
        &lt;td&gt;74&lt;/td&gt;
        &lt;td&gt;113&lt;/td&gt;
        &lt;td&gt;1.667&lt;/td&gt;
        &lt;td&gt;1.417&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;662&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim10&lt;/th&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim11&lt;/th&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;11&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;7&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim12&lt;/th&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;trim13&lt;/th&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;Please download the &lt;a href=&quot;http://lucaguidi.com/assets/2008/5/29/trim_benchmark.zip&quot;&gt;benchmark suite&lt;/a&gt;, and test against your browsers.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-05-20:260</id>
    <published>2008-05-20T16:33:00Z</published>
    <updated>2008-05-20T16:49:43Z</updated>
    <category term="Ruby"/>
    <category term="gem"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="repository"/>
    <category term="ror"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sashimi"/>
    <link href="http://www.lucaguidi.com/2008/5/20/sashimi-just-received-a-tasteful-update" rel="alternate" type="text/html"/>
    <title>Sashimi: Just Received A Tasteful Update</title>
<content type="html">
            &lt;p&gt;Yesterday &lt;a href=&quot;http://lucaguidi.com/2008/5/19/sashimi-a-rails-plugins-manager-gem&quot; title=&quot;Sashimi: A Rails Plugins Manager Gem&quot;&gt;I announced&lt;/a&gt; &lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot;&gt;Sashimi&lt;/a&gt; and now it's already time of tasteful updates.&lt;/p&gt;

&lt;h3&gt;Changes&lt;/h3&gt;
&lt;p&gt;First, thanks to all the people that appreciated my work. Second, new commands and options are avaliable for Sashimi.&lt;/p&gt;

&lt;p&gt;Update all plugins in your repository:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi update --all&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Install a plugin to your Rails app:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi install --rails click-to-globalize&lt;/code&gt;&lt;/pre&gt;
&lt;strong&gt;NOTE&lt;/strong&gt; this is an alias for the &lt;code&gt;add&lt;/code&gt; command.
&lt;/p&gt;

&lt;p&gt;Update a plugin of a Rails app:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi update --rails click-to-globalize&lt;/code&gt;&lt;/pre&gt;
&lt;strong&gt;NOTE&lt;/strong&gt; If your application is versioned with Svn or Git, Sashimi will automatically schedules for add/remove the added/removed files.
&lt;/p&gt;

&lt;h3&gt;How To Update&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ (sudo) gem update jodosha-sashimi --source=http://gems.github.com&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope you enjoy those addictional options.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-05-19:258</id>
    <published>2008-05-19T13:33:00Z</published>
    <updated>2008-05-19T13:44:31Z</updated>
    <category term="Ruby"/>
    <category term="gem"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="repository"/>
    <category term="ror"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <category term="sashimi"/>
    <link href="http://www.lucaguidi.com/2008/5/19/sashimi-a-rails-plugins-manager-gem" rel="alternate" type="text/html"/>
    <title>Sashimi: A Rails Plugins Manager Gem</title>
<content type="html">
            &lt;p&gt;I have a really, really bad memory: each time I need to install a &lt;a href=&quot;http://rubyonrails.org&quot; title=&quot;Ruby on Rails home page&quot;&gt;Rails&lt;/a&gt; plugin, I Google to find the repository, then try to download the code. Often, I remember the url, but the server is down. Damn!&lt;/p&gt;
&lt;p&gt;All this annoying issues kill the Rails rapidity on application prototyping. But, what if all the plugins which I need are available &lt;strong&gt;offline&lt;/strong&gt; on my notebook? I can forget about all that urls, and I should stop to worry about the server status.&lt;/p&gt;
&lt;p&gt;To solve this problems, I wrote &lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot; title=&quot;Sashimi page&quot;&gt;Sashimi&lt;/a&gt;, it's a gem that manages you favourite Rails plugins in a local repository.&lt;/p&gt;

&lt;h3&gt;How It Works?&lt;/h3&gt;
&lt;p&gt;First you need to install it with:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ (sudo) gem install jodosha-sashimi --source=http://gems.github.com&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Now you can install a plugin on your local repository:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi install git://github.com/jodosha/click-to-globalize.git&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Ta-daaaa!! Now &lt;a href=&quot;http://lucaguidi.com/pages/click-to-globalize&quot;&gt;Click to Globalize&lt;/a&gt; is available offline:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi list

click-to-globalize&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
If you need to add it to your Rails app, just move to your app root, then type:&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sashimi add click-to-globalize&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;I found &lt;strong&gt;Sashimi&lt;/strong&gt; really useful, I hope you too.&lt;/p&gt;
&lt;p&gt;For the complete reference, please check out at the &lt;a href=&quot;http://lucaguidi.com/pages/sashimi&quot; title=&quot;Sashimi page&quot;&gt;official gem page&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.lucaguidi.com/">
    <author>
      <name>luca</name>
    </author>
    <id>tag:www.lucaguidi.com,2008-05-14:256</id>
    <published>2008-05-14T12:21:00Z</published>
    <updated>2008-05-14T12:34:10Z</updated>
    <category term="Ruby on Rails"/>
    <category term="acts_as_resource"/>
    <category term="git"/>
    <category term="github"/>
    <category term="migration"/>
    <category term="plugins"/>
    <category term="rails"/>
    <category term="ruby"/>
    <category term="rubyonrails"/>
    <link href="http://www.lucaguidi.com/2008/5/14/acts-as-resource-rails-2-1-ready-and-moved-to-github" rel="alternate" type="text/html"/>
    <title>Acts As Resource: Rails 2.1 ready and moved to GitHub</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://lucaguidi.com/pages/acts-as-resource&quot;&gt;Acts As Resource&lt;/a&gt; is &lt;strong&gt;ready&lt;/strong&gt; for the imminent &lt;strong&gt;Rails 2.1&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;I also moved it to &lt;a href=&quot;http://github.com&quot;&gt;GitHub&lt;/a&gt;, the new repo is &lt;a href=&quot;http://github.com/jodosha/acts-as-resource/tree/master&quot;&gt;http://github.com/jodosha/acts-as-resource/tree/master&lt;/a&gt;, the SVN one is &lt;strong&gt;deprecated&lt;/strong&gt;.&lt;/p&gt;

If you enjoyed this post, feel free to recommend me on &lt;a href=&quot;http://www.workingwithrails.com/recommendation/new/person/8829-luca-guidi&quot;&gt;Working With Rails&lt;/a&gt;.
          </content>  </entry>
</feed>
