Forum: Ruby Feedback on Code/Script

Posted by Nuggety Nanna (lewis_r)
on 2012-12-06 03:02
Attachment: vector_calc.rb (4,82 KB)
Hey guys, I am currently creating a Vector Calculator program on Mac
OSX. I have the main scripting done, and it will run from terminal. I
plan on creating a graphical application using shoes once this is all
complete. I was wondering if a few of you would be able to test my
script and give me some feedback. It seems seems to run smoothly in
terminal but I would like to get some feedback before I continue on
creating the graphical side. Any help or feedback will be greatly
appreciated. Also if anyone has any opinions on a better toolkit to use
to create a graphical application with ruby please share.

Thanks.
Posted by Joel Pearson (virtuoso)
on 2012-12-06 09:53
I tried Shoes but ended up using Tk, it seemed more suitable for my 
purposes. The best thing to do is play with a few UI generators and get 
a feel for how they work and which interface works best for you.
Posted by Joel Pearson (virtuoso)
on 2012-12-06 10:09
It seems to work ok.

What are you trying to accomplish with this line?
else answer == "n"
All it does is return true, but you don't use the output.

Also you can can accomplish this kind of thing:

puts
puts "Vector A = #{vect_A}"
puts


Like this:

puts "\nVector A = #{vect_A}\n"
Posted by Nuggety Nanna (lewis_r)
on 2012-12-06 12:10
Joel Pearson wrote in post #1088040:
> It seems to work ok.
>
> What are you trying to accomplish with this line?
> else answer == "n"
> All it does is return true, but you don't use the output.
>
> Also you can can accomplish this kind of thing:
>
> puts
> puts "Vector A = #{vect_A}"
> puts
>
>
> Like this:
>
> puts "\nVector A = #{vect_A}\n"

Thanks for that. The purpose of the
> else answer == "n"
is for the code to skip that section, n if for no. Just though I'd 
clarify incase you didn't try skipping.

Again, thanks heaps for this, really appreciate it.
Posted by Kaspar Schiess (kaspar)
on 2012-12-10 07:43
(Received via mailing list)
> appreciated. Also if anyone has any opinions on a better toolkit to use
> to create a graphical application with ruby please share.

On OSX? By all means go native with MacRuby.

k
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.