Ruby

TwitterFacebook
Get flash to fully experience Pearltrees
http://c2.com/cgi/wiki?PythonVsRubyCodeExamples Moved from PythonVsRuby : (See also PythonRubyAttrComparison , PythonRubyInitializer ) In RubyLanguage , every object has a method called "method_missing", which is called every time an undefined method is invoked. You can override method_missing, for super-reflective ease in creating things such as facades. Does PythonLanguage have this feature? In Python you would override the method __getattr__(self, name). From this method you can either delegate to another method or throw an exception.

Python Vs Ruby Code Examples

Python Vs Ruby

http://c2.com/cgi/wiki?PythonVsRuby So, how do Python and Ruby compare? They look more similar to each other than either does to Perl. What are the differences? Points of comparison: Overview Heritage and Philosophy Popularity Readability Ease for Beginners Ruby Blocks and Python Lambdas Development Environments Community and Documentation Libraries, Platforms and Applications Performance Opinions : Leaving Python for Ruby / Leaving Ruby for Python (anybody?) Misc.
Playing with my son on Lego NXT requires me to get Ruby in the mix just for fun. Here is the install notes that I used to get everything going. cd /tmp # Ruby Serial svn export http://ruby-serialport.rubyforge.org/svn/trunk ruby-serial cd ruby-serial ruby extconf.rb make sudo make install cd .. # Install libusb svn export https://libusb.svn.sourceforge.net/svnroot/libusb/trunk/libusb libusb cd libusb sh autogen.sh ./configure make sudo make install cd .. # Ruby USB svn export svn://svn@svn.a-k-r.org/akr/ruby-usb/trunk ruby-usb cd ruby-usb ruby extconf.rb make sudo make install cd .. # Ruby NXT gem install ruby-nxt # Try it in IRB require 'rubygems' require 'nxt_comm' comm = NXTComm.new comm.connected? comm.get_device_info comm.get_firmware_version <p style="text-align:right;color:#A8A8A8"></p> http://dysinger.net/2007/12/29/using-ruby-to-control-lego-mindstorms-nxt/

Using Ruby to Control Lego Mindstorms NXT - Tim Dysinger

Ruby Array | Jonathan Hui

http://www.jonathanhui.com/ruby-array Ruby Literal Array [1, 2, 3, 4, 5] # 5 elements array [a..z, A..Z] # An array of two ranges [[1,2],[3,4]] # Nested arrays [1..2, [1,2,4], 4, "val" ] # Mixed type Array[1,2,3] # [1, 2, 3] [0,1]*2 # [0, 1, 0, 1] Breaking text into a Ruby array words = %w[Break this into an array of words] # [ "Break" , " this " , ..., "words" ] letters = %w|aa b c d| # [ "aa" , "b" , "c" , "d" ] letters = %W(aa b c d) # [ "aa" , "b" , "c" , "d" ] Instantiate an Ruby array
All that you need to get Ruby-Processing going is Ruby (1.8 or 1.9) and Java (1.5 or 1.6) — and your machine probably came with both of those baked-in. Then, naturally, you’ll need to get your hands on Ruby-Processing itself. It’s available as a Ruby Gem: sudo gem install ruby-processing Ruby-Processing provides you with the rp5 command, which is what you’ll use to run all the Ruby-Processing commands. Try typing rp5 --help to get a brief overview of the options.

Getting Started · jashkenas/ruby-processing Wiki

https://github.com/jashkenas/ruby-processing/wiki/Getting-Started
https://rvm.beginrescueend.com/rvm/basics/

RVM: Ruby Version Manager - RVM Basics

$ rvm help # Documentation Index Wondering why you should use RVM? For a start, not only does RVM make installing multiple ruby interpreters / runtimes easy and consistent, it provides features such as gemsets that aren't typically supported out of the box on most ruby installs. RVM also lets you use different rubies in a manner that wont mess with your existing ruby install (unless you tell it to) as well as letting you run multiple different rubies in seperate terminals concurrently! Getting started

Deploying with JRuby

About this Book 224 pages Published: Release: P1.0 (2012-07-09) ISBN: 978-1-93435-697-5 NEW : See this video on using Torquebox for high-availability deployment on the JVM . http://pragprog.com/book/jkdepj/deploying-with-jruby

Xcode 4.3 MacRuby compatible problem workaround - 東 . Blog

http://lldong.github.com/blog/2012/03/05/xcode-4-dot-3-macruby-compatible-problem-workaround/ Since Xcode 4.3 has became a standalone app, it’s no longer installed in the /Developer directory. This cause the MacRuby project template disappear from Xcode 4.3. After some digging in the MacRuby-devel mailing list, I found some workaround to this problem: First, you need to move the MacRuby template files to the user’s shared folder:

Using the Ruby Development Tools plug-in for Eclipse

http://www.ibm.com/developerworks/opensource/library/os-rubyeclipse/ Editor's note : To learn what's new and changed in RDT since this article was written, read the developerWorks article " Easy Ruby development, the Eclipse way ." Why Ruby? Why would any self-respecting Java developer care about Ruby? Ruby is a general-purpose scripting language created 10 years ago in Japan.

RubyCocoa

http://rubycocoa.sourceforge.net/doc/ http://www.rubycocoa.com Ruby is a dream language to write Cocoa code in -- you get automatic garbage collection and an algol syntax, eg: box = [[ NSBox alloc] initWithFrame: NSZeroRect ]; [box setEnabled:NO]; would be written in Ruby as: http://cocoadev.com/wiki/RubyCocoa
It's exciting times for MacRuby developers. MacRuby 0.10 was recently released, and Xcode 4 is finally out. And while Apple has announced that MacRuby will be included in Lion, it will be a private framework, not a public one. For now, you need to include the MacRuby framework inside your application bundle . This post shows you how.

MacRuby & Xcode 4: Build a Self-Contained MacRuby Application - The Ranger Station