<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>D-Sites</title>
	<atom:link href="http://www.d-sites.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.d-sites.com</link>
	<description>Web, PHP, Python, …</description>
	<lastBuildDate>Wed, 09 May 2012 13:15:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Gentoo: utiliser le Portage Overlay pour patcher des ebuilds</title>
		<link>http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/</link>
		<comments>http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 09:43:27 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Adm. Système]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[overlay]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1162</guid>
		<description><![CDATA[TweetDans un article précédent, j&#8217;expliquais comment patcher un package Gentoo via le répertoire /etc/portage/patches/. Cependant, pour utiliser cette méthode, il faut que l&#8217;ebuild appelle la fonction epatch_user dans le src_prepare. Lorsque ce n&#8217;est pas le cas, vous ne pouvez donc &#8230; <a href="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F19%2Fgentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/" data-text="Gentoo: utiliser le Portage Overlay pour patcher des ebuilds">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/"></su:badge></span></span></div><p>Dans un article précédent, j&#8217;expliquais <a href="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/">comment patcher un package Gentoo via le répertoire <code>/etc/portage/patches/</code></a>. Cependant, pour utiliser cette méthode, il faut que l&#8217;ebuild appelle la fonction <code>epatch_user</code> dans le <code>src_prepare</code>.</p>
<p>Lorsque ce n&#8217;est pas le cas, vous ne pouvez donc pas utiliser cette méthode. Pour cela, vous pouvez créer votre propre ebuild à partir du <em>tree</em> officiel dans votre portage overlay.</p>
<h1>Configurer le portage overlay</h1>
<p>Pour configurer le portage overlay, il vous suffit d&#8217;ajouter la ligne suivante dans le fichier <code>/etc/make.conf</code>:</p>
<pre>PORTDIR_OVERLAY="/usr/local/portage"</pre>
<p>Ainsi, votre overlay est situé dans le dossier <code>/usr/local/portage</code>.</p>
<h1>Modifier un ebuild</h1>
<p>Si par exemple, vous voulez modifier le package <code>dev-php/xdebug</code>, il vous suffit de copier le fichier ebuild dans votre package overlay:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mkdir -p /usr/local/portage/dev-php/xdebug/
cp /usr/portage/dev-php/xdebug/xdebug-2.1.2.ebuild /usr/local/portage/dev-php/xdebug/xdebug-2.1.2.ebuild</pre></div></div>

<p>Il vous suffit d&#8217;ajouter la fonction <code>post_src_prepare</code> pour y appeler la fonction <code>epatch_user</code> comme ceci:</p>
<pre>post_src_prepare () {
    epatch_user
}</pre>
<p>Ensuite, il faut générer le fichier <code>Manifest</code> grâce à l&#8217;outil <code>ebuild</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">cd /usr/local/portage/dev-php/xdebug/
ebuild xdebug-2.1.2.ebuild manifest</pre></div></div>

<p>Maintenant, <code>emerge</code> va tout d&#8217;abord récupérer le package depuis vote overlay, et va donc appliquer les patches de votre dossier <code>/etc/portage/patches/dev-php/xdebug/</code>.</p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F19%2Fgentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/" data-text="Gentoo: utiliser le Portage Overlay pour patcher des ebuilds">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/04/19/gentoo-utiliser-le-portage-overlay-pour-patcher-des-ebuilds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 2.X, TypeError: must be type, not classobj avec super()</title>
		<link>http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/</link>
		<comments>http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 10:13:27 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[classobj]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[super]]></category>
		<category><![CDATA[typeerror]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1157</guid>
		<description><![CDATA[TweetSi vous tombez sur l&#8217;erreur TypeError: must be type, not classobj en Python en essayant d&#8217;appeler la méthode super(), c&#8217;est très probablement que vous avez oublié de définir vos classes en new-styled. En effet, si vous avez défini vos classes &#8230; <a href="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F14%2Fpython-2-x-typeerror-must-be-type-not-classobj-avec-super%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/" data-text="Python 2.X, TypeError: must be type, not classobj avec super()">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/"></su:badge></span></span></div><p>Si vous tombez sur l&#8217;erreur <code>TypeError: must be type, not classobj</code> en Python en essayant d&#8217;appeler la méthode <code>super()</code>, c&#8217;est <strong>très probablement</strong> que vous avez oublié de définir vos classes en <em>new-styled</em>.</p>
<p>En effet, si vous avez défini vos classes de cette manière, vous aurez l&#8217;erreur:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> X:
   <span style="color: #ff7700;font-weight:bold;">def</span> a<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
     <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;a&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Y<span style="color: black;">&#40;</span>X<span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">def</span> a<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
     <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>Y,<span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">a</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
     <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;b&quot;</span></pre></div></div>

<p>Pour les définir en <em>new-styled</em>, il vous suffit d&#8217;ajouter <code>object</code> comme classe parent de la première. Ainsi, votre code corrigé est:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> X<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">def</span> a<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
     <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;a&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Y<span style="color: black;">&#40;</span>X<span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">def</span> a<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
     <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>Y,<span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">a</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
     <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;b&quot;</span></pre></div></div>

<p>Et tout fonctionne! <img src='http://www.d-sites.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F14%2Fpython-2-x-typeerror-must-be-type-not-classobj-avec-super%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/" data-text="Python 2.X, TypeError: must be type, not classobj avec super()">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/04/14/python-2-x-typeerror-must-be-type-not-classobj-avec-super/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo: utiliser des patches maison avec emerge</title>
		<link>http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/</link>
		<comments>http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 06:00:01 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Adm. Système]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[emerge]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[patches]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1153</guid>
		<description><![CDATA[TweetIl n&#8217;y a pas (ou très peu) de documentation sur comment utiliser vos propres patches sur des packages que vous installez avec emerge sous Gentoo, mais sachez que l&#8217;on peut le faire! En théorie, il suffit d&#8217;ajouter votre patch au &#8230; <a href="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F12%2Fgentoo-utiliser-des-patches-maison-avec-emerge%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/" data-text="Gentoo: utiliser des patches maison avec emerge">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/"></su:badge></span></span></div><p>Il n&#8217;y a pas (ou très peu) de documentation sur comment utiliser vos propres patches sur des packages que vous installez avec <code>emerge</code> sous Gentoo, mais sachez que l&#8217;on peut le faire!<br />
En théorie, il suffit d&#8217;ajouter votre patch au bon endroit, et emerge va le lire et l&#8217;appliquer lors de l&#8217;éxécution du <code>src_prepare()</code>. Il y a cependant des exceptions.</p>
<h2>La fonction <code>epatch_user</code></h2>
<p>C&#8217;est la fonction <code>epatch_user</code> (déclarée dans <code>/usr/portage/eclass/eutils.eclass</code>) qui fait tout le travail. Elle doit être appelée dans le ebuild durant l&#8217;exécution du <code>src_prepare</code>.<br />
Elle parcours le dossier <code>/etc/portage/{category}/{package}/</code> et lance <code>epatch</code> pour appliquer tous les patches (ie tous les fichiers) qui s&#8217;y trouvent!<br />
Par conséquent, pour que vous puissiez utiliser cette fonctionnalité, <strong>l&#8217;ebuild doit être configuré de telle sorte qu&#8217;il appelle la fonction <code>epatch_user</code></strong></p>
<h2>Ajouter notre patch</h2>
<p>Il suffit d&#8217;ajouter le patch dans le répertoire <code>/etc/portage/patches/{category}/{package}</code>, où <code>category</code> est la catégorie de votre package (<code>dev-lang</code> pour PHP par exemple) et <code>package</code> le nom de votre package, avec ou sans numéro de version.<br />
Par exemple, si vous avez un patch <code>xxx.patch</code> pour PHP, copiez-le simplement dans le répertoire <code>/etc/portage/patches/dev-lang/php/</code>, et lorsque <code>emerge</code> préparera la source du ebuild, il appliquera votre patch automatiquement!</p>
<p> <img src='http://www.d-sites.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F12%2Fgentoo-utiliser-des-patches-maison-avec-emerge%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/" data-text="Gentoo: utiliser des patches maison avec emerge">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/04/12/gentoo-utiliser-des-patches-maison-avec-emerge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery: Le scroll est-il à la fin de l&#8217;élément ?</title>
		<link>http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/</link>
		<comments>http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 15:29:18 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1098</guid>
		<description><![CDATA[TweetJe vous présente un petit tip pour jQuery qui peut intéresser: comment savoir si le scroll est à la fin de l&#8217;élément? L’élément peut être un div ou tout simplement la page (document). // L'élément peut être un div... var &#8230; <a href="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F02%2Fjquery-le-scroll-est-il-a-la-fin-de-lelement%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/" data-text="jQuery: Le scroll est-il à la fin de l’élément ?">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/"></su:badge></span></span></div><p>Je vous présente un petit <em>tip</em> pour jQuery qui peut intéresser: comment savoir si le scroll est à la fin de l&#8217;élément? L’élément peut être un <code>div</code> ou tout simplement la page (<code>document</code>).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// L'élément peut être un div...</span>
<span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#scroll'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Ou le document complet</span>
<span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// La variable suivante vaut vrai si le scroll est en bas</span>
<span style="color: #003366; font-weight: bold;">var</span> isScrollBottom <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">scrollTop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;=</span> $<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">scrollHeight</span><span style="color: #339933;">;</span></pre></div></div>


				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F04%2F02%2Fjquery-le-scroll-est-il-a-la-fin-de-lelement%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/" data-text="jQuery: Le scroll est-il à la fin de l’élément ?">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/04/02/jquery-le-scroll-est-il-a-la-fin-de-lelement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application Android &#8220;Les-Horaires&#8221;</title>
		<link>http://www.d-sites.com/2012/03/26/application-android-les-horaires/</link>
		<comments>http://www.d-sites.com/2012/03/26/application-android-les-horaires/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 07:00:53 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[D-Sites]]></category>
		<category><![CDATA[Nouveautées]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[les-horaires]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1107</guid>
		<description><![CDATA[TweetJe vous présente l&#8217;application Android Les-Horaires, qui permet de trouver des points d&#8217;intérêts (commerces, bars, postes, &#8230;) à proximité d&#8217;un lieu ou de vous, et de connaître les horaires d&#8217;ouverture! &#160; Vous trouverez une description sur la page du projet &#8230; <a href="http://www.d-sites.com/2012/03/26/application-android-les-horaires/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F26%2Fapplication-android-les-horaires%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/26/application-android-les-horaires/" data-text="Application Android “Les-Horaires”">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/26/application-android-les-horaires/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/26/application-android-les-horaires/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/26/application-android-les-horaires/"></su:badge></span></span></div><p>Je vous présente l&#8217;application <a href="https://play.google.com/store/apps/details?id=org.dsites.leshoraires">Android Les-Horaires</a>, qui permet de trouver des points d&#8217;intérêts (commerces, bars, postes, &#8230;) à proximité d&#8217;un lieu ou de vous, et de connaître les horaires d&#8217;ouverture!</p>
<p><a href="http://www.d-sites.com/wp-content/uploads/2012/03/screenshot-search.png"><img src="http://www.d-sites.com/wp-content/uploads/2012/03/screenshot-search-180x300.png" alt="" title="screenshot-search" width="180" height="300" class="alignleft size-medium wp-image-1110" /></a><a href="http://www.d-sites.com/wp-content/uploads/2012/03/screenshot-search-results-map.png"><img src="http://www.d-sites.com/wp-content/uploads/2012/03/screenshot-search-results-map-180x300.png" alt="" title="screenshot-search-results-map" width="180" height="300" class="alignright size-medium wp-image-1111" /></a></p>
<p>&nbsp;</p>
<p style="text-align: center;">Vous trouverez une description sur <a href="http://www.d-sites.com/projets/les-horaires/" title="Les-Horaires">la page du projet</a> et vous pouvez télécharger <a href="https://play.google.com/store/apps/details?id=org.dsites.leshoraires">Les-Horaires sur le Google Play Store</a>.</p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F26%2Fapplication-android-les-horaires%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/26/application-android-les-horaires/" data-text="Application Android “Les-Horaires”">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/26/application-android-les-horaires/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/26/application-android-les-horaires/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/26/application-android-les-horaires/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/26/application-android-les-horaires/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin jQuery VInlinEdit: Inline Edit with VI (Command Line) style</title>
		<link>http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/</link>
		<comments>http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 08:00:57 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1090</guid>
		<description><![CDATA[TweetPour les besoins de MyOnlineSSH, j&#8217;ai développé un plugin jQuery qui permet l&#8217;édition d&#8217;un &#60;span&#62; (ou autre) avec un style à la vi, ou plutôt à la ligne de commande. Exemple Vous pourrez trouver deux exemples d&#8217;utilisation dans le répertoire &#8230; <a href="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F24%2Fplugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/" data-text="Plugin jQuery VInlinEdit: Inline Edit with VI (Command Line) style">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/"></su:badge></span></span></div><p>Pour les besoins de <a href="http://www.myonlinessh.com">MyOnlineSSH</a>, j&#8217;ai développé un plugin jQuery qui permet l&#8217;édition d&#8217;un <code>&lt;span&gt;</code> (ou autre) avec un style <em>à la <code>vi</code></em>, ou plutôt à la ligne de commande. </p>
<h2>Exemple</h2>
<p>Vous pourrez trouver deux exemples d&#8217;utilisation dans le répertoire <code>examples</code> du dépôt GitHub. Voici une copie d&#8217;écran de l&#8217;exemple proposant une implémentation <em>ultra-light</em> d&#8217;une saisie de commandes.</p>
<p><a href="http://www.d-sites.com/wp-content/uploads/2012/03/vinlinedit-example-terminal.png"><img src="http://www.d-sites.com/wp-content/uploads/2012/03/vinlinedit-example-terminal.png" alt="" title="vinlinedit-example-terminal" width="413" height="311" class="aligncenter size-full wp-image-1094" /></a></p>
<h2>Téléchager</h2>
<p>La librairie se trouve sur GitHub, le <code>README</code> sert, pour le moment, de documentation. N&#8217;hésitez pas à <em>forker</em> et soumettre des <em>pull requests</em> !</p>
<p><a href="https://github.com/sroze/jquery-plugin-vinlinedit">https://github.com/sroze/jquery-plugin-vinlinedit</a></p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F24%2Fplugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/" data-text="Plugin jQuery VInlinEdit: Inline Edit with VI (Command Line) style">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/24/plugin-jquery-vinlinedit-inline-edit-with-vi-command-line-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: Synchroniser des événements asynchrones</title>
		<link>http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/</link>
		<comments>http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 21:36:28 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Affichage]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[async]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1084</guid>
		<description><![CDATA[TweetUn des problèmes récurrents du développement événementiel est que l&#8217;on a parfois besoin de synchroniser l&#8217;exécution d&#8217;une fonction. En effet, il est parfois important qu&#8217;une fonction finisse avant d&#8217;en appeler une autre, ou bien elle-même une nouvelle fois. Dans mon &#8230; <a href="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F20%2Fjavascript-synchroniser-des-evenements-asynchrones%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/" data-text="JavaScript: Synchroniser des événements asynchrones">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/"></su:badge></span></span></div><p>Un des problèmes récurrents du développement événementiel est que l&#8217;on a parfois besoin de synchroniser l&#8217;exécution d&#8217;une fonction. En effet, il est parfois important qu&#8217;une fonction finisse avant d&#8217;en appeler une autre, ou bien elle-même une nouvelle fois. Dans mon cas, je vais vous montrer comment synchroniser un événement JavaScript (en l’occurrence un <code>keydown</code>) pour que le <em>trigger</em> que vous lui avez affecté ne s&#8217;exécute pas deux fois en parallèle, grâce à une librairie à l&#8217;heure actuelle peu connue: <a href="https://github.com/hagino3000/jsAsyncQueue/">jsAsyncQueue</a>.</p>
<h2>Le problème</h2>
<p>Prenons comme exemple le code JavaScript suivant (utilisant la librairie <a href="http://www.jquery.com">jQuery</a>):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=text]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keydown</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> value <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// De nombreuses et longues opérations sur la variable &quot;value&quot;</span>
    <span style="color: #006600; font-style: italic;">// plus tard...</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dans cet exemple, on récupère la valeur actuelle d&#8217;un <code>input</code> pour la traiter puis mettre à jour la valeur du champ de texte. C&#8217;est un exemple un peu bête mais qui résume bien le problème&#8230; Si j&#8217;appuie rapidement sur mes touches, on comprend bien qu&#8217;on peut avoir plusieurs exécutions de la fonction de <em>trigger</em> en parallèle. Ainsi, la valeur que l&#8217;on a récupéré au début de notre fonction n&#8217;est plus <em>valable</em> à un certain moment parce qu&#8217;une autre exécution du <em>trigger</em> l&#8217;as modifié en parallèle.</p>
<p><span id="more-1084"></span><br />
<h2>La solution</h2>
<p>Ainsi, en utilisant <a href="https://github.com/hagino3000/jsAsyncQueue/">jsAsyncQueue</a>, on va pouvoir faire un système qui attend que le premier <em>trigger</em> soit fini pour lancer le suivant. Cette opération peut entraîner des lenteurs mais revient à définir une fonction comme <code>synchronized</code> en Java par exemple.</p>
<p>Voici donc le code qui résout le problème ci-dessus (n&#8217;oubliez pas d&#8217;include le fichier JavaScript de la librairie):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> queue <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> AsyncQueue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'keyboard-events'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=text]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keydown</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    queue.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        fn<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> value <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// De nombreuses et longues opérations sur la variable &quot;value&quot;</span>
            <span style="color: #006600; font-style: italic;">// plus tard...</span>
&nbsp;
            $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        args<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>e<span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>On créé donc une queue <code>AsyncQueue</code> à laquelle nous allons ajouter la fonction qui doit être lancée avec ses arguments. Ainsi, dès que le <em>worker</em> de la queue arrive à la fonction, il la lance. Le <em>processing</em> des événements <code>keydown</code> est donc bien synchrone maintenant !</p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F20%2Fjavascript-synchroniser-des-evenements-asynchrones%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/" data-text="JavaScript: Synchroniser des événements asynchrones">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/20/javascript-synchroniser-des-evenements-asynchrones/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webistrano: Net::SSH::AuthenticationFailed error</title>
		<link>http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/</link>
		<comments>http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 07:49:45 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Adm. Système]]></category>
		<category><![CDATA[D-Sites]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[authentificationfailed]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[webistrano]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1078</guid>
		<description><![CDATA[TweetSi vous avez une erreur Net::SSH::AuthenticationFailed avec Webistrano (ou Capistrano), vous êtes peut-être en présence du bug de Net::SSH que je vais vous présenter. Avant, vérifiez ces points-ci: Le nom du serveur (et l&#8217;IP qui va derrière) est bon. Le &#8230; <a href="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F16%2Fwebistrano-netsshauthenticationfailed-error%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/" data-text="Webistrano: Net::SSH::AuthenticationFailed error">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/"></su:badge></span></span></div><p>Si vous avez une erreur <code>Net::SSH::AuthenticationFailed</code> avec Webistrano (ou Capistrano), vous êtes peut-être en présence du bug de <code>Net::SSH</code> que je vais vous présenter. Avant, vérifiez ces points-ci:</p>
<ul>
<li>Le nom du serveur (et l&#8217;IP qui va derrière) est bon.</li>
<li>Le nom d&#8217;utilisateur est bon.</li>
<li>Vous pouvez vous connecter à votre serveur en utilisant <code>ssh user@server.example.com</code> en tant que l&#8217;utilisateur qui exécute Webistrano (ie la configuration <code>runner</code>) ou bien l&#8217;utilisateur qui lance le <code>cap</code>.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"> ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: ks2.so.d-sites.com (Net::SSH::AuthenticationFailed: webistrano)</pre></div></div>

<p>Si vous pouvez vous connecter au serveur avec une paire de clé (ou un mot de passe) depuis votre <code>runner</code>, vous pouvez essayer ce correctif. Sinon, cherchez ailleurs, ça n&#8217;est sûrement pas la solution de votre problème. En fait, le problème vient de la librairie <code>Net::SSH</code> de Ruby, qui n&#8217;arrive pas à se connecter si on ne lui passe pas l&#8217;option de configuration <code>auth_methods</code>.</p>
<h2>Pour tester</h2>
<p>Pour être sur que le correctif que je vous propose résoudra votre problème, nous allons tester le déploiement en utilisant le fichier CAP directement. En fait, c&#8217;est le fichier que Webistrano génère pour que Capistrano déploie votre application.<br />
Ainsi, dans Webistrano, cliquez sur le <em>stage</em> de votre projet, puis <em>Export CAP file</em>. Copiez le contenu de ce fichier dans le répertoire de travail du <code>runner</code> de votre <em>stage</em>. Pour moi, le runner est <code>webistrano</code>, le fichier sera donc ici: <code>/home/webistrano/tmp/test-webistrano.cap</code>.</p>
<p>Ajoutez à votre fichier cap la ligne de configuration suivante, avec la section &#8220;TEMPLATE TASKS&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">ssh_options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:auth_methods</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;publickey&quot;</span></pre></div></div>

<p><strong>Note:</strong> si vous utilisez une autre méthode d&#8217;authentification, changez donc le nom&#8230; Vous pourrez trouver une liste exhaustive dans la <a href="http://net-ssh.github.com/ssh/v2/api/classes/Net/SSH.html#M000002">documentation de Net::SSH</a>.</p>
<p>Ensuite, testez le déploiement avec Capistrano, qui est dans le répertoire des librairies de Webistrano. Dans mon exemple, (où la racine de Webistrano est <code>/home/webistrano</code>), je lance le déploiement comme ceci:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">/home/webistrano/vendor/bundler/ruby/1.8/gems/capistrano-2.6.0/bin/cap -v -f /home/webistrano/tmp/test-webistrano.cap deploy</pre></div></div>

<h2>Pour résoudre</h2>
<p><span id="more-1078"></span><br />
Si le déploiement se passe bien, c&#8217;est donc que vous avez le même problème&#8230; Vous devez donc modifier le fichier <code>lib/webistrano/template/base.rb</code> de Webistrano comme décrit dans la <a href="https://github.com/peritor/webistrano/pull/46/files"><em>pull request</em> que j&#8217;ai faite au dépôt GitHub de Webistrano</a>.</p>
<p>Une fois la modification faites, si bête soit-elle, il vous suffit d&#8217;ajouter dans Webistrano la configuration <code>ssh_auth_methods</code> avec pour valeur la même que celle que vous aviez choisi pour <code>ssh_options[:auth_methods]</code>, à savoir <code>publickey</code> pour moi.</p>
<p>Ensuite, le déploiement doit bien se passer! <img src='http://www.d-sites.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
(Après redémarrage du serveur Ruby)</p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F16%2Fwebistrano-netsshauthenticationfailed-error%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/" data-text="Webistrano: Net::SSH::AuthenticationFailed error">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/16/webistrano-netsshauthenticationfailed-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo: Pas de fichier de log avec Postfix</title>
		<link>http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/</link>
		<comments>http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 13:02:52 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Adm. Système]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[rsyslog]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1029</guid>
		<description><![CDATA[TweetAprès avoir mis en place Postfix avec Postfixadmin sur un système Gentoo, je me suis rendu compte qu&#8217;aucun fichier de log n&#8217;était créé par Postfix. En réalité, je n&#8217;avais simplement pas installé rsyslog. Vous pouvez l&#8217;installer comme ceci: # emerge &#8230; <a href="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F14%2Fgentoo-pas-de-fichier-de-log-avec-postfix%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/" data-text="Gentoo: Pas de fichier de log avec Postfix">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/"></su:badge></span></span></div><p>Après avoir mis en place Postfix avec Postfixadmin sur un système Gentoo, je me suis rendu compte qu&#8217;aucun fichier de log n&#8217;était créé par Postfix. En réalité, je n&#8217;avais simplement pas installé <code>rsyslog</code>. Vous pouvez l&#8217;installer comme ceci:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;"># emerge -av rsyslog</pre></div></div>

<p>Éditez maintenant le fichier <code>/etc/rsyslog.conf</code>, et si vous n&#8217;avez pas cette ligne, ajoutez-la:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">mail.*                                                  -/var/log/maillog</pre></div></div>

<p>Le fichier de log <code>/var/log/maillog</code> est créé un contiendra maintenant les logs de Postfix.</p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F14%2Fgentoo-pas-de-fichier-de-log-avec-postfix%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/" data-text="Gentoo: Pas de fichier de log avec Postfix">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/14/gentoo-pas-de-fichier-de-log-avec-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redmine (Ruby) `load_missing_constant&#8217;: Object is not missing constant Issue! (ArgumentError)</title>
		<link>http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/</link>
		<comments>http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 12:41:03 +0000</pubDate>
		<dc:creator>Samuel ROZE</dc:creator>
				<category><![CDATA[Adm. Système]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[load_missing_constant]]></category>
		<category><![CDATA[missing]]></category>
		<category><![CDATA[redmine]]></category>

		<guid isPermaLink="false">http://www.d-sites.com/?p=1046</guid>
		<description><![CDATA[TweetLors de l&#8217;installation conjointe de Webistrano (voir Installer Webistrano avec nginx et PostgreSQL sous Gentoo) et de Redmine (voir Installer Redmine avec PostgreSQL) sur un même serveur, Redmine m&#8217;as quelque peut surpris on me sortant cette erreur: /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:443:in `load_missing_constant': Object &#8230; <a href="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F04%2Fredmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/" data-text="Redmine (Ruby) `load_missing_constant’: Object is not missing constant Issue! (ArgumentError)">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/"></su:badge></span></span></div><p>Lors de l&#8217;installation conjointe de Webistrano (voir <a href="http://www.d-sites.com/2012/03/04/installer-webistrano-avec-nginx-et-postgresql-sous-gentoo/" title="Installer Webistrano avec nginx et PostgreSQL sous Gentoo">Installer Webistrano avec nginx et PostgreSQL sous Gentoo</a>) et de Redmine (voir <a href="http://www.d-sites.com/2009/08/18/installer-redmine-avec-postgresql/" title="Installer Redmine avec PostgreSQL">Installer Redmine avec PostgreSQL</a>) sur un même serveur, Redmine m&#8217;as quelque peut surpris on me sortant cette erreur:</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:443:in `load_missing_constant': Object is not missing constant Issue! (ArgumentError)
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:124:in `send'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:124:in `const_missing'
	from /home/redmine/app/models/project.rb:40
	from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
	from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:291:in `require_or_load'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:451:in `load_missing_constant'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:463:in `load_missing_constant'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:122:in `const_missing'
	from /home/redmine/app/models/principal.rb:22
	from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
	from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:291:in `require_or_load'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:250:in `depend_on'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:162:in `require_dependency'
	from /home/redmine/vendor/plugins/redmine-gitolite/init.rb:2:in `evaluate_init_rb'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin.rb:158:in `evaluate_init_rb'
	from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin.rb:154:in `evaluate_init_rb'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin.rb:48:in `load'
	from /home/redmine/config/../vendor/plugins/engines/lib/engines/plugin.rb:44:in `load'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin/loader.rb:38:in `load_plugins'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin/loader.rb:37:in `each'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/plugin/loader.rb:37:in `load_plugins'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:369:in `load_plugins'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:165:in `process'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `send'
	from /usr/lib64/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
	from /home/redmine/config/environment.rb:24
[...]</pre></div></div>

<p>Après de nombreuses recherches, j&#8217;ai résolu le problème en ajoutant une petite ligne au fichier <code>config/environnement.rb</code> de Redmine:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  config.<span style="color:#9900CC;">gem</span> <span style="color:#996600;">'pg'</span></pre></div></div>

<p>Après la ligne suivante:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  config.<span style="color:#9900CC;">gem</span> <span style="color:#996600;">'coderay'</span>, <span style="color:#ff3333; font-weight:bold;">:version</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'~&gt;1.0.0'</span></pre></div></div>

<p> <img src='http://www.d-sites.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

				<div class="mr_social_sharing_wrapper">
				<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ --><span class="mr_social_sharing"><iframe src="https://www.facebook.com/plugins/like.php?locale=en_US&amp;href=http%3A%2F%2Fwww.d-sites.com%2F2012%2F03%2F04%2Fredmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror%2F&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></span><span class="mr_social_sharing"><a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/" data-text="Redmine (Ruby) `load_missing_constant’: Object is not missing constant Issue! (ArgumentError)">Tweet</a></span><span class="mr_social_sharing"><g:plusone size="medium" href="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/"></g:plusone></span><span class="mr_social_sharing"><script type="IN/Share" data-url="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/" data-counter="right"></script></span><span class="mr_social_sharing"><span class="stumble_horizontal"><su:badge layout="1" location="http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/"></su:badge></span></span></div>]]></content:encoded>
			<wfw:commentRss>http://www.d-sites.com/2012/03/04/redmine-ruby-load_missing_constant-object-is-not-missing-constant-issue-argumenterror/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching using apc
Object Caching 1040/1160 objects using apc

Served from: d-sites.com @ 2012-05-19 11:24:07 -->
