Can I do this with Ruby and sqlite alone?

Hi guys.

I just want to know if using Ruby and sqlite can make something like the
attached file.

I know it looks like an old program from the 1980’s, but I just want to
know if I can do that with Ruby and sqlite alone. I think I already
know the basics of sqlite and Ruby, but haven’t attempted to make a
working program like that yet. It has to have a sort of pull-down
feature so I can select customers, products, etc.

Is this possible with Ruby alone or should I study Ruby on Rails?
Because someone suggested a ‘web application framework’ or something
like that.
I’m not familiar with that.

Thanks you!

There are ruby bindings to the ncurses library, which is usually used
for
the stuff like that (e.g. pseudographic interfaces). Check this link to
see
what I am talking about - GitHub - eclubb/ncurses-ruby: A Ruby module for accessing the ncurses library

Hi,

Yes, you can do that very well with Ruby and SQLite. However, if you
have critical data or lots of data, you should consider using a full
featured database system like PostgreSQL.

The suggestion of Ruby on Rails is nonsense in may opionion. Even if you
did want to make a web application, RoR would be a total overkill for a
simple form like that. If you want to use a framework at all, then it
should be a much simpler one.

Jan E. wrote in post #1073735:

Hi,

Yes, you can do that very well with Ruby and SQLite. However, if you
have critical data or lots of data, you should consider using a full
featured database system like PostgreSQL.

Thanks guys. Hi Jan, are you sure I can do that with Ruby and SQLite?
Then how can I make the blue-colored screen, borders, pull-down menus,
etc.
The book I’m reading doesn’t delve into that stuff, so I thought Ruby
alone would not be adequate. Maybe you can suggest a book?

Thank you.

You can do (almost) anything with Ruby. It’s just a question of finding
the right library.

But I agree with Alex that programming a GUI (e. g. with Gtk) makes more
sense than fumbling with a complicated console menu. It’s more
comfortable both for you and the users.

Hi Alex,

  1. what do you mean by, "unless terminal access is a specific
    requirement you will probably find

it easier going to use one of the many gui toolkits (just Google) or a
web framework (of which there are many - again just Google)."

  1. What’s terminal access? Do you mean clicking on the Command Prompt
    icon on my desktop? I’m running windows 7.

  2. Does “Shoes” qualify as a gui toolkit and can I use it to create
    something like the attached file?

  3. How does a gui toolkit differ from a web framework like RoR?

  4. With regards to number 4, what’s easier or faster to study?

Thanks guys!!

On 29.08.2012 09:41, Kaye Ng wrote:

menus,
etc.
The book I’m reading doesn’t delve into that stuff, so I thought Ruby
alone would not be adequate. Maybe you can suggest a book?

Thank you.

To read between the lines slightly, I think you are asking the age old
question of how to make a (graphical) user interface. As suggested, if
you really want a terminal based ui the ncurses would be the way, but
unless terminal access is a specific requirement you will probably find
it easier going to use one of the many gui toolkits (just Google) or a
web framework (of which there are many - again just Google). I agree
with Jan that Rails is probably a bit heavy for what you’ve shown in the
screenshot, but really it would depend on the precise requirements of
the project (and the data model behind the ui).

On 29.08.2012 10:59, Kaye Ng wrote:

Hi Alex,

  1. what do you mean by, "unless terminal access is a specific
    requirement you will probably find

it easier going to use one of the many gui toolkits (just Google) or
a
web framework (of which there are many - again just Google)."

Hmm, not sure how to answer that question. Hopefully the other answers
make my meaning clearer.

  1. What’s terminal access? Do you mean clicking on the Command Prompt
    icon on my desktop? I’m running windows 7.

I mean viewing the ui via a text terminal
(Computer terminal - Wikipedia). I don’t use Windows,
but yes I think the Command Prompt icon takes you to a text terminal.

From your question it seems very unlikely that this would be a
requirement for you, so I would go via the gui or web routes.

  1. Does “Shoes” qualify as a gui toolkit and can I use it to create
    something like the attached file?

Never used it, but yes I believe so.

  1. How does a gui toolkit differ from a web framework like RoR?

Sorry to be terse, but:

  1. With regards to number 4, what’s easier or faster to study?

Hard to say. You will need to learn more different pieces with a web
framework (ruby + html + css + js + setting up a web server), but some
of the frameworks hold your hand quite tightly through that and there
are lots of resources online to help learning from scratch. GUI toolkits
are in my (limited) experience slightly less hand-holdy, but then you
only need to know Ruby + the toolkit. As I understand it, Shoes is
specifically designed for people with less background in this area, so
may be a fruitful line of enquiry.

  1. Does “Shoes” qualify as a gui toolkit and can I use it to create

something like the attached file?

Never used it, but yes I believe so.

“Shoes” doesn’t support drop-down menus (I believe that was the
requirement
of OP a few messages above).

On 29.08.2012 13:01, Kaye Ng wrote:

I can do all that with just these three things:

  • Knowledge of Ruby language
  • Knowledge of SQlite or other database systems
  • Knowledge of a Ruby GUI toolkit like “Shoes”

Is that about right?

Thanks guys!

Uh yes, I suppose, from a technical point of view. I would make sure
you educate yourself properly about the various options before setting
off to build a billing system (!!!) though. A few days playing with
Shoes or RoR will give you a far better impression of their capabilities
than a few forum posts can.

Thanks Alex!

Based on what you’ve told me, I think I would go for GUI toolkits, for
now at least. I believe it is sufficient for what I want to do.

I want to create a program that can access a database of customer and
supplier info, products, orders, etc. then I need to have a user
interface for taking customer orders, scheduling, crediting/debiting
customer/supplier accounts, etc.

I can do all that with just these three things:

  • Knowledge of Ruby language
  • Knowledge of SQlite or other database systems
  • Knowledge of a Ruby GUI toolkit like “FXRuby”

Is that about right?

Hi Andriy!

  • “Shoes” doesn’t support drop-down menus (I believe that was the
    requirement
    of OP a few messages above).

Then what would you recommend? Or can anyone else recommend something
that would be adequate for my needs? And please tell me if my assumption
of the 3 things cited above is enough to get me started on my project.

Thanks guys!

Kaye Ng wrote in post #1073797:

You’re referring to the many database systems and GUI toolkits to choose
from, correct? Got it!

No, he’s saying that you must know what you’re doing when you work with
critical data. You certainly don’t want to mess up your payment data
with some stupid mistake.

Do you think sqlite is adequate for my project? If not, what would you
recommend?

It really depends on how big this is going to be. If you’re only dealing
with small data and few users, SQLite is sufficient. Otherwise I’d use
PostgreSQL. MySQL is also very popular, but I consider it as less mature
as PostgreSQL. It’s lacking many of the advanced features, and it’s
rather sloppy.

About the GUI toolkits, Andriy says Shoes does not have the pull-down
menu. Any suggestions?

GTK:
http://ruby-gnome2.sourceforge.jp/hiki.cgi

Thanks Jan! How’s GTK support for windows?

I’m running Windows 7. I read in this link:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Install+Guide+for+Windows

“The entire Ruby-GNOME2 package isn’t supported on Windows yet, and may
never be, as it requires GNOME 2.
The versions of Windows are categorized in Win9X/ME and
WinNT/2000/XP/2003.”

No windows 7? Should I be concerned with this?

Thanks!

Uh yes, I suppose, from a technical point of view. I would make sure
you educate yourself properly about the various options before setting
off to build a billing system (!!!) though.

You’re referring to the many database systems and GUI toolkits to choose
from, correct? Got it!

Do you think sqlite is adequate for my project? If not, what would you
recommend?

About the GUI toolkits, Andriy says Shoes does not have the pull-down
menu. Any suggestions?

Thank you!

Hi,

In [email protected]
“Re: Can I do this with Ruby and sqlite alone?” on Thu, 30 Aug 2012
19:28:33 +0900,
Kaye Ng [email protected] wrote:

No windows 7? Should I be concerned with this?
Oh. The documentation is too old.

You can install Ruby-GNOME2 by gem:

gem install gtk2

The gem has all required binaries.

Ruby-GNOME2 1.1.5 had been released yesterday. :slight_smile:

Thanks,

Kaye Ng wrote in post #1073899:

No windows 7? Should I be concerned with this?

I’m using GTK on Windows 7 all the time, and I never came across any
missing feature. It works excellent.

A general suggestion: Just try things out. Don’t wait for others to tell
you what to use, just download some of the suggested libraries and see
for yourself if you like them.

You cannot always say “this one is the best”, especially not with GUI
libraries. I guess GTK, Qt and maybe FXRuby all do pretty much the same.
So it’s up to you to choose the one you like best (or to check which one
does what you want).