background preloader

RoR - Ruby on Rails

Facebook Twitter

Ruby-amqp/amqp. File: Ruby amqp gem: Getting Started with AMQP and Ruby — Documentation by YARD 0.7.5. This Documentation Has Moved to rubyamqp.info amqp gem documentation guides are now hosted on rubyamqp.info.

File: Ruby amqp gem: Getting Started with AMQP and Ruby — Documentation by YARD 0.7.5

About this guide This guide is a quick tutorial that helps you to get started with v0.9.1 of the AMQP specification in general and the Ruby amqp gem in particular. It should take about 20 minutes to read and study the provided code examples. This guide covers: Installing RabbitMQ, a mature popular server implementation of the AMQP protocol. Installing and Configuring RabbitMQ. File: Ruby AMQP gem: Working with queues — Documentation by YARD 0.7.5. This Documentation Has Moved to rubyamqp.info amqp gem documentation guides are now hosted on rubyamqp.info.

File: Ruby AMQP gem: Working with queues — Documentation by YARD 0.7.5

About this guide This guide covers everything related to queues in the AMQP v0.9.1 specification, common usage scenarios and how to accomplish typical operations using the amqp gem. This work is licensed under a Creative Commons Attribution 3.0 Unported License (including images & stylesheets). The source is available on Github. Which versions of the amqp gem does this guide cover? This guide covers v0.8.0 and later of the Ruby amqp gem. Message queue - ActiveMQ or RabbitMQ or ZeroMQ or. Locomotive — Ruby on Rails Open source CMS. Ruby on Rails CMS that supports Rails 3 - Refinery CMS. Ruby 1.9 Encodings: A Primer and the Solution for Rails. May 5th, 2010 UPDATE: The DataObjects drivers, which are used in DataMapper, are now updated to honor default_internal.

Ruby 1.9 Encodings: A Primer and the Solution for Rails

Let’s keep this moving. Since Ruby 1.9 announced support for encodings, there has been a flurry of activity to make existing libraries encoding aware, and a tornado of confusion as users of Ruby and Rails have tried to make sense of it. In this post, I will lay out the most common problems people have had, and what we can do as a community to put these issues to bed in time for Ruby 1.9.2 final. A Quick Tour I’m going to simplify some of this, but the broad strokes are essentially correct. Before we begin, many of you are probably wonder what exactly an “encoding” is. On disk, all Strings are stored as a sequence of bytes. The list of English characters represented by the first seven bits of ASCII (characters 0 through 127 in “ASCII-7″) have the same representation in many (but not all) encodings. First, we create a String (“hello ümlaut”) in the UTF-8 encoding.

Thanks. Building Ruby on Rails 3 custom validators. Actually this post is not so much about just building custom validators for Rails 3 but more like a in-depth introduction to how validations work in the old and new versions of rails.

Building Ruby on Rails 3 custom validators

And in addition to that I’m going to implement Rails 3 compatibility for the validates_existence gem, which we maintain and use extensively in our projects. The “old” stuff First I’m going to give you a quick overview of the gems current functionality, plus basic explanation of how it’s implemented. The gem itself contains a single validation – validates_existence_of, which validates belongs_to relations by making a query to the database and checking if the record actually exists. It supports regular relations (i.e where you know the class of the related class) and polymorphic relations, validations on both the association name and the association foreign key.

Quick example of the validation in action: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) By Joel Spolsky Wednesday, October 08, 2003 Ever wonder about that mysterious Content-Type tag?

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

You know, the one you're supposed to put in HTML and you never quite know what it should be? Did you ever get an email from your friends in Bulgaria with the subject line "???? ?????? I've been dismayed to discover just how many software developers aren't really completely up to speed on the mysterious world of character sets, encodings, Unicode, all that stuff. But it won't. So I have an announcement to make: if you are a programmer working in 2003 and you don't know the basics of characters, character sets, encodings, and Unicode, and I catch you, I'm going to punish you by making you peel onions for 6 months in a submarine.

The Lowdown on Routes in Rails 3. Today's blog post is by a guest community contributor, [Rizwan Reza]( Rizwan is an active member of the Rails community, and as of late, has been working to clean up the overgrown Lighthouse queue.

The Lowdown on Routes in Rails 3

We're happy to have him write for those seeking advice on deploying on a [Platform as a Service]( Stop! Stop procrastinating and install Rails 3 now with RVM. June 28, 2010 A couple of weeks ago at a get-together of local developers, someone mentioned he hadn’t checked out Rails 3 yet because he didn’t want pre-release software mucking up his usual development environment.

Stop procrastinating and install Rails 3 now with RVM

I don’t blame him—this is a reason I also put off checking out earlier releases of Rails 3. That was before I got a new computer and set up Ruby from scratch, using the why-didn’t-someone-think-of-this-sooner Ruby Version Manager (RVM). Simply put, RVM lets you have multiple versions of Ruby on your computer, and keeps these Rubies and any gems you install in your user account. No root access or sudo is required to install.

In addition to managing Ruby versions, RVM gives you a second killer feature—the ability to create gemsets, which are exactly what they sound like. The tutorials on the RVM website cover all of the steps to get going, but they may require a little hunting and can be daunting if you don’t know what you’re doing. Moving from beginner to intermediate Rails development. July 05, 2010 I believe that Rails is an excellent way to get started on server-side web development.

Moving from beginner to intermediate Rails development

The framework provides a good structure that’s easy to understand, and provided you follow some fairly basic rules, you can have a functioning web application up and running pretty quickly. Add to that the gems and plugins that add near-instant functionality, and even newcomers can show off useful, good-looking web apps. Ruby on Rails Guides. ActiveRecord association extensions and method_missing. The semantics of method calls in Ruby are simple: Call the named method; orIf no method exists, call #method_missing() instead.

ActiveRecord association extensions and method_missing

Normally #send() obeys these rules as well. ActiveRecord association proxies mangle #send()‘s semantics, however, violating the POLS and potentially breaking your code in the process. Let’s say we have some monsters: class Monster < ActiveRecord::Base has_many :friendships has_many :friends, :through => :friendships end class Friendship < ActiveRecord::Base belongs_to :monster belongs_to :friend, :class_name => "Monster" end cookie = Monster.create(:name => "Cookie Monster", :color => "blue") grover = Monster.create(:name => "Grover", :color => "blue") oscar = Monster.create(:name => "Oscar the Grouch", :color => "green") clancy = Monster.create(:name => "Clancy", :color => "green") Cookie monster, being a personable kinda guy, is friends with all the others: Bonjour gem.