ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
require an entire package?
by Juston other posts by this author
Jul 1 2009 3:20PM messages near this date
[ANN] unicorn 0.9.0 (experimental release) | Re: require an entire package?
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

    Common
        -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!
Thread:
Juston
Michael Linfield
Michael Linfield
Juston
Gary Chris
David A. Black

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved