<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Shiny happy people coding : Tag ruby_on_rails, tout sur ruby_on_rails</title>
    <link>http://blog.shingara.fr</link>
    <atom:link type="application/rss+xml" rel="self" href="http://blog.shingara.fr/tag/ruby_on_rails.rss"/>
    <language>fr-fr</language>
    <ttl>40</ttl>
    <description>codons avec le sourire</description>
    <item>
      <title>Pourquoi Ruby et Ruby On Rails dans le d&#233;veloppement d'application web ?</title>
      <description>&lt;p&gt;Cette question a &#233;t&#233; pos&#233;e derni&#232;rement sur la Mailling List de RailsFrance. Effectivement, si on veut promouvoir Ruby dans le monde informatique fran&#231;ais, il faut pouvoir argumenter pourquoi on trouve que c'est une bonne id&#233;e.
&lt;/p&gt;

&lt;p&gt;
Tout le monde est en droit de se poser la question. Voici donc, pour moi, l'avantage de Ruby par rapport aux autres technologies &#224; l'heure actuelle.
&lt;/p&gt;

&lt;h4&gt;Ruby c'est fun&lt;/h4&gt;

&lt;p&gt;
Matz, quand il a cr&#233;&#233; Ruby, a voulu faire un langage fun avec lequel il pourrait s'amuser &#224; coder. Aujourd'hui tous les d&#233;veloppeurs Ruby diront &#224; peu pr&#232;s la m&#234;me chose. Coder en Ruby est plaisant. L'avantage de ce point est qu'un d&#233;veloppeur Ruby est plus d&#233;tendu. Un d&#233;veloppeur d&#233;tendu est un d&#233;veloppeur plus heureux. Un d&#233;veloppeur plus heureux est motivant pour une &#233;quipe. Un d&#233;veloppeur heureux essayera de faire son travail proprement. L'ambiance d'une &#233;quipe de d&#233;veloppeur Ruby peut ainsi &#234;tre agr&#233;able. Moins de stress sur un projet, c'est un projet qui part avec un peu plus de chances de r&#233;ussir.
&lt;/p&gt;

&lt;h4&gt;Ruby aime les tests&lt;/h4&gt;

&lt;p&gt;
La communaut&#233; Ruby actuelle est convaincue de l'utilit&#233; des tests unitaires. Ainsi, chaque librairie est pouss&#233;e par la communaut&#233; &#224; avoir des tests. Beaucoup de d&#233;veloppeurs, moi y compris, privil&#233;gierons une librairie avec des tests unitaires plut&#244;t qu'une sans aucun tests.
&lt;/p&gt;
&lt;p&gt;
Cette philosophie permet d'avoir un environnement de d&#233;veloppement de test simplifi&#233; directement dans Rails. Pas besoin de se prendre la t&#234;te pour faire des tests. Si vous ne faites pas de tests de base : soit vous ne voulez pas en faire, ce que je ne recommande pas, soit vous le faites expr&#232;s.
&lt;/p&gt;


&lt;h4&gt;Ruby aime le cloud&lt;/h4&gt;

&lt;p&gt;
En ce moment, l'&#233;volution logique du net est le Cloud Computing. L'id&#233;e du Cloud Computing est simple. Nos sites internet ne sont plus h&#233;berg&#233;s sur une seule machine. Les services sont s&#233;par&#233;s pour am&#233;liorer la scallabilit&#233;. Au sein de la communaut&#233; Ruby, les d&#233;veloppeurs sont tr&#232;s attach&#233;s &#224; cette id&#233;e. Ainsi beaucoup d'utilitaires pour g&#233;rer et utiliser son cloud commencent &#224; voir le jour comme Chef. L'architecture m&#234;me de Rails permet de facilement sortir de Ruby On Rails pour ainsi utiliser son Cloud. ActiveRessource en est la preuve.
&lt;/p&gt;
&lt;p&gt;
Mais coder dans un Cloud implique de coder plusieurs briques. Le Ruby a des bindings pour tous ces utilitaires, comme les syst&#232;mes de queues ou les bases de Donn&#233;es Non-Relationnelle. Je ne dis pas que les autres ne peuvent pas le faire. Mais l&#224; encore c'est un effet de groupe. Chaque d&#233;veloppeur ruby a envie de jouer avec un Cloud. On pense de plus en plus en cloud.
&lt;/p&gt;
&lt;h4&gt;Les plugins de Rails&lt;/h4&gt;
&lt;p&gt;
Ruby On Rails poss&#232;de une tr&#232;s grande quantit&#233; de plugins. On peut ainsi facilement trouver la petite brique que l'on cherche pour sa propre utilisation. C'est plus que l'utilisation d'un module Drupal. Car l&#224; nous sommes dans un environement facilement modifiable et sans aucune limitation. Chose que Drupal peut vite avoir.
&lt;/p&gt;

&lt;h4&gt;Les Ressources&lt;/h4&gt;
&lt;p&gt;
Le plus grand reproche que l'on fait actuellement au choix de Ruby On Rails, c'est le manque de ressources. Effectivement, les ressources de d&#233;veloppeurs Ruby sont plus faibles que pour d'autres langages. Mais ceci est selon moi un faux probl&#232;me. L'apprentissage de Ruby et Ruby On Rails est assez simple si on connait la logique Objet. Ainsi, n'importe quel d&#233;veloppeur Java peut tout &#224; fait se mettre &#224; Ruby et Ruby On Rails. Donc avec un expert Ruby/Rails, on peut former facilement une &#233;quipe compl&#232;te et comp&#233;tente.
&lt;/p&gt;

&lt;p&gt;Cet argumentaire n'engage bien s&#251;r que moi et peut donc &#234;tre sujet &#224; caution.&lt;/p&gt;

</description>
      <pubDate>Wed, 27 Jan 2010 23:47:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c997485e-3ab6-409c-9b17-9ce1f34f3e5f</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/pourquoi-ruby-et-ruby-on-rails-dans-le-developpement-dapplication-web.html#comments</comments>
      <category>ruby</category>
      <category>Informatique</category>
      <category>ruby</category>
      <category>ruby_on_rails</category>
      <category>question</category>
      <category>pourquoi</category>
      <category>ressource</category>
      <link>http://blog.shingara.fr/pourquoi-ruby-et-ruby-on-rails-dans-le-developpement-dapplication-web.html</link>
    </item>
    <item>
      <title>Sortie de Typo 5.4.0</title>
      <description>&lt;p&gt;&#199;a y est, une nouvelle version de &lt;a href=&quot;http://typosphere.org&quot;&gt;Typo&lt;/a&gt; est lanc&#233;e dans la nature. Je n'ai
h&#233;las que tr&#232;s peu particip&#233; &#224; cette nouvelle version faute de
motivation/temps. Mais je suis toujours tr&#232;s content de voir une nouvelle
version de ce blog sortir.&lt;/p&gt;

&lt;p&gt;A chaque release, une nouvelle admin fait son apparition, mais &#224; chaque
fois elle est meilleure que la pr&#233;c&#233;dente, donc c'est une excellente chose.&lt;/p&gt;

&lt;p&gt;J'ai bien-s&#251;r mis &#224; jour ce blog et j'ai aussi switch&#233; sur le nouveau th&#232;me
par d&#233;faut. Je suis toujours aussi nul en design.&lt;/p&gt;

&lt;p&gt;En petit cadeau, voici mon fichier &lt;a href=&quot;http://capify.org/&quot;&gt;capistrano&lt;/a&gt; que j'utilise pour d&#233;ployer
ce blog. &#199;a peux toujours vous servir. On ne sait jamais.&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class=&quot;CodeRay&quot;&gt;set &lt;span class=&quot;sy&quot;&gt;:application&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;typo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:repository&lt;/span&gt;,  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;git://github.com/fdv/typo.git&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:domain&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;blog.shingara.fr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# If you aren't deploying to /u/apps/#{application} on the target&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# # servers (which is the default), you can specify the actual location&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# # via the :deploy_to variable:&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:deploy_to&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/var/rails/blog-typo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# # If you aren't using Subversion to manage your source code, specify&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# # your SCM below:&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:scm&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:git&lt;/span&gt;

set &lt;span class=&quot;sy&quot;&gt;:runner&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:use_sudo&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;

set &lt;span class=&quot;sy&quot;&gt;:thin_conf&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/etc/thin/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;domain&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

role &lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;, domain
role &lt;span class=&quot;sy&quot;&gt;:web&lt;/span&gt;, domain
role &lt;span class=&quot;sy&quot;&gt;:db&lt;/span&gt;,  domain, &lt;span class=&quot;sy&quot;&gt;:primary&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;

task &lt;span class=&quot;sy&quot;&gt;:update_config&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cp -Rf &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/* &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/files &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/public/files&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

task &lt;span class=&quot;sy&quot;&gt;:update_gems&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cd &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &amp;amp;&amp;amp; RAILS_ENV=production rake gems:install&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;


after &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:update_code&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:update_config&lt;/span&gt;
after &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:update_code&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:update_gems&lt;/span&gt;


namespace &lt;span class=&quot;sy&quot;&gt;:deploy&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  task &lt;span class=&quot;sy&quot;&gt;:start&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  task &lt;span class=&quot;sy&quot;&gt;:stop&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; stop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  task &lt;span class=&quot;sy&quot;&gt;:restart&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; restart&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

task &lt;span class=&quot;sy&quot;&gt;:clear_cache&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cd &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;current_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &amp;amp;&amp;amp; RAILS_ENV=production rake sweep_cache&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cd &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;current_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; &amp;amp;&amp;amp; RAILS_ENV=production rake tmp:cache:clear&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

after &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:restart&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:clear_cache&lt;/span&gt;
after &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:start&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:clear_cache&lt;/span&gt;&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.shingara.fr/en/2009-12-21-typo-5-4-0-released.html&quot;&gt;English Translation&lt;/a&gt;&lt;/p&gt;

</description>
      <pubDate>Mon, 21 Dec 2009 21:30:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:2f6dab7d-7ba7-4f68-8f63-cc5f98284c72</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/sortie-de-typo-5-4-0.html#comments</comments>
      <category>ruby</category>
      <category>release</category>
      <category>ruby_on_rails</category>
      <category>annonce</category>
      <category>typo</category>
      <link>http://blog.shingara.fr/sortie-de-typo-5-4-0.html</link>
    </item>
    <item>
      <title>Sortie de Oupsnow 0.4.0</title>
      <description>&lt;p&gt;Ca y est, Oupsnow 0.4.0 est enfin sorti. Cette version est un refactoring quasiment complet. Apr&#232;s avoir eu une version 0.3.0 en Merb/DataMapper, cette version est d&#233;sormais en Rails/MongoDB. Le back-end et le serveur ont chang&#233;.&lt;/p&gt;

&lt;p&gt;Cette nouvelle version, outre son refactoring comprend aussi l'ajout de quelques nouvelles fonctionnalit&#233;s.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ajout d'un filtre par Status dans la recherche de ticket&lt;/li&gt;
&lt;li&gt;Ajout de la possibilit&#233; de changer la fonction de tous les membres d'un project&lt;/li&gt;
&lt;li&gt;Ajout de la preview des tickets et commentaires sur les tickets&lt;/li&gt;
&lt;li&gt;Ajout de la visualisation de la milestone courante dans la visualisation d'un ticket&lt;/li&gt;
&lt;li&gt;Possibilit&#233; d'ordonner tous les champs de recherche dans la vue des tickets&lt;/li&gt;
&lt;li&gt;Login par l'email et plus par le pseudo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vous pouvez t&#233;l&#233;charger cette version sur &lt;a href=&quot;http://rubyforge.org/frs/?group_id=7685&quot;&gt;rubyforge&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Si vous souhaitez tester cette version, une &lt;a href=&quot;http://oupsnow.shingara.fr/&quot;&gt;version de demo de oupsnow&lt;/a&gt; est en ligne. Les login/mdp sont : admin@admin.com/oupsnow. Amusez vous bien.&lt;/p&gt;

</description>
      <pubDate>Tue, 01 Dec 2009 23:02:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:2e95842f-f7d0-417c-8c09-c311db64c6e0</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/sortie-de-oupsnow-0-4-0.html#comments</comments>
      <category>ruby</category>
      <category>release</category>
      <category>ruby_on_rails</category>
      <category>annonce</category>
      <category>oupsnow</category>
      <category>mongomapper</category>
      <category>mongodb</category>
      <link>http://blog.shingara.fr/sortie-de-oupsnow-0-4-0.html</link>
    </item>
    <item>
      <title>Comment tester devise ? r&#233;&#233;lement ?</title>
      <description>&lt;p&gt;Alors que j'ai cherch&#233; comment tester facilement &lt;a href=&quot;http://github.com/plataformatec/devise&quot;&gt;Devise&lt;/a&gt;. J'ai indiqu&#233; une technique dans &lt;a href=&quot;http://blog.shingara.fr/devise-cest-bien-mais-il-faut-le-tester.html&quot;&gt;mon pr&#233;c&#233;dent post&lt;/a&gt;. Mais cette technique est loin d'&#234;tre la meilleure. Voici donc la nouvelle solution, la solution officielle.&lt;/p&gt;

&lt;p&gt;Il suffit d'inclure &lt;code&gt;Devise::TestHelpers&lt;/code&gt;. Ensuite pour se logger avec un utilisateur, on utilise la m&#233;thode &lt;code&gt;sign_in&lt;/code&gt;. La m&#233;thode &lt;code&gt;sign_out&lt;/code&gt; existe aussi.&lt;/p&gt;

</description>
      <pubDate>Mon, 30 Nov 2009 22:58:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:dc4a0217-abc3-4fe4-89d7-8d11438f2cc4</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/comment-tester-devise-reelement.html#comments</comments>
      <category>ruby</category>
      <category>ruby_on_rails</category>
      <category>test</category>
      <category>devise</category>
      <link>http://blog.shingara.fr/comment-tester-devise-reelement.html</link>
    </item>
    <item>
      <title>Devise ? c'est bien, mais il faut le tester.</title>
      <description>&lt;p&gt;Alors que j'ai &#233;voqu&#233; ma &lt;a href=&quot;http://blog.shingara.fr/oupsnow-de-merb-i-rails.html&quot;&gt;migration de Merb &#224; Rails pour
Oupsnow&lt;/a&gt;, il a
fallu trouver un syst&#232;me d'authentification ORM Agnostique.&lt;/p&gt;

&lt;p&gt;Le plugin d'authentification le plus connu &#224; l'heure actuel est &lt;a
href=&quot;http://rdoc.info/projects/binarylogic/authlogic&quot;&gt;Authlogic&lt;/a&gt;.
Ce plugin est vraiment tr&#232;s performant, mais tous les essais de le rendre ORM
Agnostique ont &#233;t&#233; vain. C'est alors qu'au m&#234;me moment, durant le &lt;a
href=&quot;http://www.railssummit.com.br/&quot;&gt;Rails Summit 2009&lt;/a&gt;,
George Guimar&#227;es et Carlos Antonio annoncent la sortie de &lt;a
href=&quot;http://github.com/plataformatec/devise&quot;&gt;Devise&lt;/a&gt;, un plugin Rails au
dessus de &lt;a href=&quot;http://github.com/hassox/warden&quot;&gt;Warden&lt;/a&gt; (
Rack middleware d'authentification). C'est exactement, ce qu'il me faut, un
nouveau syst&#232;me d'authentification a tester et peut-&#234;tre une possibilit&#233;
d'ajouter une couche d'ORM Agnostique dedans. En plus Warden &#233;tant un
RackMiddleware, je pourrais un peu tester ce que &#231;a donne.&lt;/p&gt;

&lt;p&gt;J'installe donc Devise et commence &#224; l'utiliser dans Oupsnow. Tout se passe
&#224; merveille, jusqu'au moment o&#249; il faut faire les tests. Tout de suite le b&#226;t
blesse. Les tests controlleurs de Rails ne communiquent pas avec la couche Rack
qui n'est pas initialis&#233;e. On se retrouve donc avec une impossibilit&#233; de
d&#233;finir si un utilisateur est logg&#233; ou non et si oui, qui est cet
utilisateur.&lt;/p&gt;

&lt;p&gt;Apr&#232;s de nombreux tests et essais. J'ai fini par trouver comment faire.
Warden ajoute &#224; la requ&#234;te une variable d'environment dans la requ&#234;te. On peux
y acc&#233;der par
&lt;code&gt;request.env['warden']&lt;/code&gt;. Il suffit donc de remplir cette
variable.&lt;/p&gt;

&lt;p&gt;Pour avoir un utilisateur non logg&#233;, il faut faire :&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class=&quot;CodeRay&quot;&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;unlogged&lt;/span&gt;
  request.env[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;warden&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] = &lt;span class=&quot;co&quot;&gt;Warden&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Proxy&lt;/span&gt;.new(request.env, {&lt;span class=&quot;sy&quot;&gt;:default_strategies&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:rememberable&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:authenticable&lt;/span&gt;],&lt;span class=&quot;sy&quot;&gt;:silence_missing_strategies&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;})
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Pour se logger avec un utilisateur en particulier il faut faire :&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class=&quot;CodeRay&quot;&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;logged_as&lt;/span&gt;(user)
  proxy = &lt;span class=&quot;co&quot;&gt;Warden&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;Proxy&lt;/span&gt;.new(request.env, {&lt;span class=&quot;sy&quot;&gt;:default_strategies&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:rememberable&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:authenticable&lt;/span&gt;], &lt;span class=&quot;sy&quot;&gt;:silence_missing_strategies&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;})
  proxy.set_user(user, &lt;span class=&quot;sy&quot;&gt;:store&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:scope&lt;/span&gt; =&amp;gt; &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;)
  request.env[&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;warden&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;] = proxy
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Personnellement, j'aime beaucoup &lt;a href=&quot;http://github.com/plataformatec/devise&quot;&gt;devise&lt;/a&gt;. A tel point que j'ai permis de le
rendre ORM Agnostique et compatible avec &lt;a href=&quot;http://github.com/jnunemaker/mongomapper/&quot;&gt;MongoMapper&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;EDIT du 30 Novembre 2009: la technique indiqu&#233;e ici n'est pas optimum et ne marche pas avec les derni&#232;res versions de Devise. utilisez plut&#244;t la technique d&#233;crite dans mon ticket &lt;a href=&quot;http://blog.shingara.fr/comment-tester-devise-reelement.html&quot;&gt;Comment tester devise ? r&#233;&#233;lement ?&lt;/a&gt;&lt;/p&gt;

</description>
      <pubDate>Thu, 19 Nov 2009 23:36:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:df4d9e7c-a5f0-492d-8267-c63b21cc0866</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/devise-cest-bien-mais-il-faut-le-tester.html#comments</comments>
      <category>ruby</category>
      <category>authentification</category>
      <category>ruby_on_rails</category>
      <category>test</category>
      <category>oupsnow</category>
      <category>mongomapper</category>
      <category>devise</category>
      <link>http://blog.shingara.fr/devise-cest-bien-mais-il-faut-le-tester.html</link>
    </item>
    <item>
      <title>Observer Vs Callback</title>
      <description>&lt;p&gt;Il y a peu au boulot, j'ai indiqu&#233; ma d&#233;sapprobation des Observeurs face au Callback. Je vais donc le coucher ici par &#233;crit mon sentiment.&lt;/p&gt;

&lt;h2&gt;L'Observeur&lt;/h2&gt;

&lt;p&gt;Dans Rails, il y a au premier abord une fonctionnalit&#233; vraiment int&#233;ressante. L'&lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/Observer.html&quot;&gt;Observeur&lt;/a&gt;. Gr&#226;ce &#224; lui, on peux d&#233;finir une classe qui v&#233;rifie le comportement d'un model et effectue certaine action suite &#224; ses observations. Il permet d'ajouter des &#233;v&#233;nements avant/apr&#232;s l'enregistrement, la mise a jour ou la destruction d'un model.&lt;/p&gt;

&lt;p&gt;Pour mettre en place un observeur, il suffit de cr&#233;er une classe h&#233;ritant de &lt;code&gt;ActiveRecord::Observer&lt;/code&gt;, mettre son code dedans et la d&#233;finir comme observeur dans le fichier environment.rb. Rien de plus simple et &#231;a marche tr&#232;s bien.&lt;/p&gt;

&lt;h2&gt;Le Callback&lt;/h2&gt;

&lt;p&gt;Mais Rails a d&#233;j&#224; int&#233;gr&#233; dans ses models, les fonctions de callback utilis&#233; par le observeur. En effet, on peux tout &#224; fait d&#233;finir N action after_save ou before_create. Ces m&#233;thodes seront appel&#233;s &#224; l'&#233;v&#233;nement voulu.&lt;/p&gt;

&lt;h2&gt;Mais que choisir ?&lt;/h2&gt;

&lt;p&gt;C'est l&#224; o&#249; je dis que le callback est plus int&#233;ressant que l'observeur. En effet, un callback fait exactement la m&#234;me chose qu'un Observeur. Mais lui au moins on sait qu'il est l&#224;. En ouvrant la classe on d&#233;couvre le callback. Pour d&#233;tecter un Observeur, il faut regarder les fichiers de config de Rails et ouvrir une &#224; une les classes Observeurs.&lt;/p&gt;

&lt;p&gt;M&#234;me le cas du nombre de ligne n'est pas r&#233;el car il est tout &#224; fait possible de sortir ses callbacks dans des modules. De m&#234;me pour une r&#233;utilisation sur plusieurs classes. Le module le permet sans probl&#232;me.&lt;/p&gt;

&lt;p&gt;Personnellement, je n'ai jamais constater un seul cas o&#249; l'observeur avait plus d'int&#233;r&#234;t que des callback. Si vous en trouvez, je suis vraiment curieux.&lt;/p&gt;
 

</description>
      <pubDate>Sun, 14 Jun 2009 23:35:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:04bd22ae-e50a-467e-9a0c-808c25841628</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/observer-vs-callback.html#comments</comments>
      <category>ruby</category>
      <category>rails</category>
      <category>ruby_on_rails</category>
      <category>callback</category>
      <category>observer</category>
      <link>http://blog.shingara.fr/observer-vs-callback.html</link>
    </item>
    <item>
      <title>sortie de typo 5.2</title>
      <description>&lt;p&gt;A mon tour de vous annoncer la sortie de &lt;a href=&quot;http://blog.typosphere.org/2009/01/25/typo-5-2-helmut-newton-for-rails-2-2-released&quot;&gt;Typo 5.2&lt;/a&gt;. Cette sortie est la premi&#232;re sortie o&#249; je participe activement. En effet, depuis Ao&#251;t dernier, je suis contibuteur de &lt;a href=&quot;http://typosphere.org/&quot;&gt;Typo&lt;/a&gt;. J'ai d'abord commenc&#233; par faire la migration de Typo sur Rails 2.2 (avant m&#234;me la sortie officiel de Rails 2.2). J'ai ensuite continu&#233; avec &lt;a href=&quot;http://t37.net/&quot;&gt;Fr&#233;d&#233;ric&lt;/a&gt; &#224; am&#233;liorer au maximum les performances et l'utilisabilit&#233; de Typo.&lt;/p&gt;

&lt;p&gt;Aujourd'hui avec cette sortie de Typo, le travail est vraiment &#224; la hauteur. Nous avons tout fait pour que cela soit optimum. Mais surtout nous n'avons pas fini. Nous avons ainsi &#233;norm&#233;ment d'id&#233;e qui seront int&#233;gr&#233; dans Typo dans le futur. Nous allons aussi essay&#233; de faire des releases plus r&#233;guli&#232;rement.&lt;/p&gt;

&lt;p&gt;En bonus, voici mon fichier capistrano que j'utilise pour d&#233;ployer Typo.&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class=&quot;CodeRay&quot;&gt;set &lt;span class=&quot;sy&quot;&gt;:application&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;typo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:repository&lt;/span&gt;,  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;git://github.com/fdv/typo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:domain&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;shingara.fr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# If you aren't deploying to /u/apps/#{application} on the target&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# servers (which is the default), you can specify the actual location&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# via the :deploy_to variable:&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:deploy_to&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/var/rails/blog-typo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# If you aren't using Subversion to manage your source code, specify&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# your SCM below:&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:scm&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:git&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:git_enable_submodules&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;

set &lt;span class=&quot;sy&quot;&gt;:runner&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rails&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:use_sudo&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;
set &lt;span class=&quot;sy&quot;&gt;:thin_conf&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/etc/thin/typo.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

role &lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;, domain
role &lt;span class=&quot;sy&quot;&gt;:web&lt;/span&gt;, domain
role &lt;span class=&quot;sy&quot;&gt;:db&lt;/span&gt;,  domain, &lt;span class=&quot;sy&quot;&gt;:primary&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;

task &lt;span class=&quot;sy&quot;&gt;:update_config&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/database.yml &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/database.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/files &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/public/files&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/cache &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/tmp/cache&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/newrelic_rpm &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/vendor/plugins/newrelic_rpm&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/newrelic.yml &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/newrelic.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/agent &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/agent&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/mail.yml &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/mail.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

task &lt;span class=&quot;sy&quot;&gt;:dump_before&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;pg_dump -U typoblog typo &amp;gt; &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/typo&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;co&quot;&gt;Time&lt;/span&gt;::today.strftime(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;%Y-%m-%d&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.sql&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

namespace &lt;span class=&quot;sy&quot;&gt;:deploy&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
  task &lt;span class=&quot;sy&quot;&gt;:start&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  task &lt;span class=&quot;sy&quot;&gt;:stop&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; stop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

  task &lt;span class=&quot;sy&quot;&gt;:restart&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:roles&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;
    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;thin -C &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;thin_conf&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; restart&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;

after &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:update_code&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:update_config&lt;/span&gt;
before &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;deploy:migrations&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:dump_before&lt;/span&gt;&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.shingara.fr/en/2009-01-25-typo-5-2-0-released.html&quot;&gt;English translation&lt;/a&gt;&lt;/p&gt;

</description>
      <pubDate>Sun, 25 Jan 2009 21:38:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:a8b773b8-b7c5-463a-b0a0-e3b3e95a3595</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/sortie-de-typo-5-2.html#comments</comments>
      <category>ruby</category>
      <category>blog</category>
      <category>ruby</category>
      <category>ruby_on_rails</category>
      <category>annonce</category>
      <category>typo</category>
      <link>http://blog.shingara.fr/sortie-de-typo-5-2.html</link>
    </item>
    <item>
      <title>Quelque nouvelles dans Rails Edge : Render(:file =&gt; '/path/to/file') devient render('/path/to/file')</title>
      <description>&lt;p&gt;Comme tout nos efforts sont d&#233;sormais &#224; consacrer &#224; Rails. Voici la derni&#232;re nouveaut&#233; que je viens de trouver dans les commits. Hier le render a &#233;t&#233; simplifi&#233;. En effet, quand vous souhaitez faire un render de fichier il fallait faire : &lt;code&gt;render (:file =&gt; '/path/to/file')&lt;/code&gt;. D&#233;sormais avec &lt;a href=&quot;http://github.com/rails/rails/commit/061952392afd1dae1aa97a816e9a0c79df7c4514&quot;&gt;ce nouveau commit&lt;/a&gt;, un simple &lt;code&gt;render('/path/to/file')&lt;/code&gt; suffira pour rendre le fichier donn&#233;.&lt;/p&gt;

&lt;p&gt;Par contre attention, pour que ce path sont consid&#233;r&#233; valide, il faut absolument le / au d&#233;but. Mais heureusement ce code &lt;code&gt;render(Rails.root('/public/404.html'))&lt;/code&gt; fonctionnera, gr&#226;ce &#224; &lt;a href=&quot;http://blog.shingara.fr/2008/11/30/quelles-nouvelles-dans-rails-edge-plus-de-file-join-avec-rails-root&quot;&gt;un pr&#233;c&#233;dent commit&lt;/a&gt;

</description>
      <pubDate>Fri, 26 Dec 2008 09:25:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:02970993-40da-4459-a006-a7435f2d8a3e</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/quelque-nouvelles-dans-rails-edge-render-file-path-to-file-devient-render-path-to-file.html#comments</comments>
      <category>ruby</category>
      <category>ruby_on_rails_2_3</category>
      <category>edge</category>
      <category>ruby_on_rails</category>
      <link>http://blog.shingara.fr/quelque-nouvelles-dans-rails-edge-render-file-path-to-file-devient-render-path-to-file.html</link>
    </item>
    <item>
      <title>Le no&#235;l de la fusion entre Merb et Rails. Qu'en penser ?</title>
      <description>&lt;p&gt;Hier, 23 d&#233;cembre la core Team de Merb et celle de Rails ont &lt;a href=&quot;http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3&quot;&gt;annonc&#233;&lt;/a&gt; &lt;a href=&quot;http://yehudakatz.com/2008/12/23/rails-and-merb-merge/&quot;&gt;conjointement&lt;/a&gt; leur pr&#233;vision de fusion pour Rails 3. En effet, Merb 2 sera Rails 3. Personnellement, j'ai &#233;t&#233; abasourdi par cette annonce. Imm&#233;diatement, je l'ai pris comme une mauvaise chose. J'ai tout de suite pens&#233; que ce n'&#233;tait pas forc&#233;ment une bonne chose pour les Frameworks web en Ruby.&lt;/p&gt;

&lt;p&gt;En effet, mon premier argument dans le fait de la dualit&#233; Rails/Merb &#233;tait la concurrence. Je prenais comme exemple la guerre des navigateurs qui durant la p&#233;riode IE vs Netscape a apport&#233; le Javascript. Puis une fois cette guerre fini, il y a eu la stagnation des navigateurs et de IE 6 qui avait son monopole. Heureusement, Firefox/Safari/Opera sont arriv&#233; progressivement, pour permettre de bonne am&#233;lioration dans les navigateurs et de meilleurs performances. C'est ainsi que Internet Explorer a eu besoin de revenir au source et reprendre son d&#233;veloppement qui va maintenant amener IE 8. Sans cette concurrence, nous aurions surement eu IE 6 encore maintenant (m&#234;me si il reste encore beaucoup de monde qui l'utilise). De m&#234;me, la &#171; guerre &#187; entre Mephisto et Typo est une bonne chose et nous force a rester dans la course. &#201;viter l'attentisme.&lt;/p&gt;

&lt;p&gt;Selon moi, les derni&#232;res grandes am&#233;liorations de performances de Rails sont issue de cette &#171; guerre &#187; entre Merb et Rails, que &#231;a soit Rails thread safe ou l'utilisation de Rack dans Rails. Mais Rails a aussi &#233;t&#233; oblig&#233; d'innover encore plus pour ne pas se faire doubler par Merb avec son Rails Metal par exemple ou l'incorporation de l'i18N&lt;/p&gt;

&lt;p&gt;D&#233;sormais avec cette incorporation de Merb dans Rails, Rails va encore plus progresser durant l'ann&#233;e &#224; venir, c'est &#233;vident. Pour cela, cette annonce est vraiment une bonne nouvelle. Mais ne va-t-elle pas entrainer aussi une stagnation apr&#232;s toutes ces am&#233;liorations et cette &#233;volution de Rails. Rails n'ayant plus de concurrent &#171; s&#233;rieux &#187; en ruby ne va-t-il pas se reposer sur ses lauriers ?&lt;/p&gt;

&lt;p&gt;C'est la que finalement, la communaut&#233; aura son r&#244;le &#224; jouer. C'est dans cette seconde partie de l'incorporation de Merb qui est tout se jouera pour l'avenir de Rails. L'id&#233;e de constituer une vrai &#233;quipe d'Evang&#233;liste avec l'incorporation des Evang&#233;liste de Merb comme Matt Aimonetti. Ainsi &lt;a href=&quot;http://merbist.com/2008/12/23/rails-and-merb-merge/&quot;&gt;Matt explique dans son post au sujet de l'incorporation des id&#233;es de Merb dans Rails&lt;/a&gt;, qu'une des bonnes attitudes de Merb &#233;tait cette &#233;coute constante de la communaut&#233;. Cette envie de faire consensus. De toute mani&#232;re, la multiplication des plugins fait le reste. Si telle ou telle personne pr&#233;f&#232;re tel ou tel comportement qui semble bizarre au plus grand nombre, il lui suffit de faire son plugin et il aura son comportement. Pour lui et les quelques personnes qui pensent comme lui.&lt;/p&gt;

&lt;p&gt;C'est ainsi que DHH explique dans son blog personnel, que &lt;a href=&quot;http://www.loudthinking.com/posts/36-work-on-what-you-use-and-share-the-rest&quot;&gt;Rails n'est pas DHH&lt;/a&gt;. Rails devient vraiment un consensus de rubyiste. La cible n'est pas d'avoir le meilleur framework web en Ruby. Mais d'avoir le meilleur framework en informatique. Combattre ensemble le Java, le .NET ou le PHP. Tous les d&#233;veloppeurs ruby en sont persuad&#233;, c'est &#233;vident. Mais tous les d&#233;veloppeurs web ne sont pas rubyiste.&lt;/p&gt;

&lt;p&gt;Pour ma part, j'ai &#233;tudier derni&#232;rement Merb et j'en ai &#233;t&#233; tr&#232;s content. J'avais m&#234;me commencer des projets open source en Merb. Apr&#232;s une longue r&#233;flexion j'ai d&#233;cid&#233; de continuer d'utiliser Merb sur ces projets qui &#233;tait assez jeunes aurait tr&#232;s bien pu migrer facilement en Rails. Par contre, j'utiliserais DataMapper comme ORM et essayerais de contribuer &#224; ce merveilleux projet. Qui lui finalement re&#231;oit une grosse pub car il sera possible de l'utiliser dans Rails 3.&lt;/p&gt;

&lt;p&gt;Pour les curieux, voici les &lt;a href=&quot;http://shingara.fr/export/merb-rails-merge-on-merb-channel.log&quot;&gt;logs de la soir&#233;e IRC sur le chan #merb&lt;/a&gt; o&#249; l'activit&#233; a &#233;t&#233; tr&#232;s intense apr&#232;s l'annonce sur merge.&lt;/p&gt;

&lt;p&gt;Finalement, il ne faut avoir qu'un seul mot d'ordre, allez Rails 3 et Joyeux No&#235;l.&lt;/p&gt;

</description>
      <pubDate>Wed, 24 Dec 2008 14:13:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:a66488b5-e90d-45ab-86bf-39f8e77c3f70</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/le-noel-de-la-fusion-entre-merb-et-rails-quen-penser.html#comments</comments>
      <category>ruby</category>
      <category>reflexion</category>
      <category>ruby_on_rails</category>
      <category>avenir</category>
      <category>merb</category>
      <link>http://blog.shingara.fr/le-noel-de-la-fusion-entre-merb-et-rails-quen-penser.html</link>
    </item>
    <item>
      <title>Les named_scope en pratique sur une recherche</title>
      <description>&lt;p&gt;J'ai longtemps &#233;t&#233; sceptique sur l'int&#233;r&#234;t des &lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/NamedScope/ClassMethods.html#M001906&quot;&gt;named_scope de Ruby On Rails&lt;/a&gt;. &#199;a permet d'avoir une lecture plus simple. Mais ne voyant pas un syst&#232;me d'eager loading si on ne les utilisait pas imm&#233;diatement, je trouvais cela dommage. Finalement apr&#232;s une grosse recherche, j'ai fini par en cr&#233;er un exemple que je pense vraiment int&#233;ressant d'utilisation des named_scope. La mise en pratique a eu lieu sur &lt;a href=&quot;http://typosphere.org&quot;&gt;Typo&lt;/a&gt; avec un &lt;a href=&quot;http://github.com/fdv/typo/commit/6f8ecf60f8d3ab3645f4f29766372b06dd66ef78&quot;&gt;commit de refactoring&lt;/a&gt;. Voici donc un extra de code qui parle de lui m&#234;me.&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;&lt;pre&gt;&lt;notextile&gt;&lt;span class=&quot;CodeRay&quot;&gt;&lt;span class=&quot;r&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;Article&lt;/span&gt;

   named_scope &lt;span class=&quot;sy&quot;&gt;:published_at_like&lt;/span&gt;, lambda {|date_at| {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;published_at LIKE ? &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;date_at&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]}}
   named_scope &lt;span class=&quot;sy&quot;&gt;:user_id&lt;/span&gt;, lambda {|user_id| {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user_id = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, user_id]}}
   named_scope &lt;span class=&quot;sy&quot;&gt;:published&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;published = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;]}
   named_scope &lt;span class=&quot;sy&quot;&gt;:not_published&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;published = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;]}
   named_scope &lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt;, lambda {|category_id| {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;categorizations.category_id = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, category_id], &lt;span class=&quot;sy&quot;&gt;:include&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;categorizations&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;}}
   named_scope &lt;span class=&quot;sy&quot;&gt;:draft&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;state = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;draft&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]}
   named_scope &lt;span class=&quot;sy&quot;&gt;:no_draft&lt;/span&gt;, {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;state &amp;lt;&amp;gt; ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;draft&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;], &lt;span class=&quot;sy&quot;&gt;:order&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;created_at DESC&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;}
   named_scope &lt;span class=&quot;sy&quot;&gt;:searchstring&lt;/span&gt;, lambda {|search_string|
     tokens = search_string.split.collect {|c| &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;c.downcase&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;}
     {&lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [([&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(LOWER(body) LIKE ? OR LOWER(extended) LIKE ? OR LOWER(title) LIKE ?)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;]*tokens.size).join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; AND &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;),
                       *tokens.collect{ |token| [token] * &lt;span class=&quot;i&quot;&gt;3&lt;/span&gt; }.flatten]}
   }

   &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;pc&quot;&gt;self&lt;/span&gt;.search_no_draft_paginate(search_hash, paginate_hash)
      list_function  = [&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Article.no_draft&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;]
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash.nil?
        search_hash = {}
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:searchstring&lt;/span&gt;]
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;searchstring(search_hash[:searchstring])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:published_at&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;%r{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)-(&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\d&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt; =~ search_hash[&lt;span class=&quot;sy&quot;&gt;:published_at&lt;/span&gt;]
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;published_at_like(search_hash[:published_at])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:user_id&lt;/span&gt;] &amp;amp;&amp;amp; search_hash[&lt;span class=&quot;sy&quot;&gt;:user_id&lt;/span&gt;].to_i &amp;gt; &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user_id(search_hash[:user_id])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:published&lt;/span&gt;]
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;published&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:published&lt;/span&gt;].to_s == &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;not_published&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:published&lt;/span&gt;].to_s == &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;and&lt;/span&gt; search_hash[&lt;span class=&quot;sy&quot;&gt;:category&lt;/span&gt;].to_i &amp;gt; &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;
        list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;category(search_hash[:category])&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;
      
      paginate_hash[&lt;span class=&quot;sy&quot;&gt;:order&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;created_at DESC&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
      list_function &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;paginate(paginate_hash)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
      eval(list_function.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;))                                                                                        
    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/notextile&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Par contre si vous avez encore une meilleur m&#233;thode, je suis preneur. C'est surtout le eval qui m'emb&#234;te un peu :(&lt;/p&gt;

</description>
      <pubDate>Wed, 03 Dec 2008 22:03:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:741f30b3-7bef-4d70-befd-8f094cfddf0f</guid>
      <author>cyril.mougel@gmail.com (Cyril Mougel)</author>
      <comments>http://blog.shingara.fr/les-named_scope-en-pratique-sur-une-recherche.html#comments</comments>
      <category>ruby</category>
      <category>ruby_on_rails</category>
      <category>typo</category>
      <category>named_scope</category>
      <category>refactoring</category>
      <link>http://blog.shingara.fr/les-named_scope-en-pratique-sur-une-recherche.html</link>
    </item>
  </channel>
</rss>
