RSS

Archive for the ‘Ruby’ Category

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Aquarium is a framework that implements Aspect-Oriented Programming (AOP) for Ruby. The premise of AOP is that some concerns in an application will cut across the natural object boundaries of the problem domain. Rather than scatter duplicated code in each object to handle the cross-cutting concern, AOP modularizes the specification of which execution points are affected (called join points) and the actions that should be invoked at those points.

New in V0.4.0: Preliminary support for advising Java classes in JRuby! See the discussion here.

27 May 2008

Aquarium 0.4.2: Aspect-Oriented Programming for Ruby

Author: ceefour | Filed under: JRuby, Reviews, Ruby, Tutorials

Ruby-like firetruck

Upgrading to the latest RubyGems in Ubuntu Gutsy is a bit non-straightforward. I’d like to share a quick fix this time. It’s trivial when you know it, but if not, a friend of mine has almost hosed his system just because of this annoying “bug”.

Installing Ruby in Ubuntu is pretty simple:

sudo aptitude install ruby ri irb rdoc rubygems libruby-extras libmysql-ruby ruby1.8-dev

(add other packages as you see fit)

The problem occurs right after you upgrade RubyGems to the latest version:

sudo gem update --system

Then you get something like this:

24 Mar 2008

Fixing RubyGems in Ubuntu Gutsy Installation

Author: ceefour | Filed under: Beginner, Complaints, Ruby, Tips, Tools, Tutorials

While using Ruby for your projects, you may need some references.

These are some references that might help you in using Ruby:

  • Language

General Syntax Rules

  • Comments start with a pound/sharp (#) character and go to EOL.
  • Ruby programs are sequence of expressions.
  • Each expression is delimited by semicolons(;) or newlines unless obviously incomplete (e.g. trailing ‘+’).
  • Backslashes at the end of line does not terminate expression.

Reserved words

alias   and     BEGIN   begin   break   case    class   def     defined
do      else    elsif   END     end     ensure  false   for     if
in      module  next    nil     not     or      redo    rescue  retry
return  self    super   then    true    undef   unless  until   when
while   yield

Type

22 Mar 2008

Ruby Quick Reference

Author: ceefour | Filed under: HTML, Rails, Reviews, Ruby, Tools

Ruby is a high level, object-oriented open source scripting language. It has excellent support for regular expressions as a language feature.

In Ruby, a regular expression is written in the form of /pattern/modifiers where “pattern” is the regular expression itself, and “modifiers” are a series of characters indicating various options. The “modifiers” part is optional. This syntax is borrowed from Perl.

Ruby supports the following modifiers:

  • /i makes the regex match case insensitive.
  • /m makes the dot match newlines. Ruby indeed uses /m, whereas Perl and many other programming languages use /s for “dot matches newlines”.
18 Mar 2008

Using Regular Expressions with Ruby

Author: ceefour | Filed under: Ajax, Rails, Ruby, Tools

Advanced Rails

Advanced Rails offers you an in-depth look at techniques for dealing with databases, security, performance, web services and much more.

O’Reilly Media, Inc. published an intermediate-to-expert Rails book, authored by Brad Ediger:

Chapters in this book help you understand not only the tricks and techniques used within the Rails framework itself, but also how to make use of ideas borrowed from other programming paradigms. Advanced Rails pays particular attention to building applications that scale — whether “scale” means handling more users, or working with a bigger and more complex database.

You’ll find plenty of examples and code samples that explain:

16 Mar 2008

Advanced Rails: Go to the next level with Rails

Author: ceefour | Filed under: Books, News, Plugins, Rails, Reviews, Ruby, Web 2.0

Morph logo

Morph Labs is currently beta-testing their next-generation solution in application deployment, delivery, and management, the Morph Application Platform.

Acquiring hardware and configuring software to support web apps are things of the past. Morph Labs brings you the next-generation solution in application deployment, delivery, and management. Reduce your time to market and lower your startup costs no matter if you are an ISV, a developer or a business.

About Morph Labs

Morph Labs Inc. www.morphexchange.com is a Philippine-based Web 2.0 technology company focused on providing innovative technologies and applications to support Software as a Service (SaaS) globally.

Canadian Web Hosting provides shared, VPS, and dedicated web hosting for Canadian sites. They operate from a 1st Class Colocation facility located at Harbour Center in downtown Vancouver, BC, Canada. The advantage to international (i.e. non-Canadian) hosting services are obvious: they are much faster to access from Canada (with an added bonus that you pay in your native Canadian Dollars currency! ;) Hence, if your customers and/or your business is based on Canada, hosting your Rails site with them might be a perfect fit.

5 Feb 2008

Ruby on Rails Web Hosting for Canadian Sites

Author: ceefour | Filed under: News, Rails, Rails Hosting, Ruby, Web 2.0

Design Patterns in Ruby documents smart ways to resolve many problems that Ruby developers commonly encounter. Addison-Wesley Professional press has this exciting book, authored by Russ Olsen.

Russ Olsen has done a great job of selecting classic patterns and augmenting these with newer patterns that have special relevance for Ruby. Most design pattern books are based on C++ and Java. But Ruby is different—and the language’s unique qualities make design patterns easier to implement and use.

Monkeybars is a library that enables you to make use of Swing from JRuby.

Monkeybars aims to allow you to continue using the GUI editing tools you are used to but makes it easy to write all your application logic in pure Ruby. In fact, with most editors you’ll never even have to look at Java code.

Monkeybars was created from a pretty specific need. Rising Tide Software company was working on a large Swing application and wanted to be able to easily write all the logic in Ruby via JRuby. The initial attempts laid the groundwork for what was to become Monkeybars. Monkeybars has an emphasis on using normal Swing development tools (using Netbeans 6) and especially the ability to sit down with a client and use a visual designer to create the Swing layouts.

29 Jan 2008

Monkeybars: Swing Development for (J)Ruby

Author: ceefour | Filed under: GUI, JRuby, Ruby, Tools

Practical Reporting with Ruby and Rails is a great book for Ruby and Rails developers seeking to create compelling business intelligence and reporting solutions using a wide variety of applications and services. Published by Apress, and the author is David Berube.

Business intelligence and real-time reporting mechanisms play a major role in any of today’s forward-looking business plans. With many of these solutions being moved to the Web, the popular Rails framework and its underlying Ruby language are playing a major role alongside web services in building the reporting solutions of tomorrow.