[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Redefining core classes

Damaris Fuentes

7/8/2006 7:10:00 PM

Hi again,

> It is changed until you unchange it, or the interpreter stops -- not
> forever. But yes changing core classes is "dangerous." But so are most
> things worth doing or having. To quote another movie:

I'm quite new to Ruby, so... I open the Irb, I change a core class
and...then... I exit Irb... if I run Irb again...this changes are not
there, right? I'm pretty sure this question is very stupid, but I wanna
be sure I've understood this (I have not worked with interpreters
languages either before..)

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

18 Answers

Jeff Pritchard

7/9/2006 3:31:00 AM

0

What if I'm running two rails apps on the same (apache) server?
Couldn't changes to core classes made by one of these apps effect the
other one?

Or does each instance of "ruby someAppOrOther.rb" start up a new
interpreter in memory?

thanks,
jp




Daniel Baird wrote:
> On 7/9/06, Damaris Fuentes <dfl_maradentro@yahoo.es> wrote:
>>
>>
>> I'm quite new to Ruby, so... I open the Irb, I change a core class
>> and...then... I exit Irb... if I run Irb again...this changes are not
>> there, right?
>
>
>
> That's right. When you change core classes, you're changing the state
> of
> the Ruby that exists "in memory", so to speak.
>
> ;D


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

Ezra Zygmuntowicz

7/10/2006 3:39:00 AM

0


On Jul 8, 2006, at 8:30 PM, Jeff Pritchard wrote:

> What if I'm running two rails apps on the same (apache) server?
> Couldn't changes to core classes made by one of these apps effect the
> other one?
>
> Or does each instance of "ruby someAppOrOther.rb" start up a new
> interpreter in memory?
>
> thanks,
> jp

Jeff-

Yeah each ruby foo.rb starts a new interpreter in memory and opening
classes will only affect that instance of the interpreter. Your two
rails apps won't step on each other.

-Ezra

Mat Schaffer

7/10/2006 12:30:00 PM

0

On Jul 9, 2006, at 11:38 PM, Ezra Zygmuntowicz wrote:
> On Jul 8, 2006, at 8:30 PM, Jeff Pritchard wrote:
>
>> What if I'm running two rails apps on the same (apache) server?
>> Couldn't changes to core classes made by one of these apps effect the
>> other one?
>>
>> Or does each instance of "ruby someAppOrOther.rb" start up a new
>> interpreter in memory?
>>
>> thanks,
>> jp
>
> Jeff-
>
> Yeah each ruby foo.rb starts a new interpreter in memory and
> opening classes will only affect that instance of the interpreter.
> Your two rails apps won't step on each other.
>
> -Ezra

Ezra might know more than I do on this subject, but I remember
hearing that mod_ruby needed a special version of dispatch.rb to
avoid rails apps conflicting. All the other deployment methods just
work though. In short, make sure to read the docs and you'll be fine.
-Mat


Ezra Zygmuntowicz

7/10/2006 7:02:00 PM

0


On Jul 10, 2006, at 5:30 AM, Mat Schaffer wrote:

> On Jul 9, 2006, at 11:38 PM, Ezra Zygmuntowicz wrote:
>> On Jul 8, 2006, at 8:30 PM, Jeff Pritchard wrote:
>>
>>> What if I'm running two rails apps on the same (apache) server?
>>> Couldn't changes to core classes made by one of these apps effect
>>> the
>>> other one?
>>>
>>> Or does each instance of "ruby someAppOrOther.rb" start up a new
>>> interpreter in memory?
>>>
>>> thanks,
>>> jp
>>
>> Jeff-
>>
>> Yeah each ruby foo.rb starts a new interpreter in memory and
>> opening classes will only affect that instance of the interpreter.
>> Your two rails apps won't step on each other.
>>
>> -Ezra
>
> Ezra might know more than I do on this subject, but I remember
> hearing that mod_ruby needed a special version of dispatch.rb to
> avoid rails apps conflicting. All the other deployment methods
> just work though. In short, make sure to read the docs and you'll
> be fine.
> -Mat
>
>


Yeah mod_ruby is a different story altogether. I don't knoiw anyone
who actually uses it with rails though as it is not a good option for
rails apps. IIRC it shares an interprer between apps so you can't run
more then one rails app on one apache server with mod_ruby. I seem to
remember a patched version that got around this somehow but i am not
certain. I would stay away from mod_ruby for your rails apps
completely. But mod_ruby is great if you just want to serve .rhtml
or .rb files for simple little apps.

-Ezra

blackcat

7/11/2006 3:22:00 AM

0


I know this is lame and has been asked 64 times before.
Currently, what is the best way to have access to serial ports
on a PC using Ruby ?

Regards

Gus S Calabrese
Denver, CO
720 222 1309 303 908 7716 cell
I allow everything with "spamcode2006" in the subject or text to
pass my spam filters



Tim Pease

7/11/2006 2:25:00 PM

0

This was the previous answer to your question.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-...

You might also look at the ruby-serialport project on rubyforge.

http://rubyforge.org/projects/ruby-s...

This should be installable as a gem, but I have never used it, nor do
I know if it works on Windows.

By the way, have you ever attended the Boulder/Denver Ruby User Group?
We meet once a month in Superior just up US36 from Denver. Good
times are had by all, and I always leave with a little more ruby foo
under my belt.

http://rubyforge.org/news/?gro...

That link gives the meeting times and locations. The next meeting is
Wednesday, July 19 at 6:00 PM.

Blessings,
Tim Pease


On 7/10/06, Gus S Calabrese <gsc@omegadogs.com> wrote:
>
> I know this is lame and has been asked 64 times before.
> Currently, what is the best way to have access to serial ports
> on a PC using Ruby ?
>
> Regards
>
> Gus S Calabrese
> Denver, CO
> 720 222 1309 303 908 7716 cell
> I allow everything with "spamcode2006" in the subject or text to
> pass my spam filters
>
>
>
>

Caleb Tennis

7/11/2006 2:45:00 PM

0

>> I know this is lame and has been asked 64 times before.
>> Currently, what is the best way to have access to serial ports
>> on a PC using Ruby ?

You don't mention the platform, but on Linux I just open /dev/tts/X and
read and write to it like a file. As long as you have it set up before
hand using the stty command, it works just fine.

Caleb


John Johnson

7/11/2006 9:29:00 PM

0

Gus S Calabrese wrote:
>
> I know this is lame and has been asked 64 times before.
> Currently, what is the best way to have access to serial ports
> on a PC using Ruby ?
Windows? Do you need CTS/RTS, DSR/DTR ?

Regards,
JJ


blackcat

7/12/2006 4:49:00 PM

0

Windows is fine and I do not need CTS RTS DSR DTR
AGSC

On 2006-Jul 11, at 15:28hrs PM, John Johnson wrote:

Gus S Calabrese wrote:
>
> I know this is lame and has been asked 64 times before.
> Currently, what is the best way to have access to serial ports
> on a PC using Ruby ?
Windows? Do you need CTS/RTS, DSR/DTR ?

Regards,
JJ



Gus S Calabrese
Denver, CO
720 222 1309 303 908 7716 cell
I allow everything with "spamcode2006" in the subject or text to
pass my spam filters



George Plimpton

9/19/2011 4:15:00 AM

0

On 9/18/2011 4:31 PM, Shall not be infringed wrote:
> On Sep 18, 7:21 pm, "Ed Huntress"<huntre...@optonline.net> wrote:
>> "Shall not be infringed"<hot-ham-and-che...@hotmail.com> wrote in messagenews:d02b9737-bf6a-4900-ba6b-4cfbee71c49c@b28g2000yqa.googlegroups.com...
>> On Sep 18, 4:14 pm, "Ed Huntress"<huntre...@optonline.net> wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> "RD Sandman"<rdsandman@comcast[remove].net> wrote in message
>>
>>> news:Xns9F647B82D9934hopewell@216.196.121.131...
>>
>>>> "Ed Huntress"<huntre...@optonline.net> wrote in
>>>> news:4e7636f3$0$2008$607ed4bc@cv.net:
>>
>>>>> "RD Sandman"<rdsandman@comcast[remove].net> wrote in message
>>>>> news:Xns9F6469AEBA21Chopewell@216.196.121.131...
>>>>>> Hmmmm, I noticed that you liberals did nothing to reduce it.
>>
>>>>> Only a blithering idiot would consider me a liberal.
>>
>>>> While that is possible, I can only go on what you post in here.
>>
>>> It's all a matter of perspective. I'm about dead-center. The mean position
>>> here is so far off the right-side cliff that only a few have any idea
>>> where
>>> the center really is.
>>> Perhaps we can move the prime meridian to your exact present
>>> location.
>>
>>> That will provide enough stimulus the world over resurveying and
>>> remapping everything. Maybe even Obama will get his 1967 borders.
>>
>>> But like Obama's stimulus so far, it is just useless work... Someone
>>> else will likely come along and declare themselves King of dead-center
>>> and all the work will start over again.
>>
>> When we hear you come up with some solutions instead of your endless
>> bitching, Hammy, maybe you'll be worth listening to. As it is, you create
>> one hell of a lot of static.
>>
>> --
>> Ed Huntress
>
> Why do you and the government always think the solution is for the
> government to do something?
>
> Some of us think the government has done enough already.

Government has attempted to do far, far too much. Government has become
the Nanny State. Government is doing more and more things that people
ought to do, and can do, for themselves.