[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Simple Questions on Ruby

Dreamn 11

8/17/2006 3:41:00 PM

I am Win32 Programmer looking for answers on Ruby

1. How do you invoke a .rb file from the irb shell?
2. If i wish you deploy my ruby code into Production server...whats the
RunTime I have to install 1st?
3. If I write Ruby CGI Apps...How do I make it work on IIS 6.0?
4. Is there a Ruby IDE?

TIA

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

10 Answers

Jano Svitok

8/17/2006 4:05:00 PM

0

On 8/17/06, Dreamn 11 <dreamn11@comcast.net> wrote:
> I am Win32 Programmer looking for answers on Ruby
>
> 1. How do you invoke a .rb file from the irb shell?
> 2. If i wish you deploy my ruby code into Production server...whats the
> RunTime I have to install 1st?
> 3. If I write Ruby CGI Apps...How do I make it work on IIS 6.0?
> 4. Is there a Ruby IDE?
>
> TIA

1. require 'whatever.rb' -or- load 'whatever.rb'
2. runtime is basicly the ruby distribution - the interpreter and the
libs. on windows it probably means the one-click installer
(http://rubyforge.org/projects/rub...)
3. don't know IIS, but I'd that by having IIS run them ;-) Or, using
intermediate ruby webserver(s) like mongrel or webrick. Or, if it is
possible, but using FCGI/FastCGI/SCGI (plain old CGI is too slow most
of the time).

Simen

8/17/2006 4:11:00 PM

0

On 8/17/06, Dreamn 11 <dreamn11@comcast.net> wrote:
> I am Win32 Programmer looking for answers on Ruby
>
> 1. How do you invoke a .rb file from the irb shell?

If you want to include it once (a library, perhaps), use require, as in

require 'somefile' # will try to load somefile.rb or a .dll, .so, .o and so on

Or if you want to run a file as many times you wish, use load:

load 'somefile'

> 2. If i wish you deploy my ruby code into Production server...whats the
> RunTime I have to install 1st?

Whats server? There's mod_ruby for Apache.

> 3. If I write Ruby CGI Apps...How do I make it work on IIS 6.0?

If you're using Rails, see http://wiki.rubyonrails.org/rails/pages/How...

> 4. Is there a Ruby IDE?
>
> TIA
>
> --
> Posted via http://www.ruby-....
>
>


--
- Simen

Tim Hoolihan

8/17/2006 6:50:00 PM

0

> 3. If I write Ruby CGI Apps...How do I make it work on IIS 6.0?
> 4. Is there a Ruby IDE?

I'm only addressing #3,#4 because the the others have been well answered.


Here is a blog posting on how to use ruby in classic asp pages. I
suggest it because if you're a win32 programmer, it's the easiest way to
get your foot in the door with ruby, before trying rhtml or rails.
Here's the link:
http://mogrify.homelinux.org/2006/06/02/using-ruby-in-...

As for an ide, a *free* alternative is:
http://freeride.rubyforge.org/wi...

punkracy

8/17/2006 7:46:00 PM

0

Dreamn 11 napisal(a):
> 4. Is there a Ruby IDE?
http://www.easye... - EasyEclipse for Ruby On Rails
http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_... - Arachno
Ruby
http://www.ra... - RadRails (there's no 64bit version)
http://freeride.rub... - FreeRIDE
http://scintilla.org/... - SciTE
+http://caladbolg.net... - snippets for SciTE
http://vim-ruby.rub... - vim + ruby
http://rub... - jedit +ruby
+http://ifakedit.com/log/2006/02/19/jedit-tutorial-a-how-to-on-abbreviations-superabbrevs-in-html-ruby-on-rails...
- additional stuff for jedit
http://www.mondri... - Mondrian Ruby IDE
http://www.activestate.com/Produ... - Komodo
http://homepage2.nifty.com/sakazuki/rde_en/... - RDE
http://rubyforge.org/projects/em... Emacs + rails
http://macr... - TextMate (mac osx)

regards

--
Krzysztof Raczkiewicz
punkracy malpa gmail kropa com
"Use the Fox, Luke!" www.firefox.pl

Huw Collingbourne

8/17/2006 8:12:00 PM

0

Um - you forgot www.sapphiresteel.com - Ruby In Steel ;-)

Huw Collingbourne

http://www.sapphir...
Ruby Programming In Visual Studio 2005

<punkracy@gmail.com> wrote in message
news:1155843952.554442.78640@i42g2000cwa.googlegroups.com...
> Dreamn 11 napisal(a):
>> 4. Is there a Ruby IDE?
> http://www.easye... - EasyEclipse for Ruby On Rails
> http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_... - Arachno
> Ruby
> http://www.ra... - RadRails (there's no 64bit version)
> http://freeride.rub... - FreeRIDE
> http://scintilla.org/... - SciTE
> +http://caladbolg.net... - snippets for SciTE
> http://vim-ruby.rub... - vim + ruby
> http://rub... - jedit +ruby
> +http://ifakedit.com/log/2006/02/19/jedit-tutorial-a-how-to-on-abbreviations-superabbrevs-in-html-ruby-on-rails...
> - additional stuff for jedit
> http://www.mondri... - Mondrian Ruby IDE
> http://www.activestate.com/Produ... - Komodo
> http://homepage2.nifty.com/sakazuki/rde_en/... - RDE
> http://rubyforge.org/projects/em... Emacs + rails
> http://macr... - TextMate (mac osx)
>
> regards
>
> --
> Krzysztof Raczkiewicz
> punkracy malpa gmail kropa com
> "Use the Fox, Luke!" www.firefox.pl
>


Ryan Eibling

8/17/2006 9:30:00 PM

0

If you'd like a personal recommendation to narrow down this list, I like
RadRails better than any other Ruby IDE I've tried. The ones I've tried
are Komodo, Eclipse + RDT, FreeRIDE, SciTE and Arachno Ruby.

punkracy@gmail.com wrote:
> Dreamn 11 napisal(a):
>> 4. Is there a Ruby IDE?
> http://www.easye... - EasyEclipse for Ruby On Rails
> http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_... - Arachno
> Ruby
> http://www.ra... - RadRails (there's no 64bit version)
> http://freeride.rub... - FreeRIDE
> http://scintilla.org/... - SciTE
> +http://caladbolg.net... - snippets for SciTE
> http://vim-ruby.rub... - vim + ruby
> http://rub... - jedit +ruby
> +http://ifakedit.com/log/2006/02/19/jedit-tutorial-a-how-to-on-abbreviations-superabbrevs-in-html-ruby-on-rails...
> - additional stuff for jedit
> http://www.mondri... - Mondrian Ruby IDE
> http://www.activestate.com/Produ... - Komodo
> http://homepage2.nifty.com/sakazuki/rde_en/... - RDE
> http://rubyforge.org/projects/em... Emacs + rails
> http://macr... - TextMate (mac osx)
>
> regards
>
> --
> Krzysztof Raczkiewicz
> punkracy malpa gmail kropa com
> "Use the Fox, Luke!" www.firefox.pl
>

Logan Capaldo

9/5/2006 2:16:00 PM

0


On Sep 5, 2006, at 10:02 AM, Gustav - Railist wrote:

> Hey!
>
> Can anybody tell me if there's a way to find what the domain of a
> url is ?
> I was thinking somehow using Net::HTTP?
>
> e.g.
>
> del.icio.us => icio.us
> -or-
> mrboulder.blogspot.com => blogspot.com
>
> Thanks!
>
> Gustav
>

require 'uri'
uri = URI.parse( 'http://del.ic... )
puts uri.host

Unfortunately you can't get more fine grained than that without
asking DNS. Why? Because ruby can't know all the top-level domains.

Jano Svitok

9/5/2006 2:17:00 PM

0

On 9/5/06, Gustav - Railist <gustav@rails.co.za> wrote:
> Hey!
>
> Can anybody tell me if there's a way to find what the domain of a url is ?
> I was thinking somehow using Net::HTTP?
>
> e.g.
>
> del.icio.us => icio.us
> -or-
> mrboulder.blogspot.com => blogspot.com
>
> Thanks!
>
> Gustav

Look at URI it it does something for you. Anyway, the question is more
complicated than it seems (take 4 level domains for example).
Basically url.split('.')[1..-1] could make it.

Logan Capaldo

9/5/2006 2:23:00 PM

0


On Sep 5, 2006, at 10:16 AM, Jan Svitok wrote:

>
>
> Look at URI it it does something for you. Anyway, the question is more
> complicated than it seems (take 4 level domains for example).
> Basically url.split('.')[1..-1] could make it.
>

Well, no it couldn't ;)

amazon.co.uk for instance.

Gustav - Railist

9/5/2006 2:35:00 PM

0

Logan Capaldo wrote:
>
> On Sep 5, 2006, at 10:02 AM, Gustav - Railist wrote:
>
>> Hey!
>>
>> Can anybody tell me if there's a way to find what the domain of a url
>> is ?
>> I was thinking somehow using Net::HTTP?
>>
>> e.g.
>>
>> del.icio.us => icio.us
>> -or-
>> mrboulder.blogspot.com => blogspot.com
>>
>> Thanks!
>>
>> Gustav
>>
>
> require 'uri'
> uri = URI.parse( 'http://del.ic... )
> puts uri.host
>
> Unfortunately you can't get more fine grained than that without asking
> DNS. Why? Because ruby can't know all the top-level domains.
>
Makes perfect sense,
does anyone know how to ask DNS for a url then?

Thanks
G

>
>
> --No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.7/437 - Release Date: 9/4/2006
>
>