[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: installing fruit

Greg P

2/2/2008 7:32:00 PM


"Andrew Chen" <hangfei@gmail.com> wrote in message
news:ed673133-cf5b-4582-b220-2b757bfd7133@i3g2000hsf.googlegroups.com...
> Gerry,
>
> Yes, you have ruby, rubygem, and rake.
>
> Please try to do this:
> cd fruit\fruit_processor_gem\pkg
> gem install fruit_processor_*.gem (or your specific file gem
> filename)
>
>
> I understand the need to use the library on Windows. I don't have a
> Windows box to test the Windows installation yet.
> Base ruby and rake should run on Windows as well.
>
> Here are what I did:
>
> 1. I added misc.rb in the fruit_processor gem.
> There is one method is_windows? to test is the OS is Windows or not.
>
> 2. I modified rake_base.rb, as one example, for platform specific
> commands, you can use this as example.
>
> rake_base.rb:
> task :deploy => $goal do
> if is_windows?
> install("#{Dir.pwd}/#{$goal}", "#{$build_dir}/#{$goal}")
> else
> ln_sf("#{Dir.pwd}/#{$goal}", "#{$build_dir}/#{$goal}")
> end
> end
I intend to crosspost this to c.l.ruby from c.l.f. and set the followup to
the c.l.ruby.

I've been working up a fruit installion, which is a test suite written in
ruby for fortran. I appear to be crash test dummy for a windows
installation and have a variety of questions which range in subtlety. I'll
just begin shotgun-style.

1) What does the above, quoted script do?

# The Greeter class
class Greeter
def initialize(name)
@name = name.capitalize
end

def salute
puts "Hello #{@name}!"
end
end

# Create a new object
g = Greeter.new("world")

# Output "Hello World!"
g.salute

#excerpted from _Programming Ruby_, Matsumoto, 2000.

2) Is the hash sign the only way to remark in ruby?

3) What is the roll of the hash in puts "Hello #{@name}!" ?
--
Gerry Ford

"The apple was really a peach."
-- Allison Dunn on the garden of eden


2 Answers

Andrew Chen

2/3/2008 9:56:00 PM

0

Gerry,

> 3) What is the roll of the hash in puts "Hello #{@name}!" ?

"aaa" : aaa means a string
"#{bbb}" : bbb means a variable. #{} is needed because bbb is referred
from within a string.
@ccc : @ccc is a class variable. @ means its scope. If you just want
the scope of the variable ddd within the current scope, it can just be
named as ddd, not @ddd.

In this line:
puts "Hello #{@name}!"
the variable name is not a hash, it is just one string variable.


It's nice to know ruby to use Fruit, but the core of Fruit is pure
FORTRAN. Ruby part is just post-processor to generate FORTRAN codes,
and specification document.

~Andrew Chen

%

6/6/2013 11:40:00 PM

0

The Peeler wrote:
> On Thu, 6 Jun 2013 16:12:51 -0700, "%" <persent@gmail.com> wrote:
>
>> The Peeler wrote:
>>> On Thu, 6 Jun 2013 16:04:03 -0700, "%" <persent@gmail.com> wrote:
>>>
>>>> The Peeler wrote:
>>>>> On Thu, 6 Jun 2013 15:19:58 -0700, "%" <persent@gmail.com> wrote:
>>>>>
>>>>>> The Peeler wrote:
>>>>>>> On Thu, 6 Jun 2013 14:55:52 -0700, "%" <persent@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> The Peeler wrote:
>>>>>>>>> On Thu, 6 Jun 2013 13:32:33 -0700, "%" <persent@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> The Peeler wrote:
>>>>>>>>>>> On Thu, 6 Jun 2013 12:33:09 -0700, "%" <persent@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> The Peeler wrote:
>>>>>>>>>>>>> On Thu, 6 Jun 2013 11:36:02 -0700, "%" <persent@gmail.com>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> The Peeler wrote:
>>>>>>>>>>>>>>> On Thu, 06 Jun 2013 11:11:39 -0700, The Rectum, the
>>>>>>>>>>>>>>> resident psychopath of sci and scj, FAKING his time zone
>>>>>>>>>>>>>>> again and IMPERSONATING his master, The Peeler, wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Repetition, shiteating Jewish invertebrate!
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> yay
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Repetition, shiteating %!
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> You don't NOTICE it when people keep having fun at your
>>>>>>>>>>>>>>> expense, right, you mentally handicapped poor idiot?
>>>>>>>>>>>>>>> LMAO!
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> notice it , HA , i don't even give a shit
>>>>>>>>>>>>>
>>>>>>>>>>>>> You, have constipations innit? <G>
>>>>>>>>>>>>
>>>>>>>>>>>> so , just open your mouth wider , yay
>>>>>>>>>>>
>>>>>>>>>>> That, won't help. The shit, comes out, of my ears innit!
>>>>>>>>>>> <G>
>>>>>>>>>>
>>>>>>>>>> hold your hands over them
>>>>>>>>>
>>>>>>>>> Then, the shit, will go all over, my hands innit! <GB>
>>>>>>>>
>>>>>>>> no it will blow out your nose but nose plugs are cheap <EG>
>>>>>>>
>>>>>>> It'll go, all over my shirt then innit! <VG>
>>>>>>
>>>>>> wear a shirt you don't like
>>>>>
>>>>> It's, the shit, I don't like innit.
>>>>
>>>> so stop letting me shit in your mouth and open your eyes
>>>
>>> If, I open my, eyes shit comes out too innit! <G>
>>
>> then go to the toilet
>
> I AM in the toilet. All the time innit!

flush