<?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>Simone Carletti&#039;s Blog</title>
	<atom:link href="http://www.simonecarletti.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simonecarletti.com/blog</link>
	<description>Simone Carletti&#039;s personal ramblings on programming, syndication, search engines &#38; marketing.</description>
	<lastBuildDate>Sat, 06 Feb 2010 12:54:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby Whois 1.0 is here!</title>
		<link>http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/</link>
		<comments>http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:54:32 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubywhois]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=986</guid>
		<description><![CDATA[Whois 1.0 is now available: Whois is an intelligent pure Ruby WHOIS client and parser.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ruby-whois.org/">Whois</a> is an intelligent <strong>pure Ruby WHOIS client and parser</strong>.</p>
<p>It is a OS-independent library and doesn’t require external C libraries or Gems: it is a 100% Ruby software with all the advantages and disadvantages that it involves. This software was developed to power RoboDomain and it eventually become a standalone library.</p>
<p>Whois provides the following key features:</p>
<ul>
<li>Pure Ruby library, without any additional dependency</li>
<li>Compatible with Ruby 1.8.6 and greater, including Ruby 1.9</li>
<li>Successfully tested against multiple Ruby platforms and versions including Ruby, Ruby Enterprise Edition and MacRuby</li>
<li>Ability to query registry data for IPv4, IPv6 and top level domains</li>
<li>Ability to parse WHOIS responses</li>
<li>Flexible and extensible interface (ex. You can define custom servers on the fly)</li>
<li>Object oriented design</li>
</ul>
<h2><span id="more-986"></span>Whois 1.0</h2>
<p>Whois 1.0 is the first major release since <a title="Ruby has a new WHOIS library  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/">I started working on the library one year ago</a>. It reached an high level of maturity and stability and you can safely consider it production ready.</p>
<p><a href="http://github.com/weppos/whois/compare/release-0.9.0...release-1.0.0">Compared with previous version</a>, Whois 1.0 includes a really huge CHANGELOG (more than 100 lines!). The most important features are:</p>
<ul>
<li>Updates to existing definitions</li>
<li>48 New WHOIS Parsers</li>
<li>Ability to check <a title="New in Whois: property is set?  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/">whether a property is set</a></li>
<li><a title="New in Whois: command line improvements  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/">Command Line Improvements</a></li>
<li><a title="New in Whois: Applying the Principle of Least Surprise  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/">Changes to the internal Answer/Parser architecture</a> to improve usability</li>
</ul>
<p>Last but not least, <a title="Ruby Whois moved to ruby-whois.org  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/">a dedicated site</a> is now available at <a title="Ruby Whois - Ruby Whois Gem" href="http://www.ruby-whois.org/">ruby-whois.org</a>.</p>
<h2>A Retrospective</h2>
<p>Whois 1.0 is a really important milestone. The <a title="Ruby has a new WHOIS library  –  Simone Carletti's Blog" href="http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/">first Whois release</a> was just another WHOIS library. Yes, it offered support for all existing TLDs, but that was just the beginning. My idea was to creare a library to be able to parse and access all WHOIS responses with a single, standardized, object oriented API.</p>
<p>The current Whois library perfectly fit this milestone. Unfortunately, there&#8217;s still a big number of unsupported server, but I&#8217;m working really hard to reduce the gap. Also, in the last months a small number of users contributed back with servers, patches, changes and I&#8217;m really grateful to them.</p>
<p>If you look at the CHANGELOG, Whois has improved day after day.</p>
<h2>The Client side</h2>
<p>Whois 1.0 is a pure Ruby WHOIS client. It means you can install and use it on any platform where Ruby is supported, including (but not limited to) Microsoft Windows, Linux, MacOSX and Solaris.</p>
<p>This is one of the most important feature, compared with other WHOIS libraries. Whois is shipped with a Command Line Interface you can use to lookup a domain.</p>
<pre class="brush: bash;">$ ruby-whois google.com</pre>
<p>And this works on Windows too!</p>
<p>Whois is an intelligent Whois client. It means, you don&#8217;t need to know anything about WHOIS, Dns or TLD. Simply feed the client with the domain you want to lookup, and wait for the response.</p>
<pre class="brush: ruby; html-script: true;">require 'rubygems'
require 'whois'

a = Whois.query "google.com"
puts a</pre>
<p>Whois will automatically choose the best WHOIS server according to the given query. If the query is a domain, Whois will try to find a server for the corresponding TLD. If the query is an IPv4 or IPv6, Whois will send the request to the corresponding management authority.</p>
<p>TLD and IP definitions are included in the package and read when the library is loaded. You can always update/change them at runtime.</p>
<h2>The Parser side</h2>
<p>Until now, Whois just seems to be an other powerful-but-standard WHOIS client. But this is not true.</p>
<p>The biggest difference between Whois and other WHOIS libraries, is that Whois can parse and decompose a raw WHOIS response into a powerful Ruby object.<br />
This means, you can access WHOIS property calling a simple method rather than dealing with complex regular expressions in order to extract the data you need.</p>
<pre class="brush: ruby; html-script: true;">require 'rubygems'
require 'whois'

a = Whois.query "google.it"
puts a.available?
# =&gt; false

a.nameservers.each do |nameserver|
  puts nameserver
end
# =&gt; ns1.google.com
# =&gt; ns4.google.com
# =&gt; ns2.google.com
# =&gt; ns3.google.com

puts a.created_on
# =&gt; Fri Dec 10 00:00:00 +0100 1999
puts a.expires_on
# =&gt; Sat Nov 27 00:00:00 +0100 2010</pre>
<p>You can read more at <a title="Ruby Whois - Ruby Whois Gem" href="http://www.ruby-whois.org/">ruby-whois.org</a>.</p>
<h2>RoboDomain</h2>
<p>Whois library has been creates to power RoboDomain project. With Robodomain you can <strong>keep track of any domain in one single place</strong>: log transactions, store notes, check domain status and enjoy our network tools.</p>
<p>Be sure to signup for an <a title="RoboDomain" href="http://www.robodomain.com/">invitation code</a> if you want to join the beta program.</p>
<h2>Contribute</h2>
<p>Whois is an <a title="weppos's whois at master - GitHub" href="http://github.com/weppos/whois">open source project</a> and released under the terms of the MIT license.</p>
<p>You can contribute <a title="Issues - weppos/whois - GitHub" href="http://github.com/weppos/whois/issues">by suggesting new features and reporting bugs</a> or you can fork away the project and submit your changes.</p>
<p>Do you have a question? Need an help with the library? <a title="Ruby Whois |   Google Groups" href="http://groups.google.com/group/ruby-whois">Join the discussion group</a>.</p>
<p>Enjoy Ruby Whois 1.0.</p>
<pre class="brush: bash;">$ gem install whois</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/&amp;title=Ruby+Whois+1.0+is+here%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ruby+Whois+1.0+is+here%21+-+http://b2l.me/fp78a+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Ruby+Whois+1.0+is+here%21&amp;link=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/&amp;t=Ruby+Whois+1.0+is+here%21" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/&amp;title=Ruby+Whois+1.0+is+here%21" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/&amp;title=Ruby+Whois+1.0+is+here%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/&amp;title=Ruby+Whois+1.0+is+here%21&amp;summary=Whois%20is%20an%20intelligent%20pure%20Ruby%20WHOIS%20client%20and%20parser.%0D%0A%0D%0AIt%20is%20a%20OS-independent%20library%20and%20doesn%E2%80%99t%20require%20external%20C%20libraries%20or%20Gems%3A%20it%20is%20a%20100%25%20Ruby%20software%20with%20all%20the%20advantages%20and%20disadvantages%20that%20it%20involves.%20This%20software%20was%20developed%20to%20power%20RoboDomain%20and%20it%20eventually%20be&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/' rel='bookmark' title='Permanent Link: Ruby has a new WHOIS library'>Ruby has a new WHOIS library</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-preview-answer-and-parser/' rel='bookmark' title='Permanent Link: Ruby Whois preview: WHOIS answer and parser'>Ruby Whois preview: WHOIS answer and parser</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-0-8-0/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.0'>Ruby Whois 0.8.0</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New in Whois: command line improvements</title>
		<link>http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/</link>
		<comments>http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 20:18:26 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubywhois]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=950</guid>
		<description><![CDATA[The new Whois version comes with an improved CLI with better error handling.]]></description>
			<content:encoded><![CDATA[<p>Whois 0.8.0 was released with a <a href="http://www.simonecarletti.com/blog/2009/12/whois-0-9-0/">new command line tool</a> to perform one-line WHOIS queries.</p>
<pre class="brush: bash;">$ ruby-whois google.com</pre>
<p>WHOIS requests can fail and, unfortunately, the existing version of the CLI <a href="http://code.simonecarletti.com/issues/333">doesn&#8217;t handle this case very well</a>. When an exception is raised, the CLI exits printing an unfriendly Ruby stack trace.<span id="more-950"></span></p>
<pre class="brush: bash;">$ ruby-whois karnaugh.za.net
/Users/weppos/.rvm/ruby-1.8.7-p174/lib/ruby/1.8/timeout.rb:60:in `ask_the_socket': execution expired (Timeout::Error)
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/server/adapters/base.rb:77:in `query_the_socket'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/server/adapters/standard.rb:34:in `request'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/server/adapters/base.rb:52:in `query'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/server/adapters/base.rb:66:in `with_buffer'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/server/adapters/base.rb:51:in `query'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/client.rb:72:in `query'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/lib/whois/client.rb:70:in `query'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/gems/whois-0.8.1/bin/ruby-whois:37
    from /Users/weppos/.rvm/gems/ruby/1.8.7/bin/ruby-whois:19:in `load'
    from /Users/weppos/.rvm/gems/ruby/1.8.7/bin/ruby-whois:19
</pre>
<p>I&#8217;m happy to say that now his is just a bad memory. In case of error, the new CLI writes the error message to <code>STDERR</code> then terminates the execution and sets the <a href="http://www.faqs.org/docs/abs/HTML/exit-status.html">exit status</a> to <code>1</code>.</p>
<pre class="brush: bash;">$ ruby-whois karnaugh.za.net
Request Timeout

$ ruby-whois google.es
This TLD has no whois server, but you can access the whois database at `https://www.nic.es/'
</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/&amp;title=New+in+Whois%3A+command+line+improvements" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=New+in+Whois%3A+command+line+improvements+-+http://b2l.me/fjtxt+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=New+in+Whois%3A+command+line+improvements&amp;link=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/&amp;t=New+in+Whois%3A+command+line+improvements" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/&amp;title=New+in+Whois%3A+command+line+improvements" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/&amp;title=New+in+Whois%3A+command+line+improvements" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/&amp;title=New+in+Whois%3A+command+line+improvements&amp;summary=Whois%200.8.0%20was%20released%20with%20a%20new%20command%20line%20tool%20to%20perform%20one-line%20WHOIS%20queries.%0D%0A%24%20ruby-whois%20google.com%0D%0AWHOIS%20requests%20can%20fail%20and%2C%20unfortunately%2C%20the%20existing%20version%20of%20the%20CLI%20doesn%27t%20handle%20this%20case%20very%20well.%20When%20an%20exception%20is%20raised%2C%20the%20CLI%20exits%20printing%20an%20unfriendly%20Ruby%20st&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/' rel='bookmark' title='Permanent Link: Ruby has a new WHOIS library'>Ruby has a new WHOIS library</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-preview-answer-and-parser/' rel='bookmark' title='Permanent Link: Ruby Whois preview: WHOIS answer and parser'>Ruby Whois preview: WHOIS answer and parser</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/ruby-whois-0-8-1/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.1'>Ruby Whois 0.8.1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/02/new-in-whois-command-line-improvements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby Whois moved to ruby-whois.org</title>
		<link>http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/</link>
		<comments>http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 19:08:44 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubywhois]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=974</guid>
		<description><![CDATA[The Whois 1.0 release is just around the corner and to celebrate the first major release the library is changing home from my Codestuff site to www.ruby-whois.org.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.simonecarletti.com/blog/tags/rubywhois/">Whois 1.0 release</a> is just around the corner and to celebrate the first major release the library is changing home from <a href="http://code.simonecarletti.com/">my Codestuff site</a> to <a href="http://www.ruby-whois.org">ruby-whois.org</a>.</p>
<p>The repository is still hosted on GitHub and in the next days I&#8217;ll probably migrate the issue management as well.</p>
<p>The design of the new Whois website is clearly influenced by this website and <a href="http://tomayko.com/src/rack-cache/">Rack::Cache</a>. All HTML files are automatically generated using <a href="http://github.com/mojombo/jekyll">Jekyll</a>. The new site contains all the existing documentation published on the legacy wiki, reorganized and updated. As soon as Whois 1.0 will be available, I promise to spend some time writing more details about the advanced features such as creating WHOIS parsers and using the answer object.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/&amp;title=Ruby+Whois+moved+to+ruby-whois.org" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ruby+Whois+moved+to+ruby-whois.org+-+http://b2l.me/ffppj+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Ruby+Whois+moved+to+ruby-whois.org&amp;link=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/&amp;t=Ruby+Whois+moved+to+ruby-whois.org" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/&amp;title=Ruby+Whois+moved+to+ruby-whois.org" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/&amp;title=Ruby+Whois+moved+to+ruby-whois.org" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/&amp;title=Ruby+Whois+moved+to+ruby-whois.org&amp;summary=The%20Whois%201.0%20release%20is%20just%20around%20the%20corner%20and%20to%20celebrate%20the%20first%20major%20release%20the%20library%20is%20changing%20home%20from%20my%20Codestuff%20site%20to%20ruby-whois.org.%0D%0A%0D%0AThe%20repository%20is%20still%20hosted%20on%20GitHub%20and%20in%20the%20next%20days%20I%27ll%20probably%20migrate%20the%20issue%20management%20as%20well.%0D%0A%0D%0AThe%20design%20of%20the%20ne&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-preview-answer-and-parser/' rel='bookmark' title='Permanent Link: Ruby Whois preview: WHOIS answer and parser'>Ruby Whois preview: WHOIS answer and parser</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/' rel='bookmark' title='Permanent Link: Ruby has a new WHOIS library'>Ruby has a new WHOIS library</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/12/whois-0-9-0/' rel='bookmark' title='Permanent Link: Whois 0.9.0: WHOIS parsers, CLI and performances'>Whois 0.9.0: WHOIS parsers, CLI and performances</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/02/ruby-whois-moved-to-ruby-whois-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New in Whois: property is set?</title>
		<link>http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 22:46:21 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubywhois]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=937</guid>
		<description><![CDATA[The new Ruby Whois version will offer the ability to check whether a property is set using the standard method? Ruby convention.]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://code.simonecarletti.com/whois">Ruby Whois</a> version <a href="http://github.com/weppos/whois/commit/9f5132c2a70b1736799b2bb79b3c6b3f3c778c61">will offer</a> the ability to check whether a property is set using the standard <code>method?</code> Ruby convention. This means, you no longer need to check whether a property is supported, get the property value and compare it to <code>nil</code>.</p>
<pre class="brush: ruby; html-script: true;">a = Whois.query "google.it"
a.created_on?
# =&gt; true

a = Whois.query "notregistered.it"
a.created_on?
# =&gt; false</pre>
<p><span id="more-937"></span>Two important aspects to keep in mind. First, this method works only at answer level.</p>
<pre class="brush: ruby; html-script: true;">a = Whois.query "google.it"
a.created_on?
# =&gt; true
a.parser.created_on?
# =&gt; NoMethodError</pre>
<p>Second, this method doesn&#8217;t care whether the property is supported or not. It returns <code>false</code> either if the property is not supported or the value is <code>nil</code>.</p>
<pre class="brush: ruby; html-script: true;">a = Whois.query "notregistered.it"

# created_on is a property supported
# by .it TLD parser and empty for this
# specific query
a.created_on?
# =&gt; false

# domain_is is not a property supported
# by .it TLD parser
a.domain_id?
# =&gt; false</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/&amp;title=New+in+Whois%3A+property+is+set%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=New+in+Whois%3A+property+is+set%3F+-+http://b2l.me/eemv4+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=New+in+Whois%3A+property+is+set%3F&amp;link=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/&amp;t=New+in+Whois%3A+property+is+set%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/&amp;title=New+in+Whois%3A+property+is+set%3F" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/&amp;title=New+in+Whois%3A+property+is+set%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/&amp;title=New+in+Whois%3A+property+is+set%3F&amp;summary=The%20new%20Ruby%20Whois%20version%20will%20offer%20the%20ability%20to%20check%20whether%20a%20property%20is%20set%20using%20the%20standard%20method%3F%20Ruby%20convention.%20This%20means%2C%20you%20no%20longer%20need%20to%20check%20whether%20a%20property%20is%20supported%2C%20get%20the%20property%20value%20and%20compare%20it%20to%20nil.%0D%0Aa%20%3D%20Whois.query%20%22google.it%22%0D%0Aa.created_on%3F%0D%0A%23%20%3D%26gt%3B&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/' rel='bookmark' title='Permanent Link: New in Whois: Applying the Principle of Least Surprise'>New in Whois: Applying the Principle of Least Surprise</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/ruby-whois-0-8-1/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.1'>Ruby Whois 0.8.1</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-0-8-0/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.0'>Ruby Whois 0.8.0</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search SimoneCarletti.com from Google Chrome address bar</title>
		<link>http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:55:53 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[opensearch]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=961</guid>
		<description><![CDATA[How to enable OpenSearch provider for your website.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just published a small update to this site to enable <a href="http://www.opensearch.org/">OpenSearch</a> protocol. Thanks to OpenSearch, you can search this blog from any OpenSearch-aware client, including for instance <strong>Mozilla Firefox</strong> and <strong>Google Chrome</strong>.</p>
<p><strong>I really like the way how Google Chrome deals with OpenSearch</strong>. When you browse and OpenSearch-aware site, Google Chrome fetches the <abbr title="OpenSearch description document">OSDD</abbr> file and make it immediately available as a shortcut in the address bar. For example, if you open a couple of pages in this site then you type <code>simone</code> you should see the following behavior.</p>
<div id="attachment_962" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-962" title="Google Chrome and OpenSearch providers" src="http://www.simonecarletti.com/blog/wp-content/uploads/2010/01/autocomplete-500x151.png" alt="Google Chrome suggests an available OpenSearch provider" width="500" height="151" /><p class="wp-caption-text">Google Chrome suggests an available OpenSearch provider</p></div>
<p><span id="more-961"></span>If you hit tab, the autocomplete list disappears and you enter the &#8220;OpenSearch mode&#8221;. You can now enter the search query and confirm to view the search results.</p>
<div id="attachment_963" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-963" title="Google Chrome and OpenSearch" src="http://www.simonecarletti.com/blog/wp-content/uploads/2010/01/searchfor-500x135.png" alt="Google Chrome integrates OpenSearch provider in the address bar" width="500" height="135" /><p class="wp-caption-text">Google Chrome integrates OpenSearch provider in the address bar</p></div>
<p>Creating an OpenSearch OSDD is as simple as writing less than 10 lines of XML code. <a href="http://www.simonecarletti.com/opensearch.xml">Here&#8217;s mine</a>. For more information visit the <a href="http://www.opensearch.org/Home">OpenSearch website</a>.</p>
<p>PS. If you are a Ruby developer, here&#8217;s my <a href="http://builder.rubyforge.org/">Builder</a> template. Replace <code>TITLE</code>, <code>DESCRIPTION</code> and <code>PATH_TO_SEARCH</code> with your own variables.</p>
<pre class="brush: ruby; html-script: true;">xml.instruct!
xml.OpenSearchDescription "xmlns" =&gt; "http://a9.com/-/spec/opensearch/1.1/",
                          "xmlns:moz" =&gt; "http://www.mozilla.org/2006/browser/search/" do
  xml.ShortName "TITLE"
  xml.Description "DESCRIPTION"
  xml.InputEncoding "UTF-8"
  xml.Url :type =&gt; "text/html", :method =&gt; "get", :template =&gt; "PATH_TO_SEARCH?q={searchTerms}"

  xml.moz :SearchForm, "PATH_TO_SEARCH"

end</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/&amp;title=Search+SimoneCarletti.com+from+Google+Chrome+address+bar" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Search+SimoneCarletti.com+from+Google+Chrome+address+bar+-+http://b2l.me/d33f5+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Search+SimoneCarletti.com+from+Google+Chrome+address+bar&amp;link=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/&amp;t=Search+SimoneCarletti.com+from+Google+Chrome+address+bar" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/&amp;title=Search+SimoneCarletti.com+from+Google+Chrome+address+bar" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/&amp;title=Search+SimoneCarletti.com+from+Google+Chrome+address+bar" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/&amp;title=Search+SimoneCarletti.com+from+Google+Chrome+address+bar&amp;summary=I%27ve%20just%20published%20a%20small%20update%20to%20this%20site%20to%20enable%20OpenSearch%20protocol.%20Thanks%20to%20OpenSearch%2C%20you%20can%20search%20this%20blog%20from%20any%20OpenSearch-aware%20client%2C%20including%20for%20instance%20Mozilla%20Firefox%20and%20Google%20Chrome.%0D%0A%0D%0AI%20really%20like%20the%20way%20how%20Google%20Chrome%20deals%20with%20OpenSearch.%20When%20you%20browse%20&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/11/running-google-chrome-os-on-macosx-with-vmware-fusion/' rel='bookmark' title='Permanent Link: How to run Google Chrome OS on Mac OS X with VMWare Fusion'>How to run Google Chrome OS on Mac OS X with VMWare Fusion</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/11/google-chrome-os-user-agent/' rel='bookmark' title='Permanent Link: Google Chrome OS User Agent'>Google Chrome OS User Agent</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/12/google-site-performance-tool-gzip/' rel='bookmark' title='Permanent Link: Google Site performance tool says Google is not serving Gzipped resources'>Google Site performance tool says Google is not serving Gzipped resources</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/search-simonecarletti-com-from-google-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Net::DNS 0.6.1 released</title>
		<link>http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 19:29:43 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Server / Apache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[net-dns]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=955</guid>
		<description><![CDATA[Relesed Net::DNS 0.6.1, the first maintenance release for the Net::DNS 0.6.x series.]]></description>
			<content:encoded><![CDATA[<p><code>Net::DNS 0.6.1</code> is the first maintenance release for the <a href="http://www.simonecarletti.com/blog/2009/11/ruby-netdns-0-6-0/"><code>Net::DNS</code> 0.6.x series</a>.</p>
<p>It doesn&#8217;t provide any new feature, just delicious bug fixes including a major issue with Reverse DNS (<a href="http://github.com/bluemonk/net-dns/issues/issue/6">#6</a>) and <code>IPAddr</code> handling (<a href="http://github.com/bluemonk/net-dns/issues/issue/5">#5</a>). We also improved the test suite to ensure those bugs won&#8217;t show up in the future.<span id="more-955"></span></p>
<p>We are already working on the Net::DNS 0.7.x family. The new minor version will include some major internal refactoring to <a href="http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/">improve performance</a> and reliability. There are also some <a href="http://github.com/bluemonk/net-dns/issues/issue/9">open</a> <a href="http://github.com/bluemonk/net-dns/issues/issue/7">tickets</a> we would like to address.</p>
<p>As usual, upgrade/install with</p>
<pre class="brush: bash;">$ gem install net-dns</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/&amp;title=Ruby+Net%3A%3ADNS+0.6.1+released" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ruby+Net%3A%3ADNS+0.6.1+released+-+http://b2l.me/d3f2j+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Ruby+Net%3A%3ADNS+0.6.1+released&amp;link=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/&amp;t=Ruby+Net%3A%3ADNS+0.6.1+released" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/&amp;title=Ruby+Net%3A%3ADNS+0.6.1+released" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/&amp;title=Ruby+Net%3A%3ADNS+0.6.1+released" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/&amp;title=Ruby+Net%3A%3ADNS+0.6.1+released&amp;summary=Net%3A%3ADNS%200.6.1%20is%20the%20first%20maintenance%20release%20for%20the%20Net%3A%3ADNS%200.6.x%20series.%0D%0A%0D%0AIt%20doesn%27t%20provide%20any%20new%20feature%2C%20just%20delicious%20bug%20fixes%20including%20a%20major%20issue%20with%20Reverse%20DNS%20%28%236%29%20and%20IPAddr%20handling%20%28%235%29.%20We%20also%20improved%20the%20test%20suite%20to%20ensure%20those%20bugs%20won%27t%20show%20up%20in%20the%20future.%0D%0A%0D%0A&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/11/ruby-netdns-0-6-0/' rel='bookmark' title='Permanent Link: Ruby Net::DNS 0.6.0'>Ruby Net::DNS 0.6.0</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-0-8-0/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.0'>Ruby Whois 0.8.0</a></li>
<li><a href='http://www.simonecarletti.com/blog/2010/02/ruby-whois-1-0-is-here/' rel='bookmark' title='Permanent Link: Ruby Whois 1.0 is here!'>Ruby Whois 1.0 is here!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/ruby-netdns-0-6-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New in Whois: Applying the Principle of Least Surprise</title>
		<link>http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 12:28:01 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Hosting / Domains]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubywhois]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=939</guid>
		<description><![CDATA[Changes to the Whois::Answer object API.]]></description>
			<content:encoded><![CDATA[<p>In the past weeks I&#8217;ve been working to improve the <a href="http://code.simonecarletti.com/whois">Ruby Whois Gem</a>. While most of the effort is actually focused on creating new WHOIS parsers for the existing registries which are more than 400, I also took the time to add some new features.</p>
<p>One important change is strictly focused on applying the <a href="http://en.wikipedia.org/wiki/Ruby_%28programming_language%29#Philosophy">principle of least surprise</a> in the <code>Whois::Answer</code> design. Prior the changes, calling a method on a <code>Whois::Answer</code> instance to read a property value might result in 3 different behaviors:</p>
<pre class="brush: ruby; html-script: true;"># the property is supported, return the value
a = Whois.query "google.it"
a.created_on?
# =&gt; Fri Dec 10 00:00:00 +0100 1999

# the property is supported but blank, return the value
a = Whois.query "notregistered.it"
a.created_on?
# =&gt; nil

# the property is not supported, raise an exception
a = Whois.query "google.it"
a.domain_id?
# =&gt; PropertyNotSupported</pre>
<p><span id="more-939"></span>Whether the parser supports a property depends on the WHOIS record. For instance, a <code>.name</code> WHOIS response doesn&#8217;t contain the domain expiration thus the property <code>expires_on</code> is not supported. Contrariwise, the <code>.it</code> WHOIS response contains that value thus you can safely call <code>expires_on</code> to get the property value.</p>
<p>How do you deal with supported/unsupported properties? With the old Whois version you would have to check whether a property is supported before actually calling the getter method.</p>
<pre class="brush: ruby; html-script: true;"># the property is supported, return the value
a = Whois.query "google.it"
if a.property_supported?(:domain_id)
  a.domain_id
end</pre>
<p>That worked well but was&#8230; horrible. <a href="http://blog.stackoverflow.com/2010/01/eating-our-own-careers-dogfood/">Dogfooding</a> the library working on <a href="http://www.robodomain.com/">RoboDomain</a> I ended up with the conclusion this wasn&#8217;t the behavior an user would expect. For this reason, the new Whois version returns the value if the property is supported, <code>nil</code> otherwise regardless property status.</p>
<p><a href="http://github.com/weppos/whois/commit/d0ed5877d05cd9ccd288fbac52fd80ba65b943db">This change</a> only affects the answer object. If for some reason you need to know whether a property is supported, you can always use the <code>property_supported?</code> method or access the underlying parser implementation.</p>
<pre class="brush: ruby; html-script: true;">a = Whois.query "google.it"

a.domain_id
# =&gt; nil

a.supported?(:domain_id)
# =&gt; false

a.parser.domain_id
# =&gt; PropertyNotSupported</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/&amp;title=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise+-+http://b2l.me/dx6fq+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise&amp;link=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/&amp;t=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/&amp;title=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/&amp;title=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/&amp;title=New+in+Whois%3A+Applying+the+Principle+of+Least+Surprise&amp;summary=In%20the%20past%20weeks%20I%27ve%20been%20working%20to%20improve%20the%20Ruby%20Whois%20Gem.%20While%20most%20of%20the%20effort%20is%20actually%20focused%20on%20creating%20new%20WHOIS%20parsers%20for%20the%20existing%20registries%20which%20are%20more%20than%20400%2C%20I%20also%20took%20the%20time%20to%20add%20some%20new%20features.%0D%0A%0D%0AOne%20important%20change%20is%20strictly%20focused%20on%20applying%20th&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2010/01/new-in-whois-property-is-set/' rel='bookmark' title='Permanent Link: New in Whois: property is set?'>New in Whois: property is set?</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/ruby-whois-0-8-1/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.1'>Ruby Whois 0.8.1</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/ruby-whois-0-8-0/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.0'>Ruby Whois 0.8.0</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/new-in-whois-principle-of-least-surprise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How slow are (Ruby) Exceptions?</title>
		<link>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:01:58 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=915</guid>
		<description><![CDATA[Some benchmarks to demonstrate how slow exceptions can be.]]></description>
			<content:encoded><![CDATA[<p>If you are used to <a href="http://www.simonecarletti.com/blog/2009/09/inside-ruby-on-rails-benchmarking-your-scripts/">benchmark your Ruby scripts</a> or if you ever had to improve the performance of some strategic tasks, then this post won&#8217;t tell you nothing new because you should already know that Exceptions are slow. And this is not really a Ruby problem: <a href="http://stackoverflow.com/questions/161942/how-slow-are-net-exceptions">.NET Exceptions are slow</a>, <a href="http://stackoverflow.com/questions/299068/how-slow-are-java-exceptions">JAVA Exceptions are slow</a> just because the begin/raise/rescue (or try/throw/catch) architecture is slow by nature.</p>
<p><strong>But how slow are Ruby Exceptions?</strong></p>
<p>The answer to this question really depends on how complex is your code. Here I just want to show you a very simple example, extracted from a really strategic <a href="http://www.robodomain.com/">RoboDomain DNS sorting algorithm</a>.<span id="more-915"></span></p>
<p><script src="http://gist.github.com/275768.js?file=if_vs_exception_vs_regexp.rb"></script></p>
<p>The code is fairly simple: the value for an <code>A</code> record is expected to be an IP Address while the value for a <code>NS</code> record is expected to be represented by a <abbr title="Fully Qualified Domain Name">FQDN</abbr> as string. The code should parse the <code>data</code> and return the normalized <code>value</code> depending on some conditions.</p>
<p>The first version of the algorithm is completely based on Exceptions. <code>IPAddr</code> raises an <code>ArgumentError</code> when the argument is not a valid IP Address. In this case, the script gracefully returns the value as string.</p>
<p>The second version checks against the record value (I agree with you that is quite empiric, but representative for the sake of this benchmark).</p>
<p>The third version is a less empiric alternative that uses some regular expressions to check whether the data looks like an IP before actually feeding the <code>IPAddr</code> class. Under the hood, the <code>IPAddr</code> class performs a really similar task, the only difference here is that in the latter case I&#8217;m not using Exceptions at all.</p>
<p>Results speak for themselves. *</p>
<p>(*) As pointed out by <cite>Curtis Summers</cite> in the comments,a huge amount of time is actually spent by <code>IPAddr</code> trying to resolve the hostname. For more benchmarks, also look at <a href="http://gist.github.com/275768#file_if_vs_exception_vs_regexp_zerodivision.rb">this test</a>.</p>
<p>With Ruby 1.8.7, the algorithm (note, this is a super-simplified version of the original algorithm) is <strong>about 37 times slower when Exceptions are involved</strong>.</p>
<pre>$ ruby if_vs_exception.rb
Rehearsal ------------------------------------------------
NS exception   4.330000   5.750000  10.080000 ( 37.599575)
NS if          0.140000   0.010000   0.150000 (  0.136280)
NS regexp      0.450000   0.000000   0.450000 (  0.454040)
A exception    2.010000   0.020000   2.030000 (  2.047711)
A if           2.060000   0.020000   2.080000 (  2.074642)
A regepx       2.030000   0.020000   2.050000 (  2.054930)
-------------------------------------- total: 16.840000sec

                   user     system      total        real
NS exception   4.420000   5.810000  10.230000 ( 38.350608)
NS if          0.130000   0.000000   0.130000 (  0.130863)
NS regexp      0.450000   0.000000   0.450000 (  0.447975)
A exception    2.000000   0.020000   2.020000 (  2.016231)
A if           2.020000   0.020000   2.040000 (  2.043085)
A regepx       2.030000   0.020000   2.050000 (  2.048402)</pre>
<p>The same story with Ruby 1.9.1.</p>
<pre>Rehearsal ------------------------------------------------
NS exception   4.650000   5.800000  10.450000 ( 39.134858)
NS if          0.080000   0.000000   0.080000 (  0.079427)
NS regexp      0.320000   0.000000   0.320000 (  0.320389)
A exception    1.180000   0.010000   1.190000 (  1.182892)
A if           1.200000   0.000000   1.200000 (  1.209433)
A regepx       1.220000   0.000000   1.220000 (  1.219345)
-------------------------------------- total: 14.460000sec

                   user     system      total        real
NS exception   4.520000   5.720000  10.240000 ( 37.931455)
NS if          0.080000   0.000000   0.080000 (  0.078286)
NS regexp      0.320000   0.000000   0.320000 (  0.320988)
A exception    1.190000   0.000000   1.190000 (  1.186198)
A if           1.210000   0.010000   1.220000 (  1.220254)
A regepx       1.220000   0.000000   1.220000 (  1.215634)</pre>
<p><strong>Does this mean I should forget about Exceptions?</strong></p>
<p>Absolutely no! I love Exceptions and you should love them too. However, <a href="http://robots.thoughtbot.com/post/159807850/save-bang-your-head-active-record-will-drive-you-mad">Exceptions should not be expected</a> and, in some circumstances, an <code>if</code> can be much more convenient, or at least, efficient.</p>
<p>One important lesson to learn from these benchmarks is that exceptions should not be part of the regular application flow. This shouldn&#8217;t prevent you to use them to handle unexpected situations and exception performance shouldn&#8217;t be a big deal in this case.</p>
<p>A lesson learned from this specific case, is to avoid using exceptions in place of conditional statements to handle not exceptional situations.</p>
<p><strong>UPDATE:</strong> for more interesting comments, check out the <a href="http://www.reddit.com/r/ruby/comments/ap33d/how_slow_are_ruby_exceptions/">Reddit page</a>.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/&amp;title=How+slow+are+%28Ruby%29+Exceptions%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=How+slow+are+%28Ruby%29+Exceptions%3F+-+http://b2l.me/dk64z+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=How+slow+are+%28Ruby%29+Exceptions%3F&amp;link=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/&amp;t=How+slow+are+%28Ruby%29+Exceptions%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/&amp;title=How+slow+are+%28Ruby%29+Exceptions%3F" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/&amp;title=How+slow+are+%28Ruby%29+Exceptions%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/&amp;title=How+slow+are+%28Ruby%29+Exceptions%3F&amp;summary=If%20you%20are%20used%20to%20benchmark%20your%20Ruby%20scripts%20or%20if%20you%20ever%20had%20to%20improve%20the%20performance%20of%20some%20strategic%20tasks%2C%20then%20this%20post%20won%27t%20tell%20you%20nothing%20new%20because%20you%20should%20already%20know%20that%20Exceptions%20are%20slow.%20And%20this%20is%20not%20really%20a%20Ruby%20problem%3A%20.NET%20Exceptions%20are%20slow%2C%20JAVA%20Exceptions%20a&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/11/re-raise-a-ruby-exception-in-a-rails-rescue_from-statement/' rel='bookmark' title='Permanent Link: Re-raise a Ruby exception in a Rails rescue_from statement'>Re-raise a Ruby exception in a Rails rescue_from statement</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/12/inside-ruby-on-rails-rescuable-and-rescue_from/' rel='bookmark' title='Permanent Link: Inside Ruby on Rails: Rescuable and rescue_from'>Inside Ruby on Rails: Rescuable and rescue_from</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/how-slow-are-ruby-exceptions/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ruby SuperStruct: enhanced version of the standard Ruby Struct</title>
		<link>http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/</link>
		<comments>http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 18:00:29 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[struct]]></category>
		<category><![CDATA[superstruct]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=890</guid>
		<description><![CDATA[Ruby SuperStruct is an enhanced version of the Ruby Struct library: it provides the ability to initialize an instance from Hash and passing a block to yield on self.]]></description>
			<content:encoded><![CDATA[<p>A few months ago I created a custom class to enhance the base Ruby <code>Struct</code> object. What I needed for my <code>Whois</code> library was the ability to create a new instance from a <code>Hash</code>.</p>
<pre>Loser = Struct.new(:id, :name)
Winner = SuperStruct.new(:id, :name)

# The default Struct accepts up to N arguments
# where N is the total number of elements defined in the Struct.
Loser.new(:id =&gt; "1", :name =&gt; "John Doe")
# =&gt; #&lt;struct Loser id={:name=&gt;"John Doe", :id=&gt;"1"}, name=nil&gt;

Winner.new(:id =&gt; "1", :name =&gt; "John Doe")
# =&gt; #&lt;struct Winner id="1", name="John Doe"&gt;</pre>
<p><span id="more-890"></span>Because the first argument is mapped to the <code>:id</code> element, the <code>Hash</code> is stored as value for the id attribute.<br />
In a standard Ruby <code>Struct</code> I have to map each <code>Hash</code> value to the specific position in the <code>Struct</code>, loosing the flexibility of passing a <code>Hash</code> with optional keys.</p>
<pre>hash = { :name =&gt; "John Doe" }

Loser.new(hash)
# =&gt; #&lt;struct Loser id={:name=&gt;"John Doe"}, name=nil&gt;
Loser.new(nil, hash[:name])
# =&gt; #&lt;struct Loser id=nil, name="John Doe"&gt;

Winner.new(hash)
# =&gt; #&lt;struct Winner id=nil, name="John Doe"&gt;</pre>
<p>Also, I&#8217;d like to be able to pass a block to the <code>initialize</code> method and <code>yield</code> on <code>self</code>.</p>
<pre>Loser.new do |c|
  c.name = "John Doe"
end
# =&gt; #&lt;struct Loser id=nil, name=nil&gt;
# Name is not set

Winner.new do |c|
  c.name = "John Doe"
end
# =&gt; #&lt;struct Winner id=nil, name="John Doe"&gt;
# Hurra! Name is set!</pre>
<p>I called it <code>RubyStruct</code>. It was created for the <a href="http://code.simonecarletti.com/whois">Ruby Whois</a>, but ultimately I found myself using it quite often in my projects and I decided to package it in a single file along with a basic test suite.</p>
<p>Here&#8217;s the library.</p>
<p><script src="http://gist.github.com/271214.js?file=super_struct.rb"></script></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/&amp;title=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct+-+http://b2l.me/c66ye+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct&amp;link=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/&amp;t=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/&amp;title=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/&amp;title=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/&amp;title=Ruby+SuperStruct%3A+enhanced+version+of+the+standard+Ruby+Struct&amp;summary=A%20few%20months%20ago%20I%20created%20a%20custom%20class%20to%20enhance%20the%20base%20Ruby%20Struct%20object.%20What%20I%20needed%20for%20my%20Whois%20library%20was%20the%20ability%20to%20create%20a%20new%20instance%20from%20a%20Hash.%0D%0ALoser%20%3D%20Struct.new%28%3Aid%2C%20%3Aname%29%0D%0AWinner%20%3D%20SuperStruct.new%28%3Aid%2C%20%3Aname%29%0D%0A%0D%0A%23%20The%20default%20Struct%20accepts%20up%20to%20N%20arguments%0D%0A%23%20where%20&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-has-a-new-whois-library/' rel='bookmark' title='Permanent Link: Ruby has a new WHOIS library'>Ruby has a new WHOIS library</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/ruby-whois-0-8-1/' rel='bookmark' title='Permanent Link: Ruby Whois 0.8.1'>Ruby Whois 0.8.1</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/09/rake-console/' rel='bookmark' title='Permanent Link: rake console: a custom irb instance for your Ruby GEM'>rake console: a custom irb instance for your Ruby GEM</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2010/01/ruby-superstruct/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Redmine 0.9.0 and duplicate content issue</title>
		<link>http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/</link>
		<comments>http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:11:31 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Server / Apache]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=886</guid>
		<description><![CDATA[Redmine 0.9.0 duplicates the most part of application URLs: here's an Apache configuration file to redirect the old URLs to the new ones.]]></description>
			<content:encoded><![CDATA[<p>A couple of hours ago I upgraded the <a href="http://code.simonecarletti.com/">code domain</a> from Redmine 0.8.0 to Redmine 0.9.0, currently available in pre-beta.</p>
<p>Redmine 0.9.0 offers tons of improvements but one among all forced my decision to upgrade without waiting for a final release: <strong>Rails 2.3.5</strong>. Redmine 0.8.x is built on Rails 2.1.0 and there seems to be some kind of weird Rails-Redmine-Passenger-Ruby EE memory leaks.</p>
<p>With the new release, Redmine <a title="Redmine - Patch #1901: RESTful URLs for everything - Redmine" href="http://www.redmine.org/issues/1901">has changed</a> the most part of its URLs. The development team basically migrated all routes to a more RESTful-oriented architecture. They did a wonderful job, unfortunately they probably chose the worst way to ensure backward-compatibility: <strong>duplication</strong>.</p>
<p>All the old routes are still available along with the new ones and this can cause several duplicate content issues. To patch the problem, I configured some Apache redirection rules in order to permanently redirect the old URLs to the new ones.<span id="more-886"></span></p>
<p><script src="http://gist.github.com/265300.js?file=redmine-080-to-090.conf"></script></p>
<p>The gist doesn&#8217;t pretend to solve all issues. It&#8217;s just a quick and (quite) dirty fix.</p>
<p>From Redmine side, I would have setup a <a title="Riding Rails: Introducing Rails Metal" href="http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal">Rails Metal</a> to redirect all the old URLs to the new ones. This is not as efficient as relying on the web server, but this is compatible with any user environment.</p>
<p>Feel free to fork, clone and update the gist. After all, <strong>this is a Git repository</strong>!</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-sexy">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/&amp;title=Redmine+0.9.0+and+duplicate+content+issue" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Redmine+0.9.0+and+duplicate+content+issue+-+http://b2l.me/cgw8a+(via+@weppos)" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Redmine+0.9.0+and+duplicate+content+issue&amp;link=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/&amp;t=Redmine+0.9.0+and+duplicate+content+issue" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/&amp;title=Redmine+0.9.0+and+duplicate+content+issue" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/&amp;title=Redmine+0.9.0+and+duplicate+content+issue" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/&amp;title=Redmine+0.9.0+and+duplicate+content+issue&amp;summary=A%20couple%20of%20hours%20ago%20I%20upgraded%20the%20code%20domain%20from%20Redmine%200.8.0%20to%20Redmine%200.9.0%2C%20currently%20available%20in%20pre-beta.%0D%0A%0D%0ARedmine%200.9.0%20offers%20tons%20of%20improvements%20but%20one%20among%20all%20forced%20my%20decision%20to%20upgrade%20without%20waiting%20for%20a%20final%20release%3A%20Rails%202.3.5.%20Redmine%200.8.x%20is%20built%20on%20Rails%202.1.0%20&amp;source=Simone Carletti&#039;s Blog" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->



<p>Related posts:<ol><li><a href='http://www.simonecarletti.com/blog/2009/01/apache-query-string-redirects/' rel='bookmark' title='Permanent Link: Apache .htaccess query string redirects'>Apache .htaccess query string redirects</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/07/configuring-git-repository-with-redmine/' rel='bookmark' title='Permanent Link: Configuring a Git repository with Redmine'>Configuring a Git repository with Redmine</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/12/generic-apache-configuration-snippets/' rel='bookmark' title='Permanent Link: Generic Apache configuration snippets'>Generic Apache configuration snippets</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2009/12/redmine-0-9-0-and-duplicate-content-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.145 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-13 14:30:03 -->
