•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Ruby section within the Web Development category of DaniWeb, a massive community of 332,665 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,293 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Ruby advertiser: SELL YOUR PRODUCT TODAY !
•
•
•
•
•
•
•
•
I needed a way to spawn multiple threads, have them monitored, and restarted if an error occured. I came up with the following.
This snippet is from a larger program, so if there is a problem please let me know. This is for command line and tested on Linux (well, the larger program). (View Snippet)
IP2Location is a Ruby library that enables the user to find the country, region, city, coordinates, zip code, ISP and domain name that any IP address or hostname originates from. It has been optimized for speed and memory utilization. Developers can use the API to query all IP2Location™ binary... (View Snippet)
This is a simple, but complete (pseudo) random password generator.
Examples of usage:
$ ruby pgen.rb
soovmuvytv
$ ruby pgen.rb --length=20
bynnugipyeeghdbihcdn
$ ruby pgen.rb --length=20 -n (View Snippet)
Using an SDL (Simple DirectMedia Layer) wrapper is one way to play sound and music with Ruby. I have tested this snippet with .MID .MOD and .WAV files and it performs well. There are several SDL wrappers for Ruby available, I picked RUDL because of its simplicity. RUDL is great for writing games. (View Snippet)
Okay, this introduces two new things into the widget. The first thing you need is a picture file (.jpg, .png, .bmp etc...). The new code makes the picture into the button with the text "Hello, World" on the side. In the parentheses next to File.open you would put the file name with its appropriate... (View Snippet)
This is kind of an extension to my previous code snippet. This language is really fun to use. I find it pretty easy to use and understand. This will create a window with a button. (View Snippet)
This is a basic window coded in Ruby. To download Ruby go to www.ruby-lang.org and download the latest version. The latest version includes the FX toolkit that is needed to create this window. (View Snippet)