background preloader

Ruby

Facebook Twitter

Learn Rails by Example book and screencasts by Michael Hartl. Michael Hartl Contents Foreword My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP (Google me to read about the drama).

Learn Rails by Example book and screencasts by Michael Hartl

This book by Michael Hartl came so highly recommended that I had to try it, and the Ruby on Rails Tutorial is what I used to switch back to Rails again. Though I’ve worked my way through many Rails books, this is the one that finally made me “get” it. The linear narrative is such a great format. Enjoy! Derek Sivers (sivers.org) Founder, CD Baby Acknowledgments The Ruby on Rails Tutorial owes a lot to my previous Rails book, RailsSpace, and hence to my coauthor Aurelius Prochazka. I’d like to acknowledge a long list of Rubyists who have taught and inspired me over the years: David Heinemeier Hansson, Yehuda Katz, Carl Lerche, Jeremy Kemper, Xavier Noria, Ryan Bates, Geoffrey Grosenbach, Peter Cooper, Matt Aimonetti, Gregg Pollack, Wayne E. About the author Copyright and license. Ruby on Rails. RubyStack - Free installers, virtual machines and cloud hosting images. Rapid GUI Development with QtRuby.pdf. Ruby Howto: Graphical User Interface.

As explained more fully here, Ruby is a relatively young language that maximizes programmer productivity. This article shows how to create a GUI frontend for your Ruby programs. It is assumed that the reader is running Linux and has typical development software installed: Ruby itself (this article's examples run on Ruby 1.8.4). A GUI interface designer, either qtdesigner or kdevdesigner (essentially equivalent programs). The Qt libraries, normally installed if the user is running the KDE desktop. The Ruby Qt interface qtrubyinit (test for presence with "which qtrubyinit"). This section provides the sequence of steps to create a Ruby GUI program that relies on the Qt libraries.

(qtdesigner) sampledialog.ui -> (rbuic) -> sampledialog_ui.rb -> (subclass) -> sampledialog.rb Now we will create a simple Ruby GUI program as an example of the process outlined above. Ruby: Is nil? - Blog. For many beginning Rubyists, especially those having experience in other programming languages such as Java or C, checking whether variable is nil may seem a little bit confusing.

Ruby: Is nil? - Blog

And even those speaking Ruby quite fluently don't usually know the tiny little details that stand behind the nil object. NilClass and Nil Object In Ruby, there are no primitives. I don't mean people hunting for mammoths and living in caves, I mean primitive types. That is, there is no distinction between simple variables (like numbers) and more complicated ones. My eBook: “Memoirs of a Software Team Leader” Read more » Former Java or C programmers are used to treat NULL as a special value or even a keyword. Ruby synthax explained. Ruby Basic Tutorial - More in depth. Troubleshooters.Com, Code Corner and Ruby Revival Present Ruby Basic Tutorial Copyright (C) 2005 by Steve Litt Note: All materials in Ruby Revival are provided AS IS.

Ruby Basic Tutorial - More in depth

By reading the materials in Ruby Revival you are agreeing to assume all risks involved in the use of the materials, and you are agreeing to absolve the authors, owners, and anyone else involved with Python Patrol of any responsibility for the outcome of any use of these materials, even in the case of errors and/or omissions in the materials. If you do not agree to this, you must not read these materials. To the 99.9% of you honest readers who take responsibility for your own actions, I'm truly sorry it is necessary to subject all readers to the above disclaimer. 5 ways to run commands from Ruby.

Every so often I have the need to execute a command line application from a Ruby application/script.

5 ways to run commands from Ruby

And every single time I fail to remember what the different command-executing methods Ruby provides us with do. This post is primarily a brain dump to aid my failing memory, and it was triggered by an issue with my Redmine Github Hook plugin where STDERR messages were not being logged. The goal of this exercise is basically to figure out how to run a command and capture all its output – both STDOUT and STDERR – so that the output can be used in the calling script. err.rb The test script I’ll be running basically outputs two lines, one on STDOUT, the other on STDERR: #! Kernel#` (backticks) Returns the standard output of running cmd in a subshell. >> `. STDERR is output, but not captured STDOUT is captured Kernel#exec Replaces the current process by running the given external command. >> exec('. Module: Open3 (Ruby 2.0) Open stdin, stdout, and stderr streams and start external executable.

Module: Open3 (Ruby 2.0)

In addition, a thread for waiting the started process is noticed. The thread has a pid method and thread variable :pid which is the pid of the started process. Block form: Open3.popen3([env,] cmd... [, opts]) {|stdin, stdout, stderr, wait_thr| pid = wait_thr.pid ... exit_status = wait_thr.value } Non-block form: Code School - TryRuby. Code School - Rails for Zombies.