[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

require_gem scoping issue?

Pawel Szymczykowski

11/7/2006 4:47:00 AM

Hi all,

I'm running into a weird problem with rubygems and using
'require_gem'. Given the following code,

-- being code --

require 'rubygems'
require_gem 'mechanize', '>= 0.6.3'

class MyClass

def initialize
@agent = WWW::Mechanize.new # Line 7
end

end

mc = MyClass.new # Line 12

-- end code --

I get this error:

NameError: uninitialized constant MyClass::WWW

method initialize in untitled document at line 7
at top level in untitled document at line 12

Could it be that I'm missing something really obvious? When I replace
the require_gem line with just "require 'mechanize'", it works
according to my expectations. I'm using ruby 1.8.4, rubygems 0.9.0
(also tried with 0.8.11) and mechanize is at 0.6.3 as a gem. It
doesn't seem to matter if the explicit version is there or not, the
same error is produced.

Thanks!

-Pawel

10 Answers

Pawel Szymczykowski

11/7/2006 5:13:00 AM

0

On 11/6/06, Pawel Szymczykowski <makenai@gmail.com> wrote:
> Hi all,
>
> I'm running into a weird problem with rubygems and using
> 'require_gem'. Given the following code,

Hm.. nevermind. I'm a fool. A foolish fool. I just found the following
pages that explains the issue:

http://redhanded.hobix.com/inspect/autorequireIsBasicallyGoneEve...
http://desperatepundit.com/blog/cremes/technology/2006/05/30/Ruby-Tip-1-require-gem-is-unnece...

So it looks like I have to do:

require_gem 'mechanize', '>= 0.6.3'
require 'mechanize'

In order to require and load a specific version of a gem. Oh well.

-Pawel

Hawk

11/4/2010 11:42:00 PM

0

On Nov 4, 7:30 pm, DugFreez <dugfr...@live.com> wrote:
> On Nov 4, 6:38 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
>
>
> > Spiderman already has all the protection from factory.  There is Mylar
> > in the bumper area and also the flipper lanes where the ball drops.
> > The only protection you need for this game is:
>
> > - plastic protectors from Pinbits
> > - cab protectors for the legs.
>
> > That is all.
>
>   My BSM had mylar around the pops but nothing near the drops into the
> return lanes. This is the first I had ever heard anyone mention that.
>
>   I put some stealth mylar under the ramp flaps. Under the ball drops
> in the return lane, and what seems to be the most important
> place....IN THE SHOOTER LANE. I can almost guarantee that everyone
> that hasn't put some protection in the shooter lane has paint missing
> or cracked.
>
>   I hadn't heard a anyone mention this area until mine was already
> showing wear. Here is a pic of this area:
>
> http://i48.photobucket.com/albums/f231/dugfreez/Public/DS...
>
>   Protect yourself...word.

The Spiderman I got was from the latest run. It has mylar squares
with a spider printed on it in the flipper lane ball drops. Maybe
they didn't do this in the first run. As for the shooter lane, I
didn't think of that. Mine is only 1 1/2 months old so there hasn't
been any wear there. I think I'll do that as well.



DugFreez

11/5/2010 2:11:00 AM

0

On Nov 4, 7:42 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
> The Spiderman I got was from the latest run.  It has mylar squares
> with a spider printed on it in the flipper lane ball drops.  Maybe
> they didn't do this in the first run.  As for the shooter lane, I
> didn't think of that.    Mine is only 1 1/2 months old so there hasn't
> been any wear there.  I think I'll do that as well.

The playfield already has a spider printed there....are you sure a
spider is printed on the mylar also? Sounds strange.

Hawk

11/5/2010 2:22:00 AM

0

On Nov 4, 10:11 pm, DugFreez <dugfr...@live.com> wrote:
> On Nov 4, 7:42 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
>
>
> > The Spiderman I got was from the latest run.  It has mylar squares
> > with a spider printed on it in the flipper lane ball drops.  Maybe
> > they didn't do this in the first run.  As for the shooter lane, I
> > didn't think of that.    Mine is only 1 1/2 months old so there hasn't
> > been any wear there.  I think I'll do that as well.
>
>    The playfield already has a spider printed there....are you sure a
> spider is printed on the mylar also? Sounds strange.

Just went to check. You are right the spider is painted on the
playfield. It just so happens the square piece of mylar fits over it
perfectly that I thought it was printed on the mylar.

DugFreez

11/5/2010 2:42:00 AM

0

On Nov 4, 10:22 pm, Hawk <bcameron.h...@gmail.com> wrote:
> On Nov 4, 10:11 pm, DugFreez <dugfr...@live.com> wrote:
>
> > On Nov 4, 7:42 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
> > > The Spiderman I got was from the latest run.  It has mylar squares
> > > with a spider printed on it in the flipper lane ball drops.  Maybe
> > > they didn't do this in the first run.  As for the shooter lane, I
> > > didn't think of that.    Mine is only 1 1/2 months old so there hasn't
> > > been any wear there.  I think I'll do that as well.
>
> >    The playfield already has a spider printed there....are you sure a
> > spider is printed on the mylar also? Sounds strange.
>
> Just went to check.  You are right the spider is painted on the
> playfield.  It just so happens the square piece of mylar fits over it
> perfectly that I thought it was printed on the mylar.

OK...that makes more sense. So I guess Stern decided that area could
use a little extra protecting as well. Those squares defiantly weren't
on the earlier games.

Hawk

11/5/2010 2:43:00 AM

0

On Nov 4, 10:41 pm, DugFreez <dugfr...@live.com> wrote:
> On Nov 4, 10:22 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
>
>
> > On Nov 4, 10:11 pm, DugFreez <dugfr...@live.com> wrote:
>
> > > On Nov 4, 7:42 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
> > > > The Spiderman I got was from the latest run.  It has mylar squares
> > > > with a spider printed on it in the flipper lane ball drops.  Maybe
> > > > they didn't do this in the first run.  As for the shooter lane, I
> > > > didn't think of that.    Mine is only 1 1/2 months old so there hasn't
> > > > been any wear there.  I think I'll do that as well.
>
> > >    The playfield already has a spider printed there....are you sure a
> > > spider is printed on the mylar also? Sounds strange.
>
> > Just went to check.  You are right the spider is painted on the
> > playfield.  It just so happens the square piece of mylar fits over it
> > perfectly that I thought it was printed on the mylar.
>
>   OK...that makes more sense. So I guess Stern decided that area could
> use a little extra protecting as well. Those squares defiantly weren't
> on the earlier games.

Well after they cheaped out on the plastic apron and no sliding rails
its the least they could do.

alveolus

11/5/2010 9:23:00 PM

0

I worry about my pristine shooter lanes as well. How well does the
steath mylar stay put/hold up when placed across the shooter lane as
shown in your picture?

Shawn

On Nov 4, 6:30 pm, DugFreez <dugfr...@live.com> wrote:
> On Nov 4, 6:38 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
>
>
> > Spiderman already has all the protection from factory.  There is Mylar
> > in the bumper area and also the flipper lanes where the ball drops.
> > The only protection you need for this game is:
>
> > - plastic protectors from Pinbits
> > - cab protectors for the legs.
>
> > That is all.
>
>   My BSM had mylar around the pops but nothing near the drops into the
> return lanes. This is the first I had ever heard anyone mention that.
>
>   I put some stealth mylar under the ramp flaps. Under the ball drops
> in the return lane, and what seems to be the most important
> place....IN THE SHOOTER LANE. I can almost guarantee that everyone
> that hasn't put some protection in the shooter lane has paint missing
> or cracked.
>
>   I hadn't heard a anyone mention this area until mine was already
> showing wear. Here is a pic of this area:
>
> http://i48.photobucket.com/albums/f231/dugfreez/Public/DS...
>
>   Protect yourself...word.

Hawk

11/5/2010 11:38:00 PM

0

On Nov 5, 5:23 pm, alveolus <suz.sh...@yahoo.com> wrote:
> I worry about my pristine shooter lanes as well. How well does the
> steath mylar stay put/hold up when placed across the shooter lane as
> shown in your picture?
>
> Shawn
>
> On Nov 4, 6:30 pm, DugFreez <dugfr...@live.com> wrote:
>
> > On Nov 4, 6:38 pm, Hawk <bcameron.h...@gmail.com> wrote:
>
> > > Spiderman already has all the protection from factory.  There is Mylar
> > > in the bumper area and also the flipper lanes where the ball drops.
> > > The only protection you need for this game is:
>
> > > - plastic protectors from Pinbits
> > > - cab protectors for the legs.
>
> > > That is all.
>
> >   My BSM had mylar around the pops but nothing near the drops into the
> > return lanes. This is the first I had ever heard anyone mention that.
>
> >   I put some stealth mylar under the ramp flaps. Under the ball drops
> > in the return lane, and what seems to be the most important
> > place....IN THE SHOOTER LANE. I can almost guarantee that everyone
> > that hasn't put some protection in the shooter lane has paint missing
> > or cracked.
>
> >   I hadn't heard a anyone mention this area until mine was already
> > showing wear. Here is a pic of this area:
>
> >http://i48.photobucket.com/albums/f231/dugfreez/Public/DS...
>
> >   Protect yourself...word.

If you are getting the stealth protectors from PinballPal then its not
mylar. Its vinyl. Also it is peel up removable without ruining the
playfield. Its not as strong as mylar so after a couple years you may
have to replace. But thats not a problem and actually a good thing
that its easy to take off. Also if you put it on the playfield and
for some reason you put it down wrong just peel it up and lpace it
again. It will hold up well across the shooter lane like his
picture. Mylar and the stealth vinyl are very thin and can take a lot
of abuse. In the future I think I will just by his sheets of this
stuff and use that instead of mylar.

DugFreez

11/6/2010 5:41:00 AM

0

On Nov 5, 5:23 pm, alveolus <suz.sh...@yahoo.com> wrote:
> I worry about my pristine shooter lanes as well. How well does the
> steath mylar stay put/hold up when placed across the shooter lane as
> shown in your picture?
>
> Shawn
>

I haven't had any problem with it not staying put. I think I did
first try to use a pre-cut square in that location and it wasn't wide
enough. I also had a whole sheet of the stealth mylar so I just cut a
piece a little wider so it had room to fit along the bottom of the
lane and also have enough room on each end of the shooter lane to
stick, so it didn't raise up on the edges..

Hugh

11/6/2010 10:30:00 AM

0

On Nov 6, 1:41 am, DugFreez <dugfr...@live.com> wrote:
> On Nov 5, 5:23 pm, alveolus <suz.sh...@yahoo.com> wrote:
>
> > I worry about my pristine shooter lanes as well. How well does the
> > steath mylar stay put/hold up when placed across the shooter lane as
> > shown in your picture?
>
> > Shawn
>
>   I haven't had any problem with it not staying put. I think I did
> first try to use a pre-cut square in that location and it wasn't wide
> enough. I also had a whole sheet of the stealth mylar so I just cut a
> piece a little wider so it had room to fit along the bottom of the
> lane and also have enough room on each end of the shooter lane to
> stick, so it didn't raise up on the edges..

Here is a picture of the rollover wear:

http://gallery.metahugh.com/main.php?g2_it...

If you plunge the ball hard it hits that rollover, at least on my
game. I plan on replacing my playfield with a clearcoated one in the
future so I'm not too worried about it but if I bought a NIB game I
would definitely put something down. I wish I could have bought one
NIB.

As far as the FGY wear goes when the game first came out I remember
plenty of people talking about hole wear. Guess it wasn't such a big
deal :)

Hugh