Ruby_rhymes question

I am interested in using ruby_rhymes, but have no idea how to use it. I
installed the gem, but I was unable to find any examples.

Could a kind soul show me how it works? Maybe a working example? I’m a
bit new, so please excuse the ignorance. :slight_smile:

http://rubydoc.info/gems/ruby_rhymes

On Jul 1, 2012, at 14:40 , Amiee M. wrote:

I am interested in using ruby_rhymes, but have no idea how to use it. I
installed the gem, but I was unable to find any examples.

Could a kind soul show me how it works? Maybe a working example? I’m a
bit new, so please excuse the ignorance. :slight_smile:

File: README — Documentation for ruby_rhymes (0.1.2)

The url you reference has many working examples.

Yes, however, I am just learning about ruby and working with the basic
of basics, these examples, I have no idea how to turn into a working
ruby program. :frowning:

On Mon, Jul 02, 2012 at 09:51:26AM +0900, Amiee M. wrote:

Yes, however, I am just learning about ruby and working with the basic
of basics, these examples, I have no idea how to turn into a working
ruby program. :frowning:

Are you on MS Windows or something Unix-like?

What have you tried? You might want to start with a text file that
includes the gem, copy and paste the examples in and see what happens
when you run 'em.

Chad P. wrote in post #1067051:

On Mon, Jul 02, 2012 at 09:51:26AM +0900, Amiee M. wrote:

Yes, however, I am just learning about ruby and working with the basic
of basics, these examples, I have no idea how to turn into a working
ruby program. :frowning:

Are you on MS Windows or something Unix-like?

Ubuntu Linux.

Hi,

Amiee M. wrote in post #1067062:

Well, I’ve only tried writing some basic ruby code, not using any of the
gem packages (still learning how to use them). I’ll read up some more,
thanks.

Maybe you should start with a more popular and better documented gem to
learn the basics. The problem is that nobody know this rhyme gem, so it
will be difficult to find help for particular questions and problems (as
you could see).

For example, what about the gtk2 gem for building GUIs? It has an
extensive documentation including a tutorial for beginners:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk
And this is actually useful if you’re planning to write real
applications in the future.

http://www.ruby-forum.com/topic/180666

Jam wrote in post #1066966:

What have you tried? You might want to start with a text file that
includes the gem, copy and paste the examples in and see what happens
when you run 'em.

Well, I’ve only tried writing some basic ruby code, not using any of the
gem packages (still learning how to use them). I’ll read up some more,
thanks.

On Tue, Jul 3, 2012 at 12:54 AM, Amiee M. [email protected]
wrote:

Well, I’ve only tried writing some basic ruby code, not using any of the
gem packages (still learning how to use them). I’ll read up some more,

try eg,

[2] pry(main)> require ‘ruby_rhymes’
=> true
[3] pry(main)> “ruby”.flat_rhymes
NoMethodError: undefined method flat_rhymes' for "ruby":String from (pry):3:in
[4] pry(main)> “ruby”.to_phrase.flat_rhymes
=> [“booby”,
“dubhi”,
“duby”,
“hruby”,
“kuby”,
“looby”,
“luby”,
“newby”,
“rubey”,
“rubi”,
“rubie”,
“trubey”,
“truby”]
[5] pry(main)> .lsb_release -a
LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description: Ubuntu 10.04.4 LTS
Release: 10.04
Codename: lucid
[6] pry(main)> .ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

kind regards -botp

On Tue, Jul 03, 2012 at 01:52:53AM +0900, Amiee M. wrote:

Chad P. wrote in post #1067051:

On Mon, Jul 02, 2012 at 09:51:26AM +0900, Amiee M. wrote:

Yes, however, I am just learning about ruby and working with the basic
of basics, these examples, I have no idea how to turn into a working
ruby program. :frowning:

Are you on MS Windows or something Unix-like?

Ubuntu Linux.

Do you know about using “require” to use a library?

Do you know about shebang lines to ensure the correct interpreter runs
your program? I recommend this for Ruby:

#!/usr/bin/env ruby

Do you know about changing file permissions to make a program
executable?
Something like this should work for you:

chmod 700 filename

(where “filename” is the name of your Ruby program file)

Do you know about execution paths? I think Ubuntu automatically adds
“~/bin” to your path (not sure; I’m not an Ubuntu user), so you could
put
your program there to be able to run it from pretty much anywhere
without
having to specify the path to it when executing the program.

If you have all that handled, I guess you might specifically be asking
for more about the library’s API, in which case you could try contacting
the person who wrote the library directly to ask for help.