<?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>Stereonaut! &#187; ruby</title>
	<atom:link href="http://stereonaut.net/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://stereonaut.net</link>
	<description>A weblog by David Moreno.</description>
	<lastBuildDate>Mon, 23 Aug 2010 00:45:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Solicito desarrollador Ruby on Rails</title>
		<link>http://stereonaut.net/solicito-desarrollador-ruby-on-rails/</link>
		<comments>http://stereonaut.net/solicito-desarrollador-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:19:12 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[méxico]]></category>
		<category><![CDATA[nabbr]]></category>
		<category><![CDATA[selectable media]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://stereonaut.net/?p=1182</guid>
		<description><![CDATA[Estoy en busca de un desarrollador Ruby y Ruby on Rails para unirse a la empresa en la cual estoy trabajando en Nueva York. La posición es para trabajar permanentemente desde la Ciudad de México en la Col. Roma con muy buenas facilidades, ambiente y un salario altamente competitivo. A continuación la descripción de la [...]]]></description>
			<content:encoded><![CDATA[<p>Estoy en busca de un desarrollador Ruby y Ruby on Rails para unirse a la empresa en la cual estoy trabajando en Nueva York. La posición es para trabajar permanentemente desde la Ciudad de México en la Col. Roma con muy buenas facilidades, ambiente y un salario altamente competitivo.</p>
<p>A continuación la descripción de la oferta:</p>
<blockquote><p><strong>Selectable Media</strong> is looking for a talented engineer to be a major contributor to the development of its new social video platform. You should be a technical generalist who is eager to conquer our most challenging problems and is excited to learn new skills.</p>
<p><strong>Selectable Media</strong> is the leading video distribution network targeted at the Gen Y audience. We make video advertising fun as we provide advertisers with an efficient and effective way to reach the younger demographic. You will be part of a rapidly growing startup as we look to expand our distribution network across social networking and mobile platforms.</p>
<p>Requirements:</p>
<ul>
<li>Strong communication and team working skills</li>
<li>Demonstrated self starter</li>
<li>Ruby &amp; Ruby on Rails backend development</li>
<li>Experience designing software and APIs</li>
<li>Deep understanding of web applications, REST, and HTTP</li>
<li>Knowledge of Nginx and Mongrel</li>
</ul>
<p>Plusses:</p>
<ul>
<li>Proficient with Javascript, JS libraries (ExtJS, jQuery, prototype)</li>
<li>Experience with Git version control</li>
<li>Familiarity with the popular Rails Plugins/Gems</li>
<li>Use and contribute to open source software projects</li>
<li>Knowledge of MongoDB &amp; PHP/mySQL</li>
</ul>
<p>Candidates should reply with a resume and links to any projects they have contributed to.</p></blockquote>
<p>Si estás interesado o sabes de alguien que lo puda estar, por favor enviar resume (en inglés, desde luego) a david@nabbr.com. No me queda más que decir que en realidad es una gran oportunidad y el trabajo es altamente flexible y divertido.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/solicito-desarrollador-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feedbag 0.6</title>
		<link>http://stereonaut.net/feedbag-06/</link>
		<comments>http://stereonaut.net/feedbag-06/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 01:36:59 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[feedbag]]></category>
		<category><![CDATA[gemcutter]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://stereonaut.net/?p=1158</guid>
		<description><![CDATA[I just uploaded Feedbag 0.6 to Gemcutter and GitHub. Just a couple of small nice additions to this version: The undocumented args[:narrow] option has been disabled until further notice. A nice little commit from one of Feedbag&#039;s forks, by Patrick Reagan. Added an executable to find feed URLs directly: Sometimes you need to find the [...]]]></description>
			<content:encoded><![CDATA[<p>I just uploaded <a href="http://axiombox.com/feedbag">Feedbag</a> 0.6 to <a href="http://rubygems.org/gems/feedbag/versions/0.6">Gemcutter</a> and <a href="http://github.com/damog/feedbag">GitHub</a>.</p>
<p>Just a couple of small nice additions to this version:</p>
<ul>
<li>The undocumented <tt>args[:narrow]</tt> option has been disabled until further notice.</li>
<li>A nice little commit from <a href="http://github.com/damog/feedbag/commit/ad7fdaf671b039cac5550b89d20de511b9a2bb14">one</a> of Feedbag&#039;s forks, by Patrick Reagan.</li>
<li>Added an executable to find feed URLs directly:</li>
</ul>
<p>Sometimes you need to find the feed for a URL quickly, not from a script. What I do, and what someone else showed me too, is this:</p>
<pre class="brush: bash">
~ $ irb
-- require &quot;rubygems&quot;
= true
-- require &quot;feedbag&quot;
= true
-- Feedbag.find &quot;http://stereonaut.net&quot;
= [&quot;http://stereonaut.net/feed&quot;, &quot;http://stereonaut.net/tag/feed/&quot;, &quot;http://stereonaut.net/comments/feed/&quot;]
--
</pre>
<p>But now you can simply do:</p>
<pre class="brush: bash">
~ $ feedbag cnn.com http://twitter.com/compupaisa
== cnn.com:
 - http://rss.cnn.com/rss/cnn_topstories.rss
 - http://rss.cnn.com/rss/cnn_latest.rss
== http://twitter.com/compupaisa:
 - http://twitter.com/statuses/user_timeline/119479806.rss
 - http://twitter.com/favorites/119479806.rss
~ $
</pre>
<p>Enjoy the <tt>feedbag</tt> executable on your <tt>$PATH</tt> now!</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/feedbag-06/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting uid on God processes</title>
		<link>http://stereonaut.net/god-uid-gid/</link>
		<comments>http://stereonaut.net/god-uid-gid/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:36:32 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[environment variables]]></category>
		<category><![CDATA[god]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://stereonaut.net/?p=1080</guid>
		<description><![CDATA[I spent some minutes today at work figuring out why a script we use for files and assets propagation wasn&#039;t working when fired up under God, but it actually was working when run as its normal user. The script is a Sinatra application that, upon pings/requests, connects through SSH to different servers on our clusters [...]]]></description>
			<content:encoded><![CDATA[<p>I spent some minutes today at work figuring out why a script we use for files and assets propagation wasn&#039;t working when fired up under <a href="http://god.rubyforge.org/">God</a>, but it actually was working when run as its normal user.</p>
<p>The script is a <a href="http://www.sinatrarb.com">Sinatra</a> application that, upon pings/requests, connects through SSH to different servers on our clusters and execute commands. Details on the implementation are irrelevant here. Since this is automatized, we use key files for the SSH authentication.</p>
<p>When the script was running as the regular user, everything was working fine, but it wasn&#039;t under root. So I figured, <a href="http://net-ssh.rubyforge.org/ssh/v2/api/">Net::SSH</a> was trying to use root&#039;s private keys file. After reading God&#039;s examples I found out that you can also set uid and gid on the watched processes, so that&#039;s what I configured:</p>
<pre class="brush: ruby">
 w.uid = &quot;myuser&quot;
 w.gid = &quot;myuser&quot;
</pre>
<p>However, this was still not working. So I made the script print some verification:</p>
<pre class="brush: ruby">
puts &quot;My uid is: #{Process.uid} and euid: #{Process.euid} and user: #{ENV[&#039;USER&#039;]}&quot;
</pre>
<p>So <tt>Process.uid</tt> and <tt>Process.euid</tt> was correctly printing the UID for &quot;myuser&quot;, but ENV['USER'] was still &quot;root&quot;. I figured that ENV[&quot;HOME&quot;] would be the home directory based on the user, &quot;/root&quot;, so maybe Net::SSH was still trying to read <tt>/root/.ssh/id_rsa</tt>, and it was, quoting Net::SSH&#039;s :keys option:</p>
<blockquote>
<p>
<meta charset="utf-8"></p>
<table class="list" style="margin-top: 2em; margin-right: 2em; margin-bottom: 2em; margin-left: 2em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: black; border-right-color: black; border-bottom-color: black; border-left-color: black; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 221); padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; background-position: initial initial; background-repeat: initial initial; ">
<tbody>
<tr>
<td style="padding-top: 0.2em; padding-right: 0.2em; padding-bottom: 0.2em; padding-left: 0.2em; text-align: center; vertical-align: top; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; "><code>:keys</code></td>
<td style="padding-top: 0.2em; padding-right: 0.2em; padding-bottom: 0.2em; padding-left: 0.2em; text-align: left; vertical-align: top; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; ">This specifies the list of private key files to use&nbsp;<em>instead</em>&nbsp;of the defaults (<code>$HOME/.ssh/id_dsa</code>,&nbsp;<code>$HOME/.ssh2/id_dsa</code>,&nbsp;<code>$HOME/.ssh/id_rsa</code>, and&nbsp;<code>$HOME/.ssh2/id_rsa</code>). The value of this option should be an array of strings.</td>
</tr>
</tbody>
</table>
<p></meta>
</p>
</blockquote>
<p>God correctly runs the process with the given uid/gid but it will not change your environment variables. And there&#039;s nothing wrong with it, all generated processes on Unix systems will inherit its parent&#039;s set of variables. God shouldn&#039;t necessarily have to be different, but in case you mess around with a given user&#039;s environment variables on a process watched by God, remember this post <img src='http://stereonaut.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/god-uid-gid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sync your Twitter followers and friends</title>
		<link>http://stereonaut.net/sync-your-twitter-followers-and-friends/</link>
		<comments>http://stereonaut.net/sync-your-twitter-followers-and-friends/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:30:29 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=898</guid>
		<description><![CDATA[I have a couple of accounts in Twitter (namely @debian and @planetalinux) that are starting to bring a lot of followers (well, at least some of them). And given that I consider these accounts to be Twitter-polite enough, I like to follow the followers back too; however, this task sometimes gets really hard and it&#039;s [...]]]></description>
			<content:encoded><![CDATA[<p>I have a couple of accounts in Twitter (namely @<a href="http://twitter.com/debian">debian</a> and @<a href="http://twitter.com/planetalinux">planetalinux</a>) that are starting to bring a lot of followers (well, at least some of them). And given that I consider these accounts to be Twitter-polite enough, I like to follow the followers back too; however, this task sometimes gets really hard and it&#039;s tiring to go through the followers pages and follow those that I don&#039;t follow yet over and over.</p>
<p>So, I spent a few minutes and came up with this simple Ruby script that uses <a href="http://addictedtonew.com/">John Nunemaker</a>&#039;s awesome <a href="http://twitter.rubyforge.org">Twitter gem</a>.</p>
<pre class="brush: ruby">
#!/opt/local/bin/ruby

require &quot;rubygems&quot;
require &quot;twitter&quot;

httpauth = Twitter::HTTPAuth.new(
	ARGV[0] || &#039;yehyeh&#039;,
	ARGV[1] || &#039;kissm3&#039;
)

base = Twitter::Base.new(httpauth)

i = 0
(base.follower_ids - base.friend_ids).each do |id|
  i += 1
  begin
    base.friendship_create id
  rescue Twitter::General =&gt; e
    puts &quot;#{e.class}: #{e.message}&quot;
  end
end
puts &quot;#{i} new friendships.&quot;

i = 0
(base.friend_ids - base.follower_ids).each do |id|
  i += 1
  base.friendship_destroy id
end
puts &quot;#{i} destroyed friendships.&quot;

puts &quot;#{base.friend_ids.size} friends now.&quot;
puts &quot;#{base.follower_ids.size} followers now.&quot;
</pre>
<p>What this little code does is exactly that, it will start following the followers you don&#039;t follow yet, and it will stop following the people that don&#039;t follow you back, right? Got it? It&#039;s basically synchronizing your friends with your followers. As said, this is particularly helpful when you are maintaining a community account and want to keep up befriending your kind followers <img src='http://stereonaut.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Handling the exception <code>Twitter::General</code> on line 18 is only done because the twitter gem raises it even when you are trying to befriend an account to which you have already requested friendship (like pending requests to protected updates accounts) or those of suspended accounts (spammers).</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/sync-your-twitter-followers-and-friends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubx: Twitter&#039;s Ruby shell</title>
		<link>http://stereonaut.net/rubx-twitters-ruby-shell/</link>
		<comments>http://stereonaut.net/rubx-twitters-ruby-shell/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:32:05 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[axiombox]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[rubx]]></category>
		<category><![CDATA[tli]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=850</guid>
		<description><![CDATA[Rubx, also known as Ruby Boobie, is a nice spoiled girlie bot that runs on Twitter. She listens when you talk to her and when you do, it&#039;ll better be with Ruby: She will interpret your tweet in Ruby and reply to you with what your code returns. How does it work? You send a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://axiombox.com/rubx"><img align="right" class="alignright size-full wp-image-851" title="rubx" src="http://log.damog.net/wp-content/uploads/2009/04/rubx.png" alt="rubx" width="100" height="100" />Rubx</a>, also known as <em>Ruby Boobie</em>, is a nice spoiled girlie bot that runs on Twitter. She listens when you talk to her and when you do, it&#039;ll better be with Ruby: She will interpret your tweet in Ruby and reply to you with what your code returns.</p>
<p>How does it work? You send a message to her:</p>
<blockquote><p><tt>@rubx "The day I was born it was a " &lt;&lt; Time.local(1984, "aug", 8).strftime("%A")</tt></p></blockquote>
<p>And @<a href="http://twitter.com/rubx">rubx</a> will reply:</p>
<blockquote><p><tt>@damog "The day I was born it was a Wednesday"</tt></p></blockquote>
<p>Go see more about her (examples, FAQ, etc) on <a href="http://axiombox.com/rubx">axiombox.com/rubx</a> or on her <a href="http://twitter.com/rubx">Twitter profile</a>.</p>
<p>As we tested the hack, a bunch of people started interacting with Rubx too, <a href="http://twitter.com/anibalrojas/status/1455257553">some people</a> calling her <em>Twitter Line Interface Ruby Interpreter</em>! <img src='http://stereonaut.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . See what other people has tried with her <a href="http://search.twitter.com/search?q=%40rubx">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/rubx-twitters-ruby-shell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Feedbag significantly faster than Rfeedfinder</title>
		<link>http://stereonaut.net/feedbag-significantly-faster-than-rfeedfinder/</link>
		<comments>http://stereonaut.net/feedbag-significantly-faster-than-rfeedfinder/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 21:57:45 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[feedbag]]></category>
		<category><![CDATA[feeds]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=839</guid>
		<description><![CDATA[Alright so Feedbag looks to be significantly faster than Rfeedfinder when tested against different URIs: user system total real log.damog.net: feedbag 0.280000 0.050000 0.330000 ( 1.486712) rfeedfinder 0.140000 0.030000 0.170000 ( 4.259612) http://cnn.com: feedbag 0.200000 0.020000 0.220000 ( 0.703625) rfeedfinder 0.240000 0.030000 0.270000 ( 1.071508) scripting.com: feedbag 0.170000 0.030000 0.200000 ( 0.682292) rfeedfinder 0.220000 0.040000 [...]]]></description>
			<content:encoded><![CDATA[<p>Alright so <a href="http://axiombox.com/feedbag">Feedbag</a> looks to be significantly faster than <a href="http://rfeedfinder.rubyforge.org/">Rfeedfinder</a> when tested against different URIs:</p>
<pre><code>      user     system      total        real
log.damog.net:
 feedbag
  0.280000   0.050000   0.330000 (  1.486712)
  rfeedfinder
  0.140000   0.030000   0.170000 (  4.259612)

http://cnn.com:

 feedbag
  0.200000   0.020000   0.220000 (  0.703625)
  rfeedfinder
  0.240000   0.030000   0.270000 (  1.071508)
scripting.com:
 feedbag
  0.170000   0.030000   0.200000 (  0.682292)
  rfeedfinder
  0.220000   0.040000   0.260000 (  1.668234)
mx.planetalinux.org:
 feedbag
  0.550000   0.050000   0.600000 (  1.636884)
  rfeedfinder
  0.760000   0.120000   0.880000 (  3.189143)

http://feedproxy.google.com/UniversoPlanetaLinux:

 feedbag
  0.030000   0.010000   0.040000 (  0.696871)
  rfeedfinder
  0.160000   0.030000   0.190000 (  1.613874)
</code></pre>
<p>As <a href="http://log.damog.net/2009/02/feedbag-now-using-feedvalidator/">I had previously blogged</a>, Feedbag also can use <a href="http://feedvalidator.rubyforge.org/">feedvalidator</a> to get most accurate results. The results above were tested with <tt>feedvalidator</tt> deactivated, which is the default behavior anyway. When activating it, the following results are seen:</p>
<pre><code>      user     system      total        real
log.damog.net:
 feedbag
  0.390000   0.070000   0.460000 (  3.434350)
  rfeedfinder
  0.170000   0.030000   0.200000 (  2.819837)

http://cnn.com:

 feedbag
Feed looked like feed but might not have passed validation or timed out
  0.200000   0.020000   0.220000 (  1.103810)
  rfeedfinder
  0.200000   0.030000   0.230000 (  1.036161)
scripting.com:
 feedbag
  0.220000   0.030000   0.250000 (  1.282081)
  rfeedfinder
  0.150000   0.040000   0.190000 (  1.520435)
mx.planetalinux.org:
 feedbag
  0.660000   0.050000   0.710000 (  2.784598)
  rfeedfinder
  0.760000   0.110000   0.870000 (  3.984222)

http://feedproxy.google.com/UniversoPlanetaLinux:

 feedbag
  0.050000   0.010000   0.060000 (  1.275603)
  rfeedfinder
  0.170000   0.030000   0.200000 (  2.067279)
</code></pre>
<p>So Rfeedfinder appears to be slightly faster on small pages but even slower than Feedbag with big ones (even when Feedbag calls <tt>feedvalidator</tt> which makes it to make the request twice!). Also, it&#039;s noticeable that Feedbag will return more significant results than Rfeedfinder:</p>
<p><code>&gt;&gt; Feedbag.find "http://log.damog.net"<br />
=&gt; ["http://feeds.feedburner.com/InfinitePigTheorem", "http://log.damog.net/category/feed/", "http://log.damog.net/tag/feed/", "http://github.com/damog/rfeed", "http://log.damog.net/tag/rfeed/", "http://log.damog.net/comments/feed/"]<br />
&gt;&gt; require "rfeedfinder"<br />
=&gt; true<br />
&gt;&gt; Rfeedfinder.feed "http://log.damog.net"<br />
=&gt; "http://feedproxy.feedburner.com/InfinitePigTheorem"</code></p>
<p>After this, it really makes more sense to use Feedbag than Rfeedfinder.</p>
<p>The benchmark code can be found <a href="http://github.com/damog/feedbag/blob/bb091ae9ff6c54883763fb62f99ed746a66fb259/benchmark/rfeedfinder_benchmark.rb">here</a>. As I wrote the bechmark test, I did put the Feedbag requests first in order to make it less likely to have better results for Feedbag for a possible cache favoring it, even then, Feedbag was superior.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/feedbag-significantly-faster-than-rfeedfinder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>lib/active_record/base.rb:2808:in `attributes_with_quotes&#039;: undefined method `each&#039; for true:TrueClass (NoMethodError)</title>
		<link>http://stereonaut.net/libactive_recordbaserb2808in-attributes_with_quotes-undefined-method-each-for-truetrueclass-nomethoderror/</link>
		<comments>http://stereonaut.net/libactive_recordbaserb2808in-attributes_with_quotes-undefined-method-each-for-truetrueclass-nomethoderror/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:49:54 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[in-english]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[issues]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=822</guid>
		<description><![CDATA[OK, hopefully this might help someone some time somewhere. If you are getting the error on the title, it&#039;s mainly because you are using a changed method on your ActiveRecord model. I was working with an ActiveRecord model that handles an string with quotes, so when trying to save the model, that exception was raised. [...]]]></description>
			<content:encoded><![CDATA[<p>OK, hopefully this might help someone some time somewhere. If you are getting the error on the title, it&#039;s mainly because you are using a <tt>changed</tt> method on your <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html">ActiveRecord</a> model.</p>
<p>I was working with an ActiveRecord model that handles an string with quotes, so when trying to save the model, that exception was raised. The problem is that ActiveRecord uses a <tt>changed</tt> method internally for all attributes that were modified. When you are using a changed method yourself, you are overwriting it, hence the error. In my case:</p>
<p><tt>/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2808:in `attributes_with_quotes': undefined method `each' for true:TrueClass (NoMethodError)<br />
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2706:in `update_without_lock'</tt></p>
<p>Solution, just get rid of your changed method and rename it something else.</p>
<p>Also helpful information, <a href="http://www.ruby-forum.com/topic/173908">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/libactive_recordbaserb2808in-attributes_with_quotes-undefined-method-each-for-truetrueclass-nomethoderror/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Re: On DebGem</title>
		<link>http://stereonaut.net/re-on-debgem/</link>
		<comments>http://stereonaut.net/re-on-debgem/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 15:40:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[in-english]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[debgem]]></category>
		<category><![CDATA[gem]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=780</guid>
		<description><![CDATA[Wouter, I find your thinking on DebGem a bit overreacted. I think you are taking the product and commercial efforts that a company make as the proposed solution we&#039;ve all been expecting for a similar problem, which is not. You are considering DebGem to be an outcome provided by the Ruby community, which is not, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.grep.be/blog/en/computer/debian/debgem">Wouter</a>, I find your thinking on <a href="http://debgem.phusion.nl/">DebGem</a> a bit overreacted. I think you are taking the product and commercial efforts that a company make as the proposed solution we&#039;ve all been expecting for a similar problem, which is not. You are considering DebGem to be an outcome provided by the Ruby community, which is not, to this issue.</p>
<p><a href="http://www.phusion.nl/about.html">Phusion</a> is obviously not the Ruby community, but part of it. How I see it, it&#039;s great: I applaud that more companies take a look at nice technologies and try to provide their own products. Since I do most of my work with both technologies (and others), Debian and Ruby, I find DebGem worth giving it a try, and if it solves the installation problems of some gems on different systems for me, my employer and the systems I maintain, why not pay for it. However that&#039;s all you can expect it to do, solve your gem installation problems and that&#039;s it, they are not proposing to change how gems are done or how Ruby libraries are implemented as packages in Debian, they are just a bridge, a shortcut, nothing else, nothing more. And if that bridge works and is well built and maintained, hurrah!</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/re-on-debgem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby goodies: Modules and methods for my everyday Ruby</title>
		<link>http://stereonaut.net/ruby-goodies-modules-and-methods-for-my-everyday-ruby/</link>
		<comments>http://stereonaut.net/ruby-goodies-modules-and-methods-for-my-everyday-ruby/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 04:27:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[goodies]]></category>
		<category><![CDATA[in-english]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=770</guid>
		<description><![CDATA[I make a lot of Web script processing, whether scraping, webservices, systems administration, etc. Because I sometimes happen to repeat small and useful chunks of code for different projects, I thought that, given making new modules and methods is usually hassleless in Ruby, I should make my own set of methods and goodies I constantly [...]]]></description>
			<content:encoded><![CDATA[<p>I make a lot of Web script processing, whether scraping, webservices, systems administration, etc. Because I sometimes happen to repeat small and useful chunks of code for different projects, I thought that, given making new modules and methods is usually hassleless in Ruby, I should make my own set of methods and goodies I constantly use. Example 1, I sometimes miss Perl&#039;s LWP::Simple simplicity where I just pass a URL to a subroutine and get the content on a variable, quick, one-liner. Example 2, extract all links on a given URL on an array that I can then iterate and maybe fetch given the first example. Getting all A links is very easy to do, say with regex or with Hpricot (which should the best way to parse HTML), but most of the time I (and people, I&#039;d bet) need absolute URLs which is fairly more complex (relative, absolute URLs, BASE href declarations, etc, the same case as in <a href="http://axiombox.com/feedbag">Feedbag</a>).</p>
<p>Well, for different cases like that one, I&#039;ve started my own set of Ruby goodies. If you don&#039;t find them useful, I understand, they are mostly for my <strongown</strong> needs, I just want to make it public, because maybe, some other people might indeed find them useful.</p>
<p>Simple installation:</p>
<pre><code>sudo gem install damog-goodies -s http://gems.github.com/</code></pre>
<p>As time and needs pass, I will be adding stuff into it. For the time being, here&#039;s both above examples in action:</p>
<pre><code>
>> require "goodies"
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/array.rb
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/lwr.rb
requiring /var/lib/gems/1.8/gems/damog-goodies-0.1/lib/goodies/html.rb
=> true
>> pp HTML::Links.find "damog.net"
["mailto:david-YOUKNOWTHEDEAL-axiombox.com",
 "http://log.damog.net/",
 "http://historiasdenuevayork.com",
 "http://axiombox.com/",
 "http://flickr.com/photos/raquelydavid",
 "http://last.fm/user/damog",
 "http://maggit.com.mx",
 "http://twitter.com/damog",
 "http://www.facebook.com/profile.php?id=670490388",
 "http://www.chess.com?ref_id=1380378",
 "http://www.chess.com",
 "http://www.chess.com/members/view/damog?ref_id=1380378",
 "http://www.chess.com/echess/create_game.html?uid=1380378&#038;ref_id=1380378",
 "http://www.chess.com/home/game_archive.html?member=damog&#038;ref_id=1380378"]
=> nil
>> pp HTML::Links.find("http://google.com").first(10)
["http://images.google.com/imghp?hl=en&#038;tab=wi",
 "http://maps.google.com/maps?hl=en&#038;tab=wl",
 "http://news.google.com/nwshp?hl=en&#038;tab=wn",
 "http://www.google.com/prdhp?hl=en&#038;tab=wf",
 "http://mail.google.com/mail/?hl=en&#038;tab=wm",
 "http://www.google.com/intl/en/options/",
 "http://video.google.com/?hl=en&#038;tab=wv",
 "http://groups.google.com/grphp?hl=en&#038;tab=wg",
 "http://books.google.com/bkshp?hl=en&#038;tab=wp",
 "http://scholar.google.com/schhp?hl=en&#038;tab=ws"]
=> nil
>> get "debian.org"
[snip]
>> get("planeta.debian.net")[0, 100]
=> "&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
>>
</code></pre>
<p>Repository is, as usual, kindly hosted at <a href="http://github.com">GitHub</a> on <a href="http://github.com/damog/goodies">damog/goodies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/ruby-goodies-modules-and-methods-for-my-everyday-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Feedbag: Feed auto-discovery Ruby library/tool</title>
		<link>http://stereonaut.net/introducing-feedbag-feed-auto-discovery-ruby-librarytool/</link>
		<comments>http://stereonaut.net/introducing-feedbag-feed-auto-discovery-ruby-librarytool/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 23:58:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[feed]]></category>
		<category><![CDATA[feedbag]]></category>
		<category><![CDATA[in-english]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=766</guid>
		<description><![CDATA[Last week, I spent some time building a good (that I liked) feed auto-discovery tool to use in Ruby for other project I&#039;m building, rFeed. I liked CPAN&#039;s Feed::Find, and at some point I made a wrapper class to run a Perl script using such module, however, I wasn&#039;t happy by mixing it all. So, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I spent some time building a good (that I liked) feed auto-discovery tool to use in Ruby for other project I&#039;m building, <a href="http://github.com/damog/rfeed">rFeed</a>. I liked CPAN&#039;s <a href="http://search.cpan.org/~btrott/Feed-Find-0.06/lib/Feed/Find.pm">Feed::Find</a>, and at some point I made a wrapper class to run a Perl script using such module, however, I wasn&#039;t happy by mixing it all. So, <a href="http://axiombox.com/feedbag">Feedbag</a> was born:</p>
<pre><code>&gt;&gt; require "rubygems"
=&gt; true
&gt;&gt; require "feedbag"
=&gt; true
&gt;&gt; Feedbag.find "log.damog.net"
=&gt; ["http://feeds.feedburner.com/TeoremaDelCerdoInfinito",
 "http://log.damog.net/comments/feed/"]</code><span class="go">
</span><code>&gt;&gt; planet_feeds = Feedbag.find("planet.debian.org")
[ ... ]
&gt;&gt; planet_feeds.first(3)
=&gt; ["http://planet.debian.org/rss10.xml",
 "http://planet.debian.org/rss20.xml",
 "http://planet.debian.org/atom.xml"]
&gt;&gt;</code><code> planet_feeds.size
=&gt; 104
&gt;&gt;</code></pre>
<p>It makes smart use of relative and absolute bases, hrefs, links, content types, etc. It is also a single Ruby file, so you can grab it and use it on your application. Plus, it only requires <a href="https://code.whytheluckystiff.net/hpricot/">Hpricot</a> as dependency. It can find all feeds linked on a web page, but it will return the most important at the beginning of the resulting array, so you will have the important one on the first results (see example above with Planet Debian).</p>
<p>Synopsis, README and a brief tutorial have been placed at <a href="http://axiombox.com/feedbag">axiombox.com/feedbag</a>. You can also take a look at the <a href="http://github.com/damog/feedbag">git repo</a>, hosted in <a href="http://github.com/">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stereonaut.net/introducing-feedbag-feed-auto-discovery-ruby-librarytool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
