<?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"
	>

<channel>
	<title>YAB &#187; gem</title>
	<atom:link href="http://blog.alexgirard.com/tag/gem/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexgirard.com</link>
	<description>Yet Another Blog</description>
	<pubDate>Sat, 15 Nov 2008 01:14:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>[Ruby] Delicious gem to play with bookmarks</title>
		<link>http://blog.alexgirard.com/ruby-delicious-gem-to-play-with-bookmarks/</link>
		<comments>http://blog.alexgirard.com/ruby-delicious-gem-to-play-with-bookmarks/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 18:00:08 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bookmark]]></category>

		<category><![CDATA[del.icio.us]]></category>

		<category><![CDATA[gem]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubyforge]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/2007/10/31/ruby-delicious-gem-to-play-with-bookmarks/</guid>
		<description><![CDATA[One of my favorite tool is Del.icio.us, simply adding list of bookmarks to be shared with anybody, it&#8217;s easy enough to scrap a big list of HTML links to quickly make something more shareable, like Freeduino.org becoming http://del.icio.us/freeduino
So here is a quick ruby gem to play even more, just install it:

sudo gem install rdelicious

Then play [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite tool is <a href="http://Del.icio.us">Del.icio.us</a>, simply adding list of bookmarks to be shared with anybody, it&#8217;s easy enough to scrap a big list of HTML links to quickly make something more shareable, like <a href="http://Freeduino.org">Freeduino.org</a> becoming <a href="http://del.icio.us/freeduino">http://del.icio.us/freeduino</a></p>
<p>So here is a quick ruby gem to play even more, just install it:</p>
<pre class="prettyprint">
sudo gem install rdelicious
</pre>
<p>Then play with it:</p>
<pre class="prettyprint">
require 'rubygems'
require 'rdelicious'

@delicious = Rdelicious.new("delicious_login", "delicious_password")

print "Correct login" if @delicious.is_connected?

@delicious.add("http://rdelicious.rubyforge.net/", "Rdelicious Gem")

if @delicious.url_exists?("http://rdelicious.rubyforge.net/")
	print "Url inserted into delicious"
end

@delicious.delete("http://rdelicious.rubyforge.net")

unless @delicious.url_exists?("http://rdelicious.rubyforge.net/")
	print "Url deleted from delicious"
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/ruby-delicious-gem-to-play-with-bookmarks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[Ruby] God monitor</title>
		<link>http://blog.alexgirard.com/ruby-god-monitor/</link>
		<comments>http://blog.alexgirard.com/ruby-god-monitor/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 17:00:43 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[gem]]></category>

		<category><![CDATA[god]]></category>

		<category><![CDATA[madrid]]></category>

		<category><![CDATA[monitor]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/2007/09/10/ruby-god-monitor/</guid>
		<description><![CDATA[Update: this script, from September 2007, is a bit out-dated, you can get more info on official God gem website.
Looking for a ruby programmer? Contact me
After many ways to monitor Feevy updaters, we&#8217;re finally using God gem today to manage everything with Ruby on many platforms.
Documentation is really clear, and it&#8217;s easy to adapt it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: this script, from September 2007, is a bit out-dated, you can get more info on <a href="http://god.rubyforge.org/">official God gem website</a>.</p>
<p><strong>Looking for a ruby programmer?</strong> <a href="mailto:alx.girard@gmail.com">Contact me</a></p>
<p>After many ways to monitor Feevy updaters, we&#8217;re finally using <a href="http://god.rubyforge.org/">God gem</a> today to manage everything with Ruby on many platforms.</p>
<p>Documentation is really clear, and it&#8217;s easy to adapt it to your own code. The nicest point was to be able to control our non-daemonized updaters, and monitor them all in the same tool.</p>
<p>Here is our script:</p>
<pre class="prettyprint">
require 'rubygems'
require 'god'

ROOT = File.dirname(__FILE__)

God.init do |god|
  god.pid_file_directory = "#{ROOT}/pids"
end

[*0...20].each do |updater|
  God.watch do |w|
    # watch with no pid_file attribute set
    w.name = "updater_#{updater}"
    w.interval = 30.seconds # default
    w.start = "ruby #{ROOT}/updater.rb"
    w.grace = 10.seconds

    w.behavior(:clean_pid_file)

    w.start_if do |start|
      start.condition(:process_running) do |c|
        c.interval = 5.seconds
        c.running = false
      end
    end

    w.restart_if do |restart|
      restart.condition(:memory_usage) do |c|
        c.above = 150.megabytes
        c.times = [3, 5] # 3 out of 5 intervals
      end

      restart.condition(:cpu_usage) do |c|
        c.above = 50.percent
        c.times = 5
      end
    end
  end
end
</pre>
<p>[updated]: thanks to apeiros on irc://#ruby@irc.freenode.net for quick array initialization tips!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/ruby-god-monitor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[Ruby] RFeedFinder and RFeedReader</title>
		<link>http://blog.alexgirard.com/ruby-rfeedfinder-and-rfeedreader/</link>
		<comments>http://blog.alexgirard.com/ruby-rfeedfinder-and-rfeedreader/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 10:43:31 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[feevy]]></category>

		<category><![CDATA[gem]]></category>

		<category><![CDATA[rfeedfinder]]></category>

		<category><![CDATA[rfeedreader]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubyforge]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/2007/09/04/ruby-rfeedfinder-and-rfeedreader/</guid>
		<description><![CDATA[In the refactoring process of Feevy.com (mostly to remove dirty spaghetti code), I&#8217;ve write my first 2 ruby gems, with some time to learn and practice with new toys for ruby.
Rubyforge
http://www.rubyforge.org
That&#8217;s the place that hosted most of rubygems and is the most useful to deploy your own, it comes with all you need to start [...]]]></description>
			<content:encoded><![CDATA[<p>In the refactoring process of <a href="http://www.feevy.com">Feevy.com</a> (mostly to remove dirty spaghetti code), I&#8217;ve write my first 2 ruby gems, with some time to learn and practice with new toys for ruby.</p>
<h1>Rubyforge</h1>
<p><a href="http://www.rubyforge.org">http://www.rubyforge.org</a></p>
<p>That&#8217;s the place that hosted most of rubygems and is the most useful to deploy your own, it comes with all you need to start and deploy a project: svn, webspace, bug tracker, forum&#8230;<br />
But it would be a pain to deploy everything by hand, a gem is available to do it quicker.</p>
<h1>New Gem</h1>
<p><a href="http://newgem.rubyforge.org/">http://newgem.rubyforge.org/</a></p>
<p>It&#8217;s a simple gem that would generate for you an environment where to build your gem, with a few rake tasks to easily deploy it locally and on rubyforge.</p>
<p>Configuration is simple, just replace &#8216;<em>FIXME</em>&#8216; in code with what is needed and start coding your new gem.</p>
<p>To deploy on Rubyforge, don&#8217;t forget to <a href="http://newgem.rubyforge.org/rubyforge.html">setup your access</a> on your local machine.</p>
<h1>RFeedFinder</h1>
<p><a href="http://rfeedfinder.rubyforge.org/">http://rfeedfinder.rubyforge.org/</a></p>
<p>Main purpose of RFeedFinder is to locate the feed url inside a webpage. It can be really tricky, sometimes using recursion or lucky guesses, but it should work 95% of the time.</p>
<h1>RFeedReader</h1>
<p><a href="http://rfeedreader.rubyforge.org/">http://rfeedreader.rubyforge.org/</a></p>
<p>Once we&#8217;ve got a feed to parse on Feevy, we want to read its first item. That the purpose of this gem.</p>
<p>Another purpose is to use this gem to update Feevy posts from external clients. Feevy server was doing all the job when a feed was updated, now updater clients can parse the feeds too, and return the complete info to Feevy server, so we&#8217;ve another performance boost on the central server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/ruby-rfeedfinder-and-rfeedreader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby: Simple way to download a file</title>
		<link>http://blog.alexgirard.com/ruby-simple-way-to-download-a-file/</link>
		<comments>http://blog.alexgirard.com/ruby-simple-way-to-download-a-file/#comments</comments>
		<pubDate>Fri, 02 Feb 2007 09:11:08 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[dev]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[file]]></category>

		<category><![CDATA[gem]]></category>

		<category><![CDATA[prog]]></category>

		<category><![CDATA[programmation]]></category>

		<category><![CDATA[rio]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubygems]]></category>

		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/2007/02/02/ruby-simple-way-to-download-a-file/</guid>
		<description><![CDATA[Ruby programmers are really lazy geeks:

require 'rubygems'
require 'rio'

rio("http://www.remote.com/file.jpg") > rio("#{RAILS_ROOT}/public/images/")

Rio gem RDoc
]]></description>
			<content:encoded><![CDATA[<p>Ruby programmers are really lazy geeks:</p>
<pre class="prettyprint">
require 'rubygems'
require 'rio'

rio("http://www.remote.com/file.jpg") > rio("#{RAILS_ROOT}/public/images/")
</pre>
<p><a href="http://rio.rubyforge.org/">Rio gem RDoc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/ruby-simple-way-to-download-a-file/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
