Forum: Ruby what can i do with Ruby??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
jazzy (Guest)
on 2007-02-16 06:25
(Received via mailing list)
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
Jim C. (Guest)
on 2007-02-16 06:55
(Received via mailing list)
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 Q.zes, to see how powerful Ruby can be.

HTH,
Jim
jazzy (Guest)
on 2007-02-16 07:15
(Received via mailing list)
On Feb 15, 11:54 pm, Jim C. <removed_email_address@domain.invalid> 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.
Alin P. (Guest)
on 2007-02-16 08:46
jazzy wrote:
> On Feb 15, 11:54 pm, Jim C. <removed_email_address@domain.invalid> 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.sourceforge.jp/

Best regards,

Alin
Jason M. (Guest)
on 2007-02-16 14:57
(Received via mailing list)
On 2/16/07, Alin P. <removed_email_address@domain.invalid> wrote:
> > well? thanks a lot! I'll do a search on those.
>
> Alin



+1 for gtk2
Imobach González Sosa (Guest)
on 2007-02-16 15:29
(Received via mailing list)
+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 W. (Guest)
on 2007-02-16 21:11
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)
David V. (Guest)
on 2007-02-19 16:43
(Received via mailing list)
On Fri, 16 Feb 2007 06:15:08 +0100, jazzy <removed_email_address@domain.invalid> 
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/vrproject-e.html 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 V.
This topic is locked and can not be replied to.