[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby search

Henry Savr

8/24/2006 4:55:00 PM

I want to manage the way how Ruby searches modules to load. I found,
that the $: variable is in charge, but it is read-only. Then I found
that RUBYLIB can be used to add directories.

As I have c:/PJ/lib and c:/PJ/test for my Windows souces I entered via
irb
RUBYLIB = ["c:/PJ/lib", "c:/PJ/test"] using the same Unix-style ("/"
instead of "\") as I saw in $:

When entered 'load "simple.rb"' I got "no such file to load".

How can I set RUBYLIB, or other variable to control the Ruby search?

PS. Changing slashes did not help

Thank you in advance

Henry

--
Posted via http://www.ruby-....

13 Answers

James Gray

8/24/2006 5:51:00 PM

0

On Aug 24, 2006, at 11:54 AM, Henry Savr wrote:

> I want to manage the way how Ruby searches modules to load. I found,
> that the $: variable is in charge, but it is read-only.

Na, you can change it:

>> $: << "search_here_last
"
=> ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/
site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/site_ruby", "/
usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-darwin8.5.2",
".", "search_here_last\n"]
>> exit
Firefly:~$ irb
>> $: << "search_here_last"
=> ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/
site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/site_ruby", "/
usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-darwin8.5.2",
".", "search_here_last"]
>> $:.unshift("search_here_first")
=> ["search_here_first", "/usr/local/lib/ruby/site_ruby/1.8", "/usr/
local/lib/ruby/site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/
site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-
darwin8.5.2", ".", "search_here_last"]

James Edward Gray II


Joel VanderWerf

8/24/2006 6:21:00 PM

0

Henry Savr wrote:
> I want to manage the way how Ruby searches modules to load. I found,
> that the $: variable is in charge, but it is read-only. Then I found
> that RUBYLIB can be used to add directories.

The _variable_ is read only, but the _object_ that it refers to (an
array of strings) is not frozen. You can modify the object:

irb(main):001:0> $: = 5
NameError: $: is a read-only variable
from (irb):1
irb(main):002:0> $:.unshift "."
=> [".", "/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/i686-linux",
"/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/i686-linux", "."]

Or you can use RUBYLIB to set $: for newly started ruby processes.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

O

5/25/2011 9:20:00 PM

0

In article <tI2dnXMxyNUY8kDQnZ2dnUVZ_sydnZ2d@supernews.com>, Frank
Berger <frankdberger@gmail.com> wrote:

> William Sommerwerck wrote:
> > "Frank Berger" <frankdberger@gmail.com> wrote in message
> > news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
> >
> >> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
> >> and was surprised that the "Volume 40" indicator was not printed on
> >> the cover. The CD indicates that it was "manufactured for BMG Direct
> >> Marketing Inc. under license." Why would RCA want to have a "special
> >> edition," otherwise identical, but missing the volume indicator?
> >
> > This is presumably the "record club" edition. It's possible BMG
> > didn't want members asking "Where are the other disks?".
>
> Makes sense, I guess.

I'd concur with William. Most of the discs I got from BMG record club
were marked that way.

-Owen

Pierre Paquin

5/25/2011 9:24:00 PM

0


"Frank Berger" <frankdberger@gmail.com> wrote in message
news:tI2dnXMxyNUY8kDQnZ2dnUVZ_sydnZ2d@supernews.com...
> William Sommerwerck wrote:
>> "Frank Berger" <frankdberger@gmail.com> wrote in message
>> news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>>
>>> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
>>> and was surprised that the "Volume 40" indicator was not printed on
>>> the cover. The CD indicates that it was "manufactured for BMG Direct
>>> Marketing Inc. under license." Why would RCA want to have a "special
>>> edition," otherwise identical, but missing the volume indicator?
>>
>> This is presumably the "record club" edition. It's possible BMG
>> didn't want members asking "Where are the other disks?".
>
> Makes sense, I guess.

I have the BMG record club and the volume 40 indicator *is" printed on the
front cover.



mark

5/26/2011 12:23:00 AM

0

On May 25, 2:07 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
> William Sommerwerck wrote:
> > "Frank Berger" <frankdber...@gmail.com> wrote in message
> >news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>
> >> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
> >> and was surprised that the "Volume 40" indicator was not printed on
> >> the cover. The CD indicates that it was "manufactured for BMG Direct
> >> Marketing Inc. under license."  Why would RCA want to have a "special
> >> edition," otherwise identical, but missing the volume indicator?
>
> > This is presumably the "record club" edition. It's possible BMG
> > didn't want members asking "Where are the other disks?".
>
> Makes sense, I guess.

That's the reason. I know as I was the person who issued most of those
club versions.

BTW - we did offer the complete AT in the "bookcase" version as a
special collection, but we didn't sell all that many as I remember.
That stock was drawn from BMG Classics stock.

As far as the "Vol 40" being in the inside cover of the CD booklet -
that's something that should have been removed. Looks like our
proofreaders (as well as me) missed that one.

William Sommerwerck

5/26/2011 12:33:00 AM

0

"Mark Stenroos" <markstenroos@yahoo.com> wrote in message
news:072d6a8e-d459-4e1e-8403-06bb3747e120@35g2000prp.googlegroups.com...

> We did offer the complete AT in the "bookcase" version as a
> special collection, but we didn't sell all that many as I remember.
> That stock was drawn from BMG Classics stock.

BMG probably charged "too much".

By the way, I bought so many disks that I had my own customer-service rep,
Denise Maio.


Frank Berger

5/26/2011 4:40:00 AM

0

Mark Stenroos wrote:
> On May 25, 2:07 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
>> William Sommerwerck wrote:
>>> "Frank Berger" <frankdber...@gmail.com> wrote in message
>>> news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>>
>>>> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
>>>> and was surprised that the "Volume 40" indicator was not printed on
>>>> the cover. The CD indicates that it was "manufactured for BMG
>>>> Direct Marketing Inc. under license." Why would RCA want to have a
>>>> "special edition," otherwise identical, but missing the volume
>>>> indicator?
>>
>>> This is presumably the "record club" edition. It's possible BMG
>>> didn't want members asking "Where are the other disks?".
>>
>> Makes sense, I guess.
>
> That's the reason. I know as I was the person who issued most of those
> club versions.
>
> BTW - we did offer the complete AT in the "bookcase" version as a
> special collection, but we didn't sell all that many as I remember.
> That stock was drawn from BMG Classics stock.
>
> As far as the "Vol 40" being in the inside cover of the CD booklet -
> that's something that should have been removed. Looks like our
> proofreaders (as well as me) missed that one.

Did someone say the "Vol 40" in in the inside cover? It isn't in mine, and
Pierre said it was on the front.

mark

5/26/2011 2:28:00 PM

0

On May 25, 9:40 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
> Mark Stenroos wrote:
> > On May 25, 2:07 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
> >> William Sommerwerck wrote:
> >>> "Frank Berger" <frankdber...@gmail.com> wrote in message
> >>>news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>
> >>>> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
> >>>> and was surprised that the "Volume 40" indicator was not printed on
> >>>> the cover. The CD indicates that it was "manufactured for BMG
> >>>> Direct Marketing Inc. under license." Why would RCA want to have a
> >>>> "special edition," otherwise identical, but missing the volume
> >>>> indicator?
>
> >>> This is presumably the "record club" edition. It's possible BMG
> >>> didn't want members asking "Where are the other disks?".
>
> >> Makes sense, I guess.
>
> > That's the reason. I know as I was the person who issued most of those
> > club versions.
>
> > BTW - we did offer the complete AT in the "bookcase" version as a
> > special collection, but we didn't sell all that many as I remember.
> > That stock was drawn from BMG Classics stock.
>
> > As far as the "Vol 40" being in the inside cover of the CD booklet -
> > that's something that should have been removed. Looks like our
> > proofreaders (as well as me) missed that one.
>
> Did someone say the "Vol 40" in in the inside cover? It isn't in mine, and
> Pierre said it was on the front.

Oops. Missed that.

It's entirely possible that some of those BMG Club orders were filled
with BMG Classics retail stock. Happened all the time when I was at
the club. We would run out 5,000 copies as a standard first run of
product. If sales slowed, we wouldn't do another run. Once we started
getting to the end of our stock, we'd offer the disc in a clearance
flier. If those sales exhausted our stock, we might turn to BMG and
purchase a few copies just to fill orders.

Also, BMG - and all of our other licensers - would often approach us
with lists of product that they were holding a lot of stock on,
looking to make a deal and sell off their inventory. If we did one of
those deals, the BMG Club member would be buying stock made for
retail.

I don't know what happened with that Vol 40. If the CD used gold leaf
on the booklet, then it wasn't a club issue. We stripped that
unnecessary expense out of product and substituted a PMS color for the
gold leaf. Saved a lot of money for us.

Frank Berger

5/26/2011 3:04:00 PM

0

Mark Stenroos wrote:
> On May 25, 9:40 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
>> Mark Stenroos wrote:
>>> On May 25, 2:07 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
>>>> William Sommerwerck wrote:
>>>>> "Frank Berger" <frankdber...@gmail.com> wrote in message
>>>>> news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>>
>>>>>> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
>>>>>> and was surprised that the "Volume 40" indicator was not printed
>>>>>> on the cover. The CD indicates that it was "manufactured for BMG
>>>>>> Direct Marketing Inc. under license." Why would RCA want to have
>>>>>> a "special edition," otherwise identical, but missing the volume
>>>>>> indicator?
>>
>>>>> This is presumably the "record club" edition. It's possible BMG
>>>>> didn't want members asking "Where are the other disks?".
>>
>>>> Makes sense, I guess.
>>
>>> That's the reason. I know as I was the person who issued most of
>>> those club versions.
>>
>>> BTW - we did offer the complete AT in the "bookcase" version as a
>>> special collection, but we didn't sell all that many as I remember.
>>> That stock was drawn from BMG Classics stock.
>>
>>> As far as the "Vol 40" being in the inside cover of the CD booklet -
>>> that's something that should have been removed. Looks like our
>>> proofreaders (as well as me) missed that one.
>>
>> Did someone say the "Vol 40" in in the inside cover? It isn't in
>> mine, and Pierre said it was on the front.
>
> Oops. Missed that.
>
> It's entirely possible that some of those BMG Club orders were filled
> with BMG Classics retail stock. Happened all the time when I was at
> the club. We would run out 5,000 copies as a standard first run of
> product. If sales slowed, we wouldn't do another run. Once we started
> getting to the end of our stock, we'd offer the disc in a clearance
> flier. If those sales exhausted our stock, we might turn to BMG and
> purchase a few copies just to fill orders.
>
> Also, BMG - and all of our other licensers - would often approach us
> with lists of product that they were holding a lot of stock on,
> looking to make a deal and sell off their inventory. If we did one of
> those deals, the BMG Club member would be buying stock made for
> retail.
>
> I don't know what happened with that Vol 40. If the CD used gold leaf
> on the booklet, then it wasn't a club issue. We stripped that
> unnecessary expense out of product and substituted a PMS color for the
> gold leaf. Saved a lot of money for us.


Yes, I see it's missing the gold leaf. I hadn't noticed that. There's also
a secondary ID number on the back cover (not on the CD itself) of "D
2170221C."


mark

5/26/2011 3:08:00 PM

0

On May 26, 8:04 am, "Frank Berger" <frankdber...@gmail.com> wrote:
> Mark Stenroos wrote:
> > On May 25, 9:40 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
> >> Mark Stenroos wrote:
> >>> On May 25, 2:07 pm, "Frank Berger" <frankdber...@gmail.com> wrote:
> >>>> William Sommerwerck wrote:
> >>>>> "Frank Berger" <frankdber...@gmail.com> wrote in message
> >>>>>news:VYednQXppp9E9EDQnZ2dnUVZ_vydnZ2d@supernews.com...
>
> >>>>>> I recently purchased Volume 40 (RCA 60308) from an Amazon vendor
> >>>>>> and was surprised that the "Volume 40" indicator was not printed
> >>>>>> on the cover. The CD indicates that it was "manufactured for BMG
> >>>>>> Direct Marketing Inc. under license." Why would RCA want to have
> >>>>>> a "special edition," otherwise identical, but missing the volume
> >>>>>> indicator?
>
> >>>>> This is presumably the "record club" edition. It's possible BMG
> >>>>> didn't want members asking "Where are the other disks?".
>
> >>>> Makes sense, I guess.
>
> >>> That's the reason. I know as I was the person who issued most of
> >>> those club versions.
>
> >>> BTW - we did offer the complete AT in the "bookcase" version as a
> >>> special collection, but we didn't sell all that many as I remember.
> >>> That stock was drawn from BMG Classics stock.
>
> >>> As far as the "Vol 40" being in the inside cover of the CD booklet -
> >>> that's something that should have been removed. Looks like our
> >>> proofreaders (as well as me) missed that one.
>
> >> Did someone say the "Vol 40" in in the inside cover? It isn't in
> >> mine, and Pierre said it was on the front.
>
> > Oops. Missed that.
>
> > It's entirely possible that some of those BMG Club orders were filled
> > with BMG Classics retail stock. Happened all the time when I was at
> > the club. We would run out 5,000 copies as a standard first run of
> > product. If sales slowed, we wouldn't do another run. Once we started
> > getting to the end of our stock, we'd offer the disc in a clearance
> > flier. If those sales exhausted our stock, we might turn to BMG and
> > purchase a few copies just to fill orders.
>
> > Also, BMG - and all of our other licensers - would often approach us
> > with lists of product that they were holding a lot of stock on,
> > looking to make a deal and sell off their inventory. If we did one of
> > those deals, the BMG Club member would be buying stock made for
> > retail.
>
> > I don't know what happened with that Vol 40. If the CD used gold leaf
> > on the booklet, then it wasn't a club issue. We stripped that
> > unnecessary expense out of product and substituted a PMS color for the
> > gold leaf. Saved a lot of money for us.
>
> Yes, I see it's missing the gold leaf.  I hadn't noticed that.  There's also
> a secondary ID number on the back cover (not on the CD itself) of "D
> 2170221C."

That second ID says it's a club-manufactured issue. The barcode is
also different from the retail issue, if there happens to be a barcode.