background preloader

Rails

Facebook Twitter

Data on Rails - Google Data Protocol - Google Code. Eric Bidelman, Google Data APIs Team February 2009 Contents Introduction "Where's Ruby on the list of client libraries? " Motivated by the ferocious appetite of our developers and the enduring popularity of Ruby on Rails (RoR), my colleague Jeff Fisher has forged a Ruby utility library from the fiery depths of Mount Doom. Mind you, it's not a full-blown client library, but it does handle the fundamentals like authentication and basic XML manipulation. It also requires you to work directly with the Atom feed using the REXML module and XPath. Audience This article is intended for developers interested in accessing the Google Data APIs using Ruby, specifically Ruby on Rails. Getting Started Requirements Ruby 1.8.6 patch level 114+ downloadRubyGems 1.3.1+ downloadRails 2.2.2+ download Installing the Google Data Ruby Utility Library To obtain the library, you can either download the library source directly from project hosting or install the gem: sudo gem install gdata Authentication ClientLogin AuthSub #!

Api-ruby-client - Google APIs Client Library for Ruby. Showing google calendar events in rails view. Toute l'actualité Ruby en français. Ruby sample code | Viadeo API. You can find below a sample code implementing OAuth2 and an access to the ‘/me’ endpoint. The script will redirects you to the Viadeo OAuth2 authentication page, just enter some Viadeo credentials and you will be redirected to ‘ with the accesss_token set. This samples runs with Ruby 1.8 + Rails 2.3.4. Note: Error catching is here minimal, you have to implement a better error management. Please also note than if you activate cookies, the authentication session of the user will be kept. Locomotive — Ruby on Rails Open source CMS. Full text search in in Rails with Sunspot and Solr « TechBot. The book you should get to dig deeper into Solr Click here if you want to see a PDF version of this tutorial.

Full source code for this tutorial is available at GitHub. Everyone wants to take their databases to run everything as fast as possible. We usually say query less, add more caching mechanisms, add indexes to the columns being searched, but another solution is not to use the database at all and look for better solutions for your querying needs. When querying for text in our databases, we’re often doing “LIKE” searches. Like searches are only performant if we have an index in that field and the query is written in a way that the index is used. Imagine that you have a field “name” and it contains the text “Battlestar Galactica”. The database would be able to optimize this query and use the index to find the expected row.

Your DBA getting ready to hit you That’s where full text search based solutions come in for help. Starting the engines Download the Sunspot source code from Github . Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase comparison :: KKovacs. While SQL databases are insanely useful tools, their monopoly in the last decades is coming to an end. And it's just time: I can't even count the things that were forced into relational databases, but never really fitted them. (That being said, relational databases will always be the best for the stuff that has relations.) But, the differences between NoSQL databases are much bigger than ever was between one SQL database and another. This means that it is a bigger responsibility on software architects to choose the appropriate one for a project right at the beginning. In this light, here is a comparison of Open Source NOSQL databases: The most popular ones # Redis # Best used: For rapidly changing data with a foreseeable database size (should fit mostly in memory).

For example: To store real-time stock prices. Cassandra # Best used: When you need to store data so huge that it doesn't fit on server, but still want a friendly familiar interface to it. MongoDB # ElasticSearch # CouchDB # Accumulo # API-based Client/Server Applications with TDD and ActiveResource. Rails 3 in a Nutshell. Generate Sitemap in Rails. If you don't know what is a sitemap, I strongly encourage you to fill this gap in knowledge first and then get back to reading. It seems to be clear that manual updating a sitemap can turn into a horror. Hopefully we can make the Rails do the job for us. My eBook: “Memoirs of a Software Team Leader” Read more » So, what components are we going to need to build a dynamic sitemap? Well, we are going to need a separate action (or even controller), an XML view and model methods to provide us with URL data. Let's start from creating the Sitemap controller and its index action: Above code will create the app/views/sitemap/index.html.erb file, but we need to change its extension to rxml.

To instruct Rails to send appropiate content type headers, we need to set the headers option inside the controller. The next thing we are going to need is an adequate XML view, located in the app/views/sitemap/index.rxml file. The next part is application-specific. Voila! Nuts & Bolts: Campfire loves Erlang. A couple of years ago a lot of buzz started in the Ruby community about Erlang, a functional programming language developed by Ericsson originally for use in telecommunications systems.

I was intrigued by the talk of fault tolerance and concurrency, two of the cornerstones that Erlang was built on, so I ordered the Programming Erlang book written by Joe Armstrong and published by the Pragmatic Programmers and spent a couple of weeks working through it. A year later, Kevin Smith began producing his excellent Erlang in Practice screencast series in partnership with the Pragmatic Programmers. It’s amazing how much difference it made for me to be able to watch someone develop Erlang applications while talking through his thought process along the way.

As I was learning Erlang, I kept threatening to rewrite the poller service that handles updating Campfire chat rooms when someone speaks in room. The code that Jamis wrote worked fine, but it was not very idiomatic Erlang.