<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
  <title>RailsOnWave Ruby on Rails web 2.0 Ajax - Ruby on Rails</title>
  <id>tag:www.railsonwave.com,2009:mephisto/ruby-on-rails</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  
  <link href="http://www.railsonwave.com/ruby-on-rails" rel="alternate" type="text/html" />
  <updated>2009-06-19T18:24:56Z</updated>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Railsonwave-ruby-on-rails" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="railsonwave-ruby-on-rails" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Sandro Paganotti</name>
    </author>
    <id>tag:www.railsonwave.com,2009-06-19:8218</id>
    <published>2009-06-19T18:24:00Z</published>
    <updated>2009-06-19T18:24:56Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/6/19/time-driven-crawling-with-tarantula" rel="alternate" type="text/html" />
    <title>Time driven crawling with Tarantula </title>
<content type="html">
            &lt;p&gt;We are using &lt;a href="http://github.com/relevance/tarantula/tree/master"&gt;Tarantula&lt;/a&gt; as an additional form of testing within our last project, Tarantula is called during a cruise control task to ensure that the application works also with realistic data (taken from the production database during the night).&lt;/p&gt;


	&lt;p&gt;The main problem we found in this approach was how to stop the crawler before it finish to load all the possible links collected during the session. This was critical for us ‘cause the web application currently handles thousands of elements and we could not wait hours.&lt;/p&gt;


So we chose to patch Tarantula in order to:
	&lt;ul&gt;
	&lt;li&gt;let the spider follow links in a random order &lt;/li&gt;
		&lt;li&gt;stop the spider after a configurable period of time (eg: 10 min)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Here’s the &lt;a href="http://www.railsonwave.com/assets/2009/6/19/crawler.rb"&gt;crawler.rb&lt;/a&gt; you’ll need to put under ‘lib/relevance/tarantula/’ in order to obtain this effect, then you can change two instance_variables: test_max_time_links and test_max_time_forms in order to choose how many minutes the spider will spend on these elements.&lt;/p&gt;


	&lt;p&gt;In the next days we’ll fork the Tarantula projects in order to better share this new behavior.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/a_XGC6zxYpQ" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2009-05-29:8215</id>
    <published>2009-05-29T13:11:00Z</published>
    <updated>2009-05-29T13:13:44Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/5/29/upgrading-your-rails-app-from-rails-2-1-to-rails-2-3" rel="alternate" type="text/html" />
    <title>Upgrading your Rails app from Rails 2.1 to Rails 2.3....</title>
<content type="html">
            &lt;p&gt;If you still have some of your rails applications in Rails 2.1, here is how to start migrating to Rails 2.3 and take advantage of the new features….&lt;/p&gt;


	&lt;p&gt;Firstly, create a branch of your application&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;svn checkout path_of_application&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;Delete your current rails folder from &lt;strong&gt;vendor/rails&lt;/strong&gt; from your branched application (if you had frozen rails into your app before)
Install the Rails 2.3.2 framework and then freeze it into your application with these two commands:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;sudo gem install rails --version 2.3.2
rake rails:freeze:gems
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;create a sample rails 2.3 application, then copy all the missing the  &lt;strong&gt;config/initializers/&lt;/strong&gt; files from the test application to your branched application such as the &lt;em&gt;session_store.rb&lt;/em&gt;, then copy the secret key from the &lt;em&gt;environment.rb&lt;/em&gt; file into this file. This is to keep the &lt;em&gt;environment.rb&lt;/em&gt; file small, braking parts into the  &lt;strong&gt;config/initializers/&lt;/strong&gt; files&lt;/p&gt;


	&lt;p&gt;Remember to change your Rails version in your &lt;em&gt;environment.rb&lt;/em&gt; file to &lt;strong&gt;Rails 2.3.2&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.railsonwave.com/assets/2009/5/29/TextMateScreenSnapz001.png" /&gt;&lt;/p&gt;


	&lt;p&gt;rename your &lt;em&gt;application.rb&lt;/em&gt; file to &lt;em&gt;application_controller.rb&lt;/em&gt; or run&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;rails:update:application_controller&lt;/pre&gt;&lt;/code&gt;

	&lt;h4&gt;formatted urls&lt;/h4&gt;


formatted_ * are no longer supported in the route helper due to using too much memory:
&lt;pre&gt;&lt;code&gt;
 formatted_users_path(:format =&amp;gt; 'xml')  changed to users_path(:format =&amp;gt; 'xml')
&lt;/pre&gt;&lt;/code&gt;

	&lt;h4&gt;Internationalization&lt;/h4&gt;


	&lt;p&gt;If you have used the globalization gem, it will no longer be compatible in Rails 2.3. Rails has now built in I18n Internationalization. (&lt;a href="http://rails-i18n.org/wiki/pages/i18n-rails-guide"&gt;read more about internationalization&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;The old way: &lt;br /&gt;
&lt;img src="http://railsonwave.com/assets/2009/5/29/TextMateScreenSnapz002.png" height="115px" width="580px"&gt;&lt;/p&gt;


	&lt;p&gt;The new way: &lt;br /&gt;
&lt;img src="http://railsonwave.com/assets/2009/5/29/TextMateScreenSnapz003.png" height="115px" width="580px"&gt;&lt;/p&gt;


	&lt;p&gt;In the config/locales/en.yml file we have the following:&lt;br /&gt;
&lt;img src="http://railsonwave.com/assets/2009/5/29/TextMateScreenSnapz004.png" height="59px" width="454px"&gt;&lt;/p&gt;


	&lt;p&gt;The text is retrieved from these files, as well as if you have other languages such as italian, just create an &lt;em&gt;it.yml&lt;/em&gt; file and replace the text with the translated text.&lt;/p&gt;


	&lt;p&gt;Hope this will help when you migrate to Rails 2.3….&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/GssBTJSr93w" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2009-05-20:8212</id>
    <published>2009-05-20T14:52:00Z</published>
    <updated>2009-05-22T09:50:36Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/5/20/translate-plugin" rel="alternate" type="text/html" />
    <title> I18n translate interface plugin...</title>
<content type="html">
            &lt;p&gt;I came across a really cool plugin that has a web interface for translating I18n texts.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.railsonwave.com/assets/2009/5/20/FirefoxScreenSnapz001.png" /&gt;&lt;/p&gt;


	&lt;p&gt;Download the &lt;a href="http://github.com/newsdesk/translate/tree/master"&gt;translate plugin&lt;/a&gt; from github written by &lt;em&gt;Peter Marklund&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;In the routes.rb file add the following:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.railsonwave.com/assets/2009/5/20/TextMateScreenSnapz001.png" /&gt;&lt;/p&gt;


	&lt;p&gt;now visit &lt;em&gt;/translate&lt;/em&gt; and you will have an interface for translating text.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/5bc3UA_1vKE" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Sandro Paganotti</name>
    </author>
    <id>tag:www.railsonwave.com,2009-05-11:8211</id>
    <published>2009-05-11T22:00:00Z</published>
    <updated>2009-05-12T09:42:54Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/5/11/euruko-2009-summary" rel="alternate" type="text/html" />
    <title>Euruko 2009 Summary</title>
<content type="html">
            &lt;p&gt;&lt;a href="http://euruko2009.org/"&gt;Euroko’s 2009&lt;/a&gt; is over and in these few lines I’ll try to summarize two days full of sessions,
laughs and Ruby. Everything started with &lt;a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto"&gt;Matz’s&lt;/a&gt; opening speech which focuses on ‘Things we got’ explaining why Ruby’s got all the features a good language need (starting from the name), what are the next steps in the core development and why we don’t need to rush in the future.&lt;/p&gt;


	&lt;p&gt;During the day I found two very interesting speeches: one from &lt;a href="http://formatinternet.wordpress.com/"&gt;Javier Ramirez&lt;/a&gt; that &lt;a href="http://app.euruko2009.org/talks/9-fun-with-ruby-and-without-r-s-program-your-own-games-with-gosu"&gt;told us&lt;/a&gt; about &lt;a href="http://code.google.com/p/gosu/"&gt;Gosu&lt;/a&gt;, an enjoyable and pretty powerful gaming framework suitable for Ruby which can also be combined with &lt;a href="http://code.google.com/p/chipmunk-physics/"&gt;Chipmunk&lt;/a&gt; (a physics engine) in order to obtain
awesome effects and collisions.&lt;/p&gt;


	&lt;p&gt;Then I stumbled upon Cory Forsyth and his talk about &lt;a href="http://app.euruko2009.org/talks/10-who-needs-photoshop-creative-image-manipulation-and-processing-using-ruby-to-do-image-recognition-movie-decomposition-and-more"&gt;Image Manipulation with Ruby&lt;/a&gt; that focuses on how to obtain three kind of quite advanced effects: photo-mosaic, seam carving and face detection using  Ruby, &lt;a href="http://rmagick.rubyforge.org/"&gt;Rmagick&lt;/a&gt; and &lt;a href="http://github.com/bantic/ruby-opencv/tree/master"&gt;some&lt;/a&gt; other cool libraries. On &lt;a href="http://github.com/bantic"&gt;Cory Forsyth github page&lt;/a&gt; is also possible to appreciate &lt;a href="http://github.com/bantic/image_labs/tree/master"&gt;some very well made examples about these techniques&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The day ends up (at least for me ‘cause I know some guys went partying somewhere) with a very 
nice stand up dinner made with delicious catalan ‘Jamon y Queso’ .&lt;/p&gt;


	&lt;p&gt;Sunday comes with an exceptional list of talks that impressed me much, starting from &lt;a href="http://adhearsion.com/"&gt;Adhearsion&lt;/a&gt;:
 a framework crafted to help people deploy applications that need to interact with &lt;a href="http://www.asterisk.org/"&gt;Asterisk  servers&lt;/a&gt;. The presentation was really cool and comprised a live coding demo which showed us how to write simple voice-enabled applications (with menus and digit recognition). After a short coffee break we met Adam Blum and &lt;a href="http://www.rhomobile.com/products/rhodes"&gt;Rhodes&lt;/a&gt;, a framework that let you create mobile applications for almost
any existing smartphone using Ruby as coding language and &lt;span class="caps"&gt;HTML&lt;/span&gt; for creating views.&lt;/p&gt;


	&lt;p&gt;Then it was the turn of Pablo Formoso Estrada; his talk focused on Archaeopteryx which make the whole conference dance and 
clap their hands at the rhythm of a Ruby-driven runtime midi generator at which Pablo made adjustment
just like a dj does with disks. Aslak Hellesøy then performed a good presentation explaining us what is &lt;a href="http://wiki.github.com/aslakhellesoy/cucumber"&gt;Cucumber&lt;/a&gt; (a tool that helps creating semantic and readable tests written in human language) and showing us its latest features.&lt;/p&gt;


	&lt;p&gt;The last cool speech of the day was helded by Tomasz Stachewicz and focused on &lt;a href="http://tomash.wrug.eu/2009/03/03/rudy-ruby-native-extensions-in-d-programming-language.html"&gt;RuDy&lt;/a&gt; , a tool that lets you create 
Ruby extensions in D. &lt;a href="tinyurl.com/euruko-rudy"&gt;The whole presentation&lt;/a&gt; was made to look like Antonietti’s much discussed 
‘Perfoming like a Pr0n star’ but with ‘rock’ instead of ‘porn’, the result was very hilarious and it’s definitively worth a look.&lt;/p&gt;


	&lt;p&gt;And.. that’s it! Hope you enjoyed this summary and… see you next year in Krakovia!&lt;/p&gt;


	&lt;p&gt;ps: pictures of the event can be found at &lt;a href="http://www.flickr.com/photos/tags/euruko2009/"&gt;Euruko 2009 flickr photostream&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/SQ_76ZDBJGM" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Sandro Paganotti</name>
    </author>
    <id>tag:www.railsonwave.com,2009-04-22:8208</id>
    <published>2009-04-22T07:45:00Z</published>
    <updated>2009-04-22T07:46:28Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/4/22/selenium-and-cruisecontrol-rb" rel="alternate" type="text/html" />
    <title>Selenium and CruiseControl.rb</title>
<content type="html">
            &lt;p&gt;Within the project we’re developing we found ourselves pretty attracted from the features offered by &lt;a href="http://seleniumhq.org/"&gt;Selenium&lt;/a&gt; so we started to use its beautiful &lt;span class="caps"&gt;IDE&lt;/span&gt; to create behavioral tests that try to ensure our quality requirements.&lt;/p&gt;


	&lt;p&gt;But soon we discovered that manually aggregating and running these tests often lead to problems: first of all you don’t really have the same data on your developer instance each time you run Selenium so it happens that a particular business object is no more present or has been already, let’s say, processed and that means failure.&lt;/p&gt;


	&lt;p&gt;So we decide to move all the test we created to our CruiseControl.rb instance. To do that we followed these steps:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Create a Selenium startup script by following &lt;a href="http://mohammed.morsi.org/blog/?q=node/244"&gt;this good post&lt;/a&gt; from Mohammed Morsi;&lt;/li&gt;
		&lt;li&gt;Save your Selenium &lt;span class="caps"&gt;IDE&lt;/span&gt; tests as Unit Test File (File &amp;gt; Export Test Case As.. &amp;gt; Ruby) and copy them under your application tests/unit directory;&lt;/li&gt;
		&lt;li&gt; Put this piece of code within your ‘custom_cc.rake’ file&lt;/li&gt;
	&lt;/ul&gt;


&lt;pre&gt;&lt;code&gt;
      begin
        puts "="*10 + "SELENIUM TESTS" + "="*10
        Kernel.system "ruby","script/server","-d","-e","development","-p","3000" 
        CruiseControl::invoke_rake_task 'test:units'
      rescue =&amp;gt; e
        @test_errors &amp;lt;&amp;lt; e
      end
        Kernel.system "killall","ruby" 
      end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;That’s all! Hope you’ll find it useful !&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/KRuZ0kjBIYQ" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2009-04-03:8206</id>
    <published>2009-04-03T14:00:00Z</published>
    <updated>2009-04-03T14:01:09Z</updated>
    <category term="Ruby on Rails" />
    <category term="Whodo.es" />
    <link href="http://www.railsonwave.com/2009/4/3/rails-1-2-3-ro-rails-2-3" rel="alternate" type="text/html" />
    <title>Rails 1.2.3 to Rails 2.3</title>
<content type="html">
            &lt;p&gt;As I mentioned last week, I am busy doing an upgrade of &lt;a href="http://whodo.es"&gt;WhoDo.es&lt;/a&gt; from Rails 1.2.2 to Rails 2.3 and it is slowly sowly coming together, still have to do a lot of modifications for internationalization.&lt;/p&gt;


	&lt;p&gt;In my search for any help, I came across a very good step-by-step guide from &lt;em&gt;Peter Marklund&lt;/em&gt; that might help someone if they might have a similar quest!&lt;/p&gt;


	&lt;p&gt;Hope it might be useful for someone else. Please follow the link &lt;a href="http://marklunds.com/articles/one/409"&gt;here&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/9mVThwgjn2A" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2009-03-27:8205</id>
    <published>2009-03-27T16:44:00Z</published>
    <updated>2009-03-27T16:46:52Z</updated>
    <category term="Ruby on Rails" />
    <category term="Whodo.es" />
    <link href="http://www.railsonwave.com/2009/3/27/migrating-whodo-es" rel="alternate" type="text/html" />
    <title>Migrating WhoDo.es...</title>
<content type="html">
            &lt;p&gt;&lt;img src="http://railsonwave.com/assets/2009/3/27/KeynoteScreenSnapz001.png" height="80px" width="590px"&gt;
&lt;b&gt;I am currently  working on Migrating &lt;a href="http://whodo.es"&gt;WhoDo.es&lt;/a&gt; from Rails 1.2.2 to Rails 2.3. &lt;/b&gt;&lt;/p&gt;


	&lt;p&gt;My first steps were to migrate from Rails 1.2.2 to Rails 2.0 and no real big issues were faced, I only had to make sure that the gems that we were using were compatible with Rails 2.0.&lt;/p&gt;


	&lt;p&gt;Some of the following configurations had to be done:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Updated &lt;em&gt;environments.rb&lt;/em&gt; with &lt;span class="caps"&gt;RAILS&lt;/span&gt;_GEM_VERSION = ‘2.0.2’ &lt;/li&gt;
&lt;li&gt;run &lt;strong&gt;rake rails:update:configs&lt;/strong&gt; to update your  &lt;em&gt;config/boot.rb&lt;/em&gt; file from your current rails install. &lt;/li&gt;
&lt;li&gt;In my &lt;em&gt;config/environment/development.rb&lt;/em&gt; commenting out the following :&lt;/li&gt;

&lt;code&gt;
&lt;pre&gt;
   #config.action_view.cache_template_extensions = false
&lt;/pre&gt;
&lt;/code&gt;

&lt;li&gt;Since they removed pagination from the new version, I had to install the &lt;a href="http://github.com/mislav/will_paginate/tree/master"&gt;will_paginate&lt;/a&gt; plugin.&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;My next biggest challenge is to migrate to Rails 2.3. Some more serious changes will need to be made, such as:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href="http://guides.rubyonrails.org/i18n.html"&gt;Rails Internationalization&lt;/a&gt; a change from globalization&lt;/li&gt;
&lt;li&gt;Using the Rails&lt;a href="http://mad.ly/2008/04/09/rails-21-time-zone-support-an-overview/"&gt;Time-zone&lt;/a&gt; instead of the &lt;a href="http://tzinfo.rubyforge.org/"&gt;TzInfo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;Keep an eye on this blog, any discoveries that I might come across I will be posting here…&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/-3L9TBebVj0" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Giuseppe Arici</name>
    </author>
    <id>tag:www.railsonwave.com,2009-02-27:8202</id>
    <published>2009-02-27T09:39:00Z</published>
    <updated>2009-02-27T10:33:15Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2009/2/27/iphone-on-rails" rel="alternate" type="text/html" />
    <title>iPhone on Rails</title>
<summary type="html">&lt;p&gt;Introduction to ObjectiveResource, the open source framework that connects the iPhone to the Ruby on Rails application&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;Introduction to ObjectiveResource, the open source framework that connects the iPhone to the Ruby on Rails application&lt;/p&gt;
&lt;h3&gt;Introduction to ObjectiveResource, the open source framework that connects the iPhone to the Ruby on Rails application&lt;/h3&gt;


	&lt;p&gt;&lt;img src="http://railsonwave.com/assets/2009/2/27/iphoneonrails.jpg" /&gt;API&lt;/span&gt; directly.&lt;/p&gt;


	&lt;p&gt;The opinion of ObjectiveResource can only be positive: good idea, good projecting and  careful implementation.  Welcoming instruments that facilitate integration between the world of web and mobile devices  such as iPhone.
The opportunity that this library offers are interesting and many. Think of a possible example to simply develop functional applications for the iPhone, that makes it possible directly in real-time on the terminal of the user an altogether well-defined and limited to updated data (for example earnings of the quotations, on the variation of prices, on the unsold goods, ...) without having to develop the mobile version of the whole application.&lt;/p&gt;


	&lt;p&gt;At the end of this library it allows you to quickly develop with Ruby on Rails to the flexibility of the utilization of the iPhone: agility to the nth power!&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/JGBEi6rpfJ0" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Sandro Paganotti</name>
    </author>
    <id>tag:www.railsonwave.com,2008-12-23:8201</id>
    <published>2008-12-23T21:15:00Z</published>
    <updated>2008-12-23T21:16:51Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2008/12/23/scrubyt-a-quick-view" rel="alternate" type="text/html" />
    <title>Scrubyt, a quick view:</title>
<content type="html">
            &lt;p&gt;Today I come up to &lt;a href="http://scrubyt.org/"&gt;Scrubyt&lt;/a&gt;, an excellent piece of code developed by  Peter Szinek, Glenn Gillen and a bunch of other collaborators. What this software do is essentially fetch and operate on &lt;span class="caps"&gt;XML&lt;/span&gt;/HTML pages, here’s an example &lt;a href="http://github.com/scrubber/scrubyt_examples/tree/master/ebay.rb"&gt;taken&lt;/a&gt; from the official website:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
require 'rubygems'
require 'scrubyt'

ebay_data = Scrubyt::Extractor.define do

     fetch 'http://www.ebay.com/'
     fill_textfield 'satitle', 'ipod'
     submit

     record "//table[@class='nol']" do
       name "//td[@class='details']/div/a" 
     end
end

puts ebay_data.to_xml
&lt;/code&gt;&lt;/pre&gt; 

	&lt;p&gt;In this ten lines of code (including the two ‘require’ on top of the page) we fetch ‘ebay.com’ website, then we fill a textfield with the id ‘satitle’ with the text ‘ipod’ and we press the submit button. Next we create a container (named ‘record’) for each table with class ‘nol’ of the returning page (the page containing the results from our ‘ipod’ search) and we fill this container with a ‘name’ variable containing the text within an ‘A’ element incapsulated inside a td with class ‘details’.&lt;/p&gt;


	&lt;p&gt;If we print the result as xml (as we do in the last line) this will be the output (truncated):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&amp;lt;root&amp;gt;
  &amp;lt;record&amp;gt;
    &amp;lt;name&amp;gt;USB 2.0 Sync Data Cable for iPhone 3G iPod Mini NanoPOWER SELLER-30 DAYS MONEY BACK GUARANTEE-FAST SHIPPING$1.99Free shipping22d&amp;amp;amp;#160;5h&amp;amp;amp;#160;50m&amp;lt;/name&amp;gt;
  &amp;lt;/record&amp;gt;
  &amp;lt;record&amp;gt;
    &amp;lt;name&amp;gt;EnlargePIONEER 5.8&amp;amp;quot; GPS NEW AVIC-F90BT DVD MP3 IPOD AVICF90BT!!!  HAS THE NEW 2.0 UPDATE INSTALLED  !!!!! 2.0 UPDATE$637.00Free shipping9d&amp;amp;amp;#160;5h&amp;amp;amp;#160;35m&amp;lt;/name&amp;gt;
  &amp;lt;/record&amp;gt;
  &amp;lt;record&amp;gt;
...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In conclusion, this is a very nice and handy toy that can help us during deployment and test.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/FiS75i24vfc" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2008-11-19:7995</id>
    <published>2008-11-19T14:57:00Z</published>
    <updated>2008-11-19T14:58:57Z</updated>
    <category term="Ruby on Rails" />
    <category term="Web 2.0" />
    <link href="http://www.railsonwave.com/2008/11/19/iphone-hype" rel="alternate" type="text/html" />
    <title>iPhone hype...</title>
<content type="html">
            &lt;p&gt;If we consider the business world, since the &lt;strong&gt;Blackberry&lt;/strong&gt; was released in 2002, it broadened the use of IT in the business world. Receiving e-mail on your smartphone and being able to be updated in real-time was a useful tool for everyone.&lt;/p&gt;


	&lt;h3&gt;But then came along the iPhone….&lt;/h3&gt;


	&lt;p&gt;&lt;img src="http://railsonwave.com/assets/2008/11/19/iphones.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;The iPhone changed the whole game of the smartphone. Not only is it an interesting little device that allows you to be updated with your e-mail, organize your appointments, manage what you need to do but so many more applications are being developed that have reached the top of the top 25 list of apps to have. Like the new &lt;em&gt;Google voice search application&lt;/em&gt;
that enables you to search a website using your voice, but I have tried it and maybe it didn’t like my voice…&lt;/p&gt;


	&lt;p&gt;iPhone applications have created another dimension in the development of web applications, not only to develop web 2.0 applications in Ruby on Rails but for our applications to be successful and competing within the current market, we need to develop iPhone web applications that are synchronized with our web applications. A simple to-do list application is much more useful if you can view it on your iPhone and manage it from there too.&lt;/p&gt;


	&lt;p&gt;But then I ask myself…&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;is it better to develop iPhone web applications or native applications?&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Some advantages of web applications :&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;web based therefore can be cross -browsered&lt;/li&gt;
&lt;li&gt;it can be used with other smartphones and not only for the iPhone&lt;/li&gt;
&lt;li&gt;you don’t need approval from Apple&lt;/li&gt;
&lt;/ul&gt;

	&lt;p&gt;If anyone has any comments I would appreciate it.&lt;/p&gt;


	&lt;p&gt;Thanks&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/3M-IF-ffDAE" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2008-10-31:7888</id>
    <published>2008-10-31T11:26:00Z</published>
    <updated>2008-10-31T11:43:28Z</updated>
    <category term="Ruby on Rails" />
    <category term="Web 2.0" />
    <link href="http://www.railsonwave.com/2008/10/31/web-applications-with-google-s-theory" rel="alternate" type="text/html" />
    <title>Google with our Web Applications...</title>
<content type="html">
            &lt;p&gt;With the release of Googles browser Chrome, as Web Developers I think we could take a few pointers that I am sure we all know about but sometimes we need to be reminded.&lt;/p&gt;


	&lt;h3&gt;Technology&lt;/h3&gt;


	&lt;p&gt;Google wanted to introduce a browser that had multiprocess architecture. Other browsers, if one of the tabs crash the whole browser crashes. In our web applications we need to take advantage of new technology like Rails 2.2 and develop applications that are innovative making use of technology to develop new concepts and ways of solving a problem.&lt;/p&gt;


	&lt;p&gt;We need to &lt;em&gt;identify critical factors&lt;/em&gt; of the applications and understand how we will solve them, using existing plugins, gems or developing our own solution to solve the problem.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Keeping it simple&lt;/em&gt; and use only the technology that is needed. Redundant use of gems, plugins or scripts will slow down or application let alone the time spent to implement them.&lt;/p&gt;


	&lt;h3&gt;Who is to blame?&lt;/h3&gt;


	&lt;p&gt;As google puts it “Placing blame were blame belongs”.&lt;/p&gt;


	&lt;p&gt;Why did a web application fail? I think there are many factors that could lead to a project failing, one of the important factors is that not enough &lt;em&gt;planning and brainstorming&lt;/em&gt; has been done before starting a project. We jump right into the code without understanding the concept and setting or goals on what we want to achieve.&lt;/p&gt;


	&lt;p&gt;Not having the &lt;em&gt;technology available at the time&lt;/em&gt;. For example, with Rails, what is introduced in Rails 2.2 did not exist in previous versions of Rails.&lt;/p&gt;


	&lt;p&gt;Eliminate factors of a project that didn’t work before and develop a strategy on what can be done to improve them and how.&lt;/p&gt;


	&lt;h3&gt;Testing&lt;/h3&gt;


	&lt;p&gt;&lt;em&gt;Testing is crucial&lt;/em&gt; as in the long run, it will save time and money. Doing continuous testing on a project will enable you to see come across errors sooner, being able to correct them immediately, saving time and cost from the start of development.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Develop a test analysis&lt;/em&gt;, identifying various testing paths that we need to do to test the application and be obedient to implement these test strategies.&lt;/p&gt;


	&lt;h3&gt;Useful tools&lt;/h3&gt;


	&lt;p&gt;&lt;em&gt;Use useful tools at our disposal&lt;/em&gt;. Google used V8 or we could use WebKit. These tools help us develop faster and discover errors quicker. So much time is spent on testing, with the use of useful tools, we can develop applications faster, leaving more time for perfecting.&lt;/p&gt;


	&lt;p&gt;References for this article was taken from &lt;a href="http://www.google.com/googlebooks/chrome/small_00.html"&gt;Google chrome&lt;/a&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/QlDrjHNtrsg" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Sandro Paganotti</name>
    </author>
    <id>tag:www.railsonwave.com,2008-10-23:7845</id>
    <published>2008-10-23T08:32:00Z</published>
    <updated>2008-10-23T08:32:42Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2008/10/23/a-useful-task-for-cruisecontrol-rb" rel="alternate" type="text/html" />
    <title>A useful task for Cruisecontrol.rb</title>
<summary type="html">&lt;p&gt;A useful CruiseControl.rb tasks that adds some extra checks to your application.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;A useful CruiseControl.rb tasks that adds some extra checks to your application.&lt;/p&gt;
&lt;p&gt;By mixing some good posts (&lt;a href="http://webonrails.com/2007/08/30/customizing-cruisecontrol-build-for-rspec/"&gt;this&lt;/a&gt;, &lt;a href="http://hungrymachine.com/2008/6/4/rake-task-for-syntax-checking-a-ruby-on-rails-project"&gt;this&lt;/a&gt; and also &lt;a href="http://roodi.rubyforge.org/"&gt;this&lt;/a&gt;) we were able to create a :cruise task that:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Check ruby, yaml and erb code syntax;&lt;/li&gt;
		&lt;li&gt;Run all rspec tests;&lt;/li&gt;
		&lt;li&gt;Check for code quality.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;To use this task simply &lt;a href="http://www.railsonwave.com/assets/2008/10/23/custom_cc.rake"&gt;download ‘custom_cc.rake’&lt;/a&gt; inside your app/lib/tasks folder. The next time &lt;a href="http://cruisecontrolrb.thoughtworks.com/"&gt;CruiseControl.rb&lt;/a&gt; builds your application this task will be executed instead the standard one.&lt;/p&gt;


&lt;strong&gt;Requirements:&lt;/strong&gt;  
	&lt;ul&gt;
	&lt;li&gt;A bootstrap task (&lt;a href="http://www.railsonwave.com/railsonwave/2007/4/17/rake-db-bootstrap-and-foreign-keys"&gt;here&lt;/a&gt; and &lt;a href="http://alistairisrael.wordpress.com/2007/07/27/bootstrapping-your-database-with-ordered-fixtures/"&gt;here&lt;/a&gt;)&lt;/li&gt;
		&lt;li&gt;Roodi 1.3.0 ( gem install roodi)&lt;/li&gt;
		&lt;li&gt;CruiseControl.rb of course :)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;A note:&lt;/strong&gt;
Don’t try to include the roodi gem inside your application; that was one of our first mistakes we did as Roodi requires &lt;a href="http://facets.rubyforge.org/"&gt;facets&lt;/a&gt; and this gem seems to break things up inside Rails. That’s why we decided to call this quality checker using the &lt;a href="http://ruby-doc.org/core/classes/Kernel.html#M005979"&gt;Kernel.exec&lt;/a&gt; method.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/DL8UIQMhI-A" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2008-10-16:7816</id>
    <published>2008-10-16T09:29:00Z</published>
    <updated>2008-10-16T09:30:25Z</updated>
    <category term="Ruby on Rails" />
    <category term="Whodo.es" />
    <link href="http://www.railsonwave.com/2008/10/16/whodoes-new-functionalities" rel="alternate" type="text/html" />
    <title>WhoDoes has new functionalities</title>
<content type="html">
            &lt;p&gt;Us at WhoDoes are always trying to improve our project management system to make it more user-friendly for our customers.&lt;/p&gt;


	&lt;p&gt;We have added a few new functionalities to WhoDoes:&lt;/p&gt;


	&lt;p&gt;1) you are now able to assign tasks to a document in the repository section
2) The task edit has a new layout that enables you to add documents, and send a notification email only to those you have selected in the tick box.&lt;/p&gt;


&lt;p&gt;
&lt;img src="http://railsonwave.com/assets/2008/10/16/uploadfile.png" alt="" /&gt;
&lt;/p&gt;

	&lt;p&gt;Please try out these new functionalities at &lt;a href="http://whodo.es"&gt;WhoDoes 2.0&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;We would like to have your feedback on this new task edit layout, please e-mail us at feedback@whodo.es or click on the link on the task edit page.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/Ta2uO48PtB8" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2008-10-09:7796</id>
    <published>2008-10-09T10:33:00Z</published>
    <updated>2008-10-09T10:37:01Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2008/10/9/ruby-and-rails-visual-studio-ide" rel="alternate" type="text/html" />
    <title>Ruby and Rails Visual Studio IDE...???</title>
<content type="html">
            &lt;p&gt;I am sure you have read that a Visual Studio &lt;span class="caps"&gt;IDE&lt;/span&gt; for Ruby and Rails has been released, this probably will help those who are new to Ruby and we might even have some new comers to the Ruby on Rails community which is always welcome.&lt;/p&gt;


	&lt;p&gt;Even though this would be an advantage for those who are use to code completion, code indenting, bracket highlighting and matching and that what Visual Studio offers, to me this takes the fun out of Ruby on Rails.&lt;/p&gt;


	&lt;p&gt;I was introduced to Ruby on Rails last year April after being a Visual Studio user since it was launched, I must admit that at first I had to get use to the fact of programming without the code completer, but after a few weeks I was hooked, I loved the command line and programming dynamics of Ruby, with Ruby you are in control of your code, as my colleague described it, ruby is &lt;em&gt;“the kind of language that you can talk to”&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://railsonwave.com/assets/2008/10/9/TextMateScreenSnapz002.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;I feel with Code completer you become lazy and dependent on the &lt;span class="caps"&gt;IDE&lt;/span&gt;, in programming there is always more than one way of doing something and Ruby allows us to do just that, exploring our horizons.&lt;/p&gt;


	&lt;p&gt;Therefore I will not be uninstalling my Textmate any time soon…&lt;/p&gt;


	&lt;p&gt;&lt;cite&gt;If you have not yet read about it, &lt;a href="http://www.rubyinside.com/ruby-in-steel-pe-free-visual-studio-based-ruby-and-rails-ide-for-windows-1228.html"&gt;click here&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/iHz9xegxAXg" height="1" width="1"/&gt;</content>  </entry>
  <entry xml:base="http://www.railsonwave.com/">
    <author>
      <name>Annalisa Afeltra</name>
    </author>
    <id>tag:www.railsonwave.com,2008-10-03:7780</id>
    <published>2008-10-03T14:12:00Z</published>
    <updated>2008-10-03T14:13:39Z</updated>
    <category term="Ruby on Rails" />
    <link href="http://www.railsonwave.com/2008/10/3/upload-files-using-an-iframe" rel="alternate" type="text/html" />
    <title>Upload files using an iFrame</title>
<content type="html">
            &lt;p&gt;Firstly in Rails we need to call a method to refresh the page in the iframe, for example:&lt;/p&gt;


	&lt;p&gt;I have created a partial with the following:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
&amp;lt;iframe id="myframe" src="&amp;lt;%= url_for :action =&amp;gt; :file_upload" class="myiframe" scrolling=no style="border:0px;" &amp;gt;
&amp;lt;/iframe&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;This calls the method in the controller called &lt;em&gt;file_upload&lt;/em&gt; and updates the &lt;em&gt;iframe&lt;/em&gt; with the contents of the file &lt;strong&gt;file_update.rhtml&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Within the method I have included a variable to set the height of the iframe depending on the number of documents that are in the list.&lt;/p&gt;


	&lt;h3&gt;In our Controller&lt;/h3&gt;


&lt;pre&gt;
&lt;code&gt;
def file_upload
      @iframe_height = @documents.count
      @iframe_height = (@iframe_height * 28)+50;
end
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h3&gt;In our View&lt;/h3&gt;


	&lt;p&gt;When we load the iframe the following script is run in the body onload function and we pass the height parameter to it:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
&amp;lt;body onload="iframeSize('&amp;lt;%=@iframe_height%&amp;gt;');"&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

We call the script to set the size of the iframe
&lt;pre&gt;
&lt;code&gt;
&amp;lt;script type="text/javascript"&amp;gt; 
function iframeSize(size)
{
    var height = size+'px';
        var iframeElement = parent.document.getElementById('myframe'); 
    iframeElement.style.height = height; 
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Using the &lt;a href="http://agilewebdevelopment.com/plugins/attachment_fu"&gt;Attachment_Fu&lt;/a&gt; plugin, we create the form to upload the files:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
&amp;lt;% form_for :document, :url =&amp;gt; {:action=&amp;gt;'save_file'}, :html=&amp;gt;{:multipart =&amp;gt; true} do |f| %&amp;gt;
&amp;lt;div class="upload_document_box"&amp;gt;
&amp;lt;label for="name"&amp;gt;&amp;lt;%= "Title".t %&amp;gt;:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;%= f.text_field :title, :size=&amp;gt;25, :value=&amp;gt;''%&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;label for="name"&amp;gt;&amp;lt;%= "Attachment".t %&amp;gt;:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;input type="file" style="width: 385px;" size="44" name="document[uploaded_data]" id="document_uploaded_data" value=''/&amp;gt;
&amp;lt;input type="submit" value="upload" name="commit" onclick="check();"/&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;% end %&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;On the onclick of the submit button, we call the &lt;em&gt;check()&lt;/em&gt; function in the &lt;em&gt;script&lt;/em&gt;, this checks if a title of the document was inserted and that a document was uploaded. On our parent page we have a &lt;em&gt;div&lt;/em&gt; with an &lt;strong&gt;id&lt;/strong&gt; called “alertbanner”, this is where we will display the errors:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
function check()
{
var title = document.getElementById('document_title');
var doc = document.getElementById('document_uploaded_data');

if (title.value == '')
{
parent.$('alertbanner').insert({ top: "&amp;lt;p&amp;gt; Please insert a document title &amp;lt;/p&amp;gt;"});
}else
{
if (doc.value == '')
{
parent.$('alertbanner').insert({ top: "&amp;lt;p&amp;gt; Please select a document to upload &amp;lt;/p&amp;gt;"});
}
}
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;The last step is to upload the file to the Database in the &lt;em&gt;save_file&lt;/em&gt; method in the controller:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
def save_file
       @document = UploadedFile.new(params[:document])
       if @document.save!
         @error =  'Document was successfully uploaded'.t
         @task = @selected_task
         redirect_to :action=&amp;gt;'file_upload', :project_id =&amp;gt; @selected_project.id, :id=&amp;gt;@selected_task.id, :flag=&amp;gt; false
       end
end
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;With a successful upload of the file, the iframe will be refreshed with the new document in the list and assign a new height to the &lt;em&gt;iframe&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;Some have us might have used the plugin &lt;a href="http://agilewebdevelopment.com/plugins/responds_to_parent"&gt;responds_to_parent&lt;/a&gt; to update a list outside of the &lt;em&gt;iframe&lt;/em&gt;, it is a very useful plugin although I have tried a different method and I would appreciate any comments or suggestions that you might have.&lt;/p&gt;
          &lt;img src="http://feeds.feedburner.com/~r/Railsonwave-ruby-on-rails/~4/BWXYAbbKoeM" height="1" width="1"/&gt;</content>  </entry>
</feed>
