Archiv der Kategorie ‘Ruby‘

Ruby en Rails 2009 Conference in Amsterdam

Dienstag, den 3. November 2009

This year’s Ruby en Rails conference in Amsterdam was a great success. A lot of great speakers came together with an amazing audience. Besides the two Rails talks from Jeremy Kemper and  Yehuda Katz there were a lot of really interesting talks. Jonathan Weiss’ Talk about Rails Security, for instance, was very interesting and should [...]

RTeX::Document::GenerationError with Phusion Passenger

Donnerstag, den 17. September 2009

In a recent project I experienced a RTeX::Document::GenerationError only when using Phusion Passenger. After a closer look I’ve seen that the PDF has been successfully created but the redirect to the following request failed. Everything works fine with mongrel. However, the error messaged looked like the following: RTeX::Document::GenerationError in BillsController#index</h3> <pre>Could not find result PDF [...]

Free Ruby – Email2sms – E-Mail to SMS Gateway

Samstag, den 29. August 2009

Email2sms has been developed by www.avarteq.de. Email2sms is a free and pure Ruby E-Mail to sms gateway including an extensible filterchain to filter and manipulate incoming emails before sending them as text messages. Requirements In order to run Email2sms you will need the following. IMAP Mailbox DeveloperGarden Account with credits. Have a look at developergarden.com [...]

Ruby – Socket programming – TCPSocket – Documentation

Montag, den 24. August 2009

If you need to write an application using TCP sockets under Ruby you should have a look at the following docs: Ruby Core RDoc: http://ruby-doc.org/core/classes/TCPSocket.html Programming Ruby, The Pragmatic Programmer’s Guide, Network and Web Libraries

MacOS X – Rails – RTex – Latex Installieren – Unicode – ucs.sty

Samstag, den 15. August 2009

In order to create PDFs with unicode (utf8) support within a Ruby on Rails app on Mac OS X, you need a fully working Latex installation including the ucs.sty extension. The best way to install Latex on a Mac OS X is using MacPorts. The following command will install Tex, Latex and a whole bunch [...]

Ruby – Visibility of private and protected module methods when mixed into a class

Freitag, den 7. August 2009

Consider you have a module defining a public, a protected and a private method. What happens to this visibility declaration after mixing the module into a class? Does Ruby ignore visibility information or does Ruby take over the visiblity settings? The following example demonstrates that Ruby preserves the module’s visibility settings and keeps private methods [...]

Ruby (on Rails) – Wirble – Pimp my IRB and Console

Montag, den 20. Juli 2009

Ever wanted a colored irb or script/console? Well, you should try wirble. It gives you a number of enhancements for Irb. Some of the features are: Tab completion Colorized results … Installation is easy as pie:  sudo gem install wirble vi .irbrc require ‘rubygems’ require ‘wirble’ # start wirble (with color) Wirble.init Wirble.colorize

Ruby Basics – * method arguments

Sonntag, den 19. Juli 2009

If you have ever asked yourself what is behind arguments like *this then here is the trivial answer: A small ruby script like this: #!/usr/bin/env ruby def my_method(a,b,*c) puts “a: ” + a puts “b: ” + b puts “c:” c.each { |ce| puts ce } end my_method(“a1″, “b2″, “c3″, “c4″, “c5″, “c6″) Produces the [...]

Ruby on Rails 2.3 – Nested Attributes with AJAX support

Sonntag, den 12. Juli 2009

Introduced in Rails 2.3 nested attributes help to shorten code if you want to edit multiple nested models within a single form. Here the corresponding article from the rails weblog: http://weblog.rubyonrails.org/2009/1/26/nested-model-forms There is also a very good tutorial on nested forms from Ryan Daigle: http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes Right now it seems as if there is no clean [...]

Ruby – Test::Unit – Invoke a single test from the command line

Mittwoch, den 24. Juni 2009

Sometimes you don’t want to execute your while test suite but only a single test of it. Actually this is easy as pie. Just append –name and the name of the test method. ruby your_test.rb –name test_new_call_a_doesn_pick_up That’s it.