Squid Spectre
July 1st, 2009, 10:42 PM
I'm about three weeks into Ruby coming from C++ and Java and enjoying it so far. I've spent a lot of time reading "The Ruby Way" 2nd ed from about cover to cover but the old brain is still very much in the beginner's stage of understanding some of subtleties
The problem I'm trying to solve is that I am writing a rather large application that consists of about 8 packages each with their own set of Ruby classes. It kind of looks like this:
Project
Commo
-Main.rb
-Designator.rb
-Interpreter
-DomainInterpreter.rb
...(more packages with more classes/modules)
In most instances I have to require one or more item from the same (or other) package for each given class to do its job. However, in some cases a class requires an entire package. While it isn't a problem to require each one individually, it is a bit of a nuisance. In java you can do 'import java.io.*' and import a whole set of items at once.
The question I have is, "Is there a way to require multiple items from the same package in one line of code in Ruby 1.8.6?"
Thanks in advance for the time and help!
The problem I'm trying to solve is that I am writing a rather large application that consists of about 8 packages each with their own set of Ruby classes. It kind of looks like this:
Project
Commo
-Main.rb
-Designator.rb
-Interpreter
-DomainInterpreter.rb
...(more packages with more classes/modules)
In most instances I have to require one or more item from the same (or other) package for each given class to do its job. However, in some cases a class requires an entire package. While it isn't a problem to require each one individually, it is a bit of a nuisance. In java you can do 'import java.io.*' and import a whole set of items at once.
The question I have is, "Is there a way to require multiple items from the same package in one line of code in Ruby 1.8.6?"
Thanks in advance for the time and help!