Programming Tutorials

ruby Tutorials

11. FTP using Ruby

By: Jeya : 2009-03-03

Description: This class implements the File Transfer Protocol. If you have used a command-line FTP program, and are familiar with the commands, you will be able to use this class easily. Some extra features are included to take advantage of Ruby's style and strengths.


12. Reading URL content using Ruby (HTTP)

By: Emiley J. : 2009-03-03

Description: These examples are ruby sample code to access any http web page and read its contents


13. POST a form in Ruby

By: Emiley J. : 2009-03-03

Description: This sample code is used to post a form data to an URL.


14. unescapeHTML() in Ruby

By: Jeeva : 2009-03-03

Description: Unescape a string that has been HTML-escaped


15. IMAP in Ruby

By: James Edward Gray II : 2009-03-03

Description: An IMAP client connects to a server, and then authenticates itself using either authenticate() or login(). Having authenticated itself, there is a range of commands available to it. Most work with mailboxes, which may be arranged in an hierarchical namespace, and each of which contains zero or more messages. How this is implemented on the server is implementation-dependent; on a UNIX server, it will frequently be implemented as a files in mailbox format within a hierarchy of directories.


16. Reading emails using POP3 in Ruby

By: James Edward Gray II : 2009-03-03

Description: Messages are written to files named ‘inbox/1', ‘inbox/2', .… Replace ‘pop.example.com' with your POP3 server address, and ‘YourAccount' and ‘YourPassword' with the appropriate account details.


17. Sending emails using SMTP in Ruby

By: James Edward Gray II : 2009-03-03

Description: You must open a connection to an SMTP server before sending messages. The first argument is the address of your SMTP server, and the second argument is the port number. Using SMTP.start with a block is the simplest way to do this. This way, the SMTP connection is closed automatically after the block is executed.


18. Using Observer in Ruby

By: Hunt and Thomas : 2009-03-03

Description: The Observer pattern, also known as Publish/Subscribe, provides a simple mechanism for one object to inform a set of interested third-party objects when its state changes.


19. Using GServer in Ruby

By: James Edward Gray II : 2009-03-03

Description: GServer implements a generic server, featuring thread pool management, simple logging, and multi-server management. See xmlrpc/httpserver.rb in the Ruby standard library for an example of GServer in action.


20. Using Generator in Ruby

By: James Edward Gray II : 2009-03-03

Description: Generator converts an internal iterator (i.e. an Enumerable object) to an external iterator. Note that it is not very fast since it is implemented using continuations, which are currently slow.