[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

what can i do with Ruby??

jazzy

2/16/2007 4:24:00 AM

I have a visual basic 6 program I made which stores databases and
allows the user to input data and get calculations from day to day. It
uses dao. There a many different windows that come up to input various
preferences and data calculations.

Can I build such a program with Ruby or is Ruby more for dos based
systems or for only web development?

I guess I just really don't understand what all Ruby is for.

Thanks in advance to any response.

jazzyOne

6 Answers

Jim Clark

2/16/2007 4:55:00 AM

0

jazzy wrote:
> I have a visual basic 6 program I made which stores databases and
> allows the user to input data and get calculations from day to day. It
> uses dao. There a many different windows that come up to input various
> preferences and data calculations.
>
> Can I build such a program with Ruby or is Ruby more for dos based
> systems or for only web development?
>
Yes you can build such a system. In the same way that Visual Basic is
used in many different settings (stand alone programs, VB Script, web
site back ends, etc.), Ruby can do these same things. There are GUI
toolkits for Ruby (Tk, Fox / FXRuby, wxRuby, GTK, and Qt to name a few)
for stand alone development, database drivers to connect with whatever
database you prefer, frameworks like Rails for web development, and a
large variety of well tested libraries / gems that can be used to speed
development on all kinds of projects. In addition, since everything is
an object in Ruby, you can do some really interesting things that would
take much more effort in VB.
> I guess I just really don't understand what all Ruby is for.
>
Take a look in the archives for this list, and specifically at some of
the Ruby Quizzes, to see how powerful Ruby can be.

HTH,
Jim

jazzy

2/16/2007 5:12:00 AM

0

On Feb 15, 11:54 pm, Jim Clark <diegosl...@gmail.com> wrote:
> jazzy wrote:
> > I have a visual basic 6 program I made which stores databases and
> > allows the user to input data and get calculations from day to day. It
> > uses dao. There a many different windows that come up to input various
> > preferences and data calculations.
>
> > Can I build such a program with Ruby or is Ruby more for dos based
> > systems or for only web development?
>
> Yes you can build such a system. In the same way that Visual Basic is
> used in many different settings (stand alone programs, VB Script, web
> site back ends, etc.), Ruby can do these same things. There are GUI
> toolkits for Ruby (Tk, Fox / FXRuby, wxRuby, GTK, and Qt to name a few)
> for stand alone development,

So I need to choose and get one of these GUI toolkits? Which would be
best for this sort of windows type prgrams? Are they free downloads as
well? thanks a lot! I'll do a search on those.


> Jim


Alin Popa

2/16/2007 6:47:00 AM

0

jazzy wrote:
> On Feb 15, 11:54 pm, Jim Clark <diegosl...@gmail.com> wrote:
>> used in many different settings (stand alone programs, VB Script, web
>> site back ends, etc.), Ruby can do these same things. There are GUI
>> toolkits for Ruby (Tk, Fox / FXRuby, wxRuby, GTK, and Qt to name a few)
>> for stand alone development,
>
> So I need to choose and get one of these GUI toolkits? Which would be
> best for this sort of windows type prgrams? Are they free downloads as
> well? thanks a lot! I'll do a search on those.

Hi Jazzy,

I like very much and seems to be very easy to use, Gtk2.
It's free (of course) and it looks very nice on linux.

You'll need to take a look at ruby-gnome2 project:
http://ruby-gnome2.sourc...

Best regards,

Alin

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

Imobach González Sosa

2/16/2007 1:29:00 PM

0

+1 for Qt if you're running Linux/*BSD. I think that the win32 port
isn't finished yet.
You can get the Ruby binding, QtRuby, in the Korundum's project
page[1]. Korundum are the Ruby-KDE bindings.

See ya!

Todd Werth

2/16/2007 7:12:00 PM

0

I'll assume from your post that your are interested in GUI desktop apps
in Windows, specifically connected to a database file or database
server.

Generally speaking, Ruby is used in the same places other "scripting"
languages (perl, python, etc) are used, such as back-end web development
(Ruby on Rails, Nitro, Camping, etc), command line apps (which are more
common in unix and OS X, but still exist in Windows [1]), and back-end
processes (services in Windows, or daemons in unices).

Ruby can be used to write desktop GUI applications too, as previous
posts have mentioned, however it isn't, at this point, going to be like
writing something in VB, Java, or .net; yet.

Specifically on Windows, when writing a desktop GUI app, the most common
ways are to: write directly to Windows using the Win32 API, use a
framework such as .net's WinForms (VB in the old days), or use a cross
platform framework such as Swing in Java, or QT, gtk, etc.

As is true with all languages, not only Ruby, if you want to create an
application that just runs on Windows without installing a framework,
you work directly with the Win32 API, which is very common in c and c++.
I'm not familiar with it, but there is a Win32api module in Ruby.

As for the .net and java environments, there are projects currently
being developed to get Ruby to run in those. This would be typically
the best approach, unless you are currently writing your own message
loops in c. The projects are JRuby, and Ruby.net (there are others as
well).

You mentioned DAO (wow, that is old), which you are using probably to
connect to an Access or SQL Server database. In this regard, Ruby is
great, and has many tools for accessing a database, wether just a file
or a server. If you're familiar with DAO, ADO, or ADO.net, you'll feel
right at home in Ruby. Start your study by looking into DBI. Other
interesting areas to research are ActiveRecord, Og, and directly
connecting to a DB such as the mysql gem.

Happy coding,
Todd



[1] Windows users who aren't familiar with the command line often think
that the Command Line in Windows is DOS. Actually, the command line
(cmd.exe) is simply a way to work with the operating system, and run
applications without a graphical user interface. If you run an app in
the command line, it is still running in Windows, it just doesn't have a
GUI. DOS is an entirely different OS (which you can still run inside
Windows by using Command.com, but there is rarely a need to)

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

David Vallner

2/19/2007 2:44:00 PM

0

On Fri, 16 Feb 2007 06:15:08 +0100, jazzy <jazzy1One@gmail.com> wrote:
> So I need to choose and get one of these GUI toolkits? Which would be
> best for this sort of windows type prgrams? Are they free downloads as
> well? thanks a lot! I'll do a search on those.
>

If you're used to VB6,
http://www.threeweb.ad.jp/~nyasu/vruby/vrproj... should have a
similar -ish API. I admit to never having extensively used it, and it's a
little on the unmaintained side, but it's mostly a wrapper around

GTK, Qt, and FOX aren't nearly as easy to use for the sort of dirty hacks
(or dirty hacky coding) as VB6. (Whether this is a Good Thing is left as a
flamewar^H^H^H^H^H^H^Hexercise to the readers.) Though Qt, at least in the
PyQt incarnation comes pretty close in certain aspects by having strong
integration with a standard GUI editor, and some superficial cognates
(like naming conventions for event handlers. (I might or might not be
biased about my pet toolkit. Now if only the file opener dialog buttons
Looked Right on XP.)

David Vallner