Introduction | Translation Tools (Tradukiloj) | Where to get Ruby | Organisations | The Latest on Ruby | Tutorials | Documentation (including FAQ and FXRuby) | Newsgroup and mailing list | Conference | Ruby on Rails | JRuby | Other Sites | Ruby-Related Vim stuff | Heuristics for Improving Performance of Ruby Code | My software
Ruby is an Object Oriented Scripting language with Perl-like regular expressions. See http://www.ruby-lang.org/ which is the Ruby Home page. (Not to be confused with the Ruby VLSI design language.)
When searching the web, much of the information available about Ruby is in Japanese. However the Excite Japan machine translation service can give an idea of what the pages are about. This service's default mode is to translate from English to Japanese, so select the other "radio button" to translate the other way.
There is now a site providing machine translation of maling lists at http://translator.rubynow.com/. Eksistas, nun, TTT-ejo kio eldonas masxinajn tradukojn de la ret-listoj.
There is also Babelfish, which can take a url or a text fragment, as can Globalgate.
There are many translation engines listed at http://www.google.com/Top/Science/Social_Sciences/Linguistics/Translation/Tools/Translation_Engines/. (Estas multaj tradukaj masxinoj montritaj cxe http://www.google.com/Top/Science/Social_Sciences/Linguistics/Translation/Tools/Translation_Engines/. ) If you know of better translation tools I would be happy to hear about them. Se vi scias plibonajn tradukilojn, mi felicxus audi pri ilin.
The links I have here are in English, mostly.
This is covered in Section 3 of the Ruby FAQ. See the Download page at www.ruby-lang.org. The single download for Ruby under Windows has support from the google group. (The Windows distribution was originally provided by The Pragmatic Programmers.)
The CVS repository no longer exists, as ruby has used svn for a while now How to get ruby using the cvs command-line is also documented.
There are snapshots available at http://ftp.ruby-lang.org/pub/ruby/snapshots/
and
your local mirror server.
Ruby Applications can generally be found at The Ruby Toolbox now that the Ruby Application Archive has been retired. See also Rubygems.org.
There is a growing number of projects hosted at rubyforge.org
.
An increasingly popular package distribution system is Rubygems.
the actual gems can be
downloaded with something like gem install -r
gemname
, where gemname is the name of
the gem. To find out which ones exist one can do gem query -n
pattern
, where -n means the same as
--name-matches. There is more documentation at the RubyGems Manuals site.
Rubygarden vanished a while ago. Ruby Change Requests are now held at http://rcrchive.net/, and are likely to be added to fairly frequently. There is an RSS feed (see the reference to Rubric below for details about RSS) for this at http://kapheine.hypa.net/rcrchive.xml, or, if you want a smaller URL, http://tinyurl.com/2tagj. And, of course, there is the Newsgroup and Mailing list. I have an automatically generated list of frequently changing sites with timestamps, for the cases where the site issues a timestamp in the headers. Those that don't show up as being changed in 1970, "which is, of course, impossible".
The Ruby User Guide from "An Invitation to Ruby".
Learning Ruby is a tutorial by Daniel Carrera, and is avaliable for download (0.3).
There are also some slides giving an introduction to Ruby and some more from the The Pragmatic Programmers, Andy Hunt and Dave Thomas.
Mark Slagell's Ruby page has links to a tutorial in various forms.
The Ruby Cookbook is/will be a site where code examples can be found.
PLEAC-Ruby, part of the PLEAC (Programming Language Examples Alike Cookbook), has examples of Ruby code that perform the same tasks as code in the Perl Cookbook.
Ruby Code and Style has a good article on Creating DSLs with Ruby, by Jim Freeze.
Documentation is available from the home page.
Programming Ruby The Pragmatic Programmer's Guide, Second Edition (The Pickaxe II) is the most cited work in English on Ruby.
http://www.ruby-doc.org/ is
the Ruby community's documentation project. It has several search
facilities built into it. For example you can find information
about a class by using the URL
http://www.ruby-doc.org/find/ri/class
, or
http://www.ruby-doc.org/find/pickaxe/class
.
Adding /method
to the URL will give
documentation for that method.
The Standard Library documentation project is managed at http://rubyforge.org/projects/stdlib-doc/.
There is a Wiki to discuss this.
Many questions are answered in Ruby FAQ in HTML See also Ruby Documentation from the ruby site..
Things That Newcomers to Ruby Should Know covers things differently from the FAQ.
The reference at
Ruby Central is
definitely worth looking at.
See
What's new at
RubyCentral.com
.
It is by
The Pragmatic Programmers,
Dave Thomas and Andy Hunt, who have written the book
Programming Ruby,
which Matz regards as the 1.6 reference now.
It is now available online at RubyCentral
and at
ruby-doc.org,
and for download.
My
intranet copy is here.
There is a (new 06-FEB-2004) version of the on-line Pickaxe which has links to the RubyGarden Wiki pages thar are relevant.
Why's (Poignant) Guide to Ruby is a gentle introduction to Ruby, supported by cartoon characters and other illustrations. Not quite Ruby in Manga, but certainly unorthodox. It will suit people fairly new to programming. At present it is a work in progress. The source code is available from the RubyForge project page.
Documentation for 1.8 is coming along at http://stdlib-doc.rubyforge.org/.
For people writing extensions, most of the information is in README.EXT I have a local copy of README.EXT from 1.9, and a copy of 1.9 README.EXT in HTML. This was created with:
brains hgs 585 %> to_markdown.rb README.EXT README_EXT_markdown > scratch
brains hgs 586 %> filter_markdown_blocks.rb README_EXT_markdown README_EXT_markdown_filtered
brains hgs 587 %> markdown_to_html.rb README_EXT_markdown_filtered README_EXT_markdown.html
There is a Wiki Book 'Programming:Ruby". (mentioned in Ruby-doc:991).
I used to have Rdoc docs of my copy of the Ruby CVS tree created with do_rubycvsdocs.sh. I also have Rdoc docs of my copy of the Ruby 1.8 CVS tree created with do_rubycvsdocs_1.8.sh.
I have a local copy of the reference manual downloaded from there. I have created an A-Z index of the 1.4 Manual based on those files.
I have created a small document describing the background and usage of Masaki Suketa's RubyUnit. I hope this will be of help to some people. I also have a page about Watir, with links to information about Web Application Testing in Ruby.
There is an Introduction to DRb available in English, from Chad Fowler. This documents dRuby or drb as it is sometimes called. I have started to write my own documentation for this, see my dRuby page. At the time of writing this, there is little information there.
RACC is now bundled with Ruby 1.8.x.
My FXRuby Page now contains the documentation that occupied this paragraph.
Resources for Tk include Ruby/Tk Tutorial; a three part article by Christopher Roach - parts 1, 2 and 3; Ruby-Tk FAQ; and Ruby/Tk classes and Modules.
There is also WideStudio
There is a page about callcc and continuations in Ruby on the Merd site.
Details of the mailing lists are held in
Question 1.7
of the Ruby FAQ
and
on ruby-lang.org
.
There is also the newsgroup comp.lang.ruby
,
see Question 1.6
of the Ruby FAQ.
There is now a site for the annual Ruby Conference.
I am beginning a foray into the world of Ruby on Rails, the web development framework based on Ruby (and a database). There is a documentation site for RoR. There are full manuals site. There is a book Agile Web Development with Ruby on Rails by Dave Thomas, David Heinemeier Hansson, et al [ISBN: 0-9766940-0-X].
There is a mailing list with archives, and another interface to the archives. There is also a Wiki.
There is a Ruby on Rails Newcomers FAQ.
The Dwarves on Rails has good example code for a small model, with table joins. etc.
Debugging Rails Application[s] from datanoise.com
.
I am making a few notes on it myself.
I haven't done a whole lot with jruby yet. Some time last year (2013) I was finding it faster than MRI (using 1.7.1 version). Here are some odd notes and links. The whole of this page could do with being refreshed.
include Java
, but still looks useful
at the moment. At least with my knowledge of Java at the moment.Ruby Central has been created by The Pragmatic Programmers, Andy Hunt and Dave Thomas. They have also created a Wiki for discussion of Ruby development. It is at http://www.pragprog.com:8080/ruby or http://www.pragprog.com/ruby.
The Ruby Quiz contains quizzes posted to Ruby-Talk with digests of answers. These answers are usually pretty insightful, as well as the problems being quite interesting in themselves.
The Ruby Ring has a page for the list of sites.
Facets contains a lot of classes and methods that one might consider writing oneself.
The arkadia.com
Ruby Page, from their
Programming Languages page.
Shoes a very easy to pick up GUI toolkit from Whytheluckystiff. The Shoebox is a collection of Shoes applications. There is documentation called "Nobody Knows Shoes" free at Hackety Press for shoes is to be soul of the new Hackety Hack, see http://hackety.org/ for more of this sort of thing.
See also Takaaki Tateishi's Ruby page.
The RDtool page for Ruby Document format processing,
The announcement of Rockit version 0-3-5 points to where the tar file can be had, and contains the README file. The Rockit Home Page is the place to look for the latest on this project.
Matju's AST system was also announced, and should tie in well with Rockit.
Hal Fulton's Ruby Page has lots of useful links on it.
Paul Rubel's FormatR brings Perl style formats to ruby. This is something I wanted to write, but he got there first! It looks like he has ironed some of the bugs out of the system in its re-implementation.
RDoc - Documentation from Ruby Source Files from the Pragmatic Programmers. This package parses ruby and extracts comments which precede each class and method, associating them with that method. It then produces (currently HTML) documentation describing the methods and classes in the package.
SWIG has some ruby facilities now. " SWIG is a software development tool that connects programs written in C, C++, and Objective-C with a variety of high-level programming languages." - to quote the site. The documentation for using Ruby with SWIG needs work. There is also a SwigWiki. I have made modifications to the SWIG documentation for Ruby which I have put here for constructive criticism. 31-JAN-2002: These were accepted into SWIG-1.3.11 and since then further dramatic improvements have been made by others.
Ruby-Lua allows the embedding of Lua interpreters in Ruby.
YAML4R is an interesting project to provide access to the YAML human readable data description language through ruby. YAML uses indentation to show the structure of data, but because there are ways to cross-reference data in the same file, it is not limited to tree structures. The project's homepage has more links on the subject.
Using YAML in my datafiles for my current work will create an extra dependency on other people's code. This is a problem for the system as I am designing it so I'd like to avoid that. There are actually a lot of nuances in the full yaml spec, and so I'm not confident about writing my own module to handle this. Looking into "Self Describing Data" yielded this document stating how XML can be used to describe data formats, (the doc is best read from the beginning). Also Learning XML: a guide to creating self-desribing data from the O'Reilly catalog has a good sample chapter. However, I conclude that for simple tables of floats, the format is excessive, even though DTD syntax is now much clearer to me than it was. Even though REXML wraps a lot of this, you still need to be familiar with things like XPath and SAX to use it properly, and the nested nature of XML makes some of the commands feel to "heavy" for me. (05-FEB-2003 -- My opinion has changed somewhat now. REXML simplifies things considerably, and the XPath usage is simpler than I thought. See my XML informationn elsewhere. Jack Herrington's Code Generation book, and this page from IBM (which seems to be the same as this article from gnosis.cx show how easy it can be to use REXML.) My local copy of the REXML 2.7.3 API docs and my local copy of the REXML 3.1.2 API docs are available, as is my local copy of the tutorial. There is also MyXML which is built on top of REXML, though I have not used it yet (13-SEP-2004). The RubyXML site referred to xmlsuck.com, which has a list of XML alternatives, of which ONX looks the simplest for my purposes. This paragraph is not particularly relevant to ruby but may be of some use to rubyists.
There is a MiniRubyWiki, with source code available via the CVS links, (then click on download). {This being CVS I expect the exact URL of this is rather too dynamic to be held here.}
There is an interesting collection of libraries and applications at http://ttsky.net/ruby/.
There are a number of Directory pages about Ruby:
The Open Directory (dmoz.org
)'s
Ruby page;
The Google Directory's
Ruby page.
There is an extensive collection of links on this Yet Another Ruby Links page.
Ruby Mine belongs to Aleksi Niemelä, but it seems to have gone 23-JUL-2002. This has news and links on it, and its coverage for the new user is very good.
Mod_Ruby is the Ruby interpreter that can be embedded in the Apache Web server. It lives at http://www.modruby.net/.
Erubis is a faster version of eruby. (See also stdlib docs of erb.) Erubis supports more languages (ruby, perl, javascript, scheme).
There is a lot of software in ftp://ftp.netlab.co.jp/pub/lang/ruby/contrib/.
Rubric is a news aggregator written in Ruby. The news in this case is not newsgroups, but RSS[1][2][3] -- Rich, or RDF, Site Summaries.
glark deserves to be better known. It is a "grep" that can find expressions on different lines in the same file, will highlight the results, and uses ruby regexps. It is written in ruby. The highlighting is by means of ANSI colour. The latest (on 07-JUL-2004) is :
MD5 (glark-1.7.0.tar.gz) = c5bcd6346550b35fbf34992a701ee0d5
See the glark download page for the various distributions.
glark occupies almost the same space as ack, which is a Perl program for searching code (including HTML and LaTeX) using fast ststing searching algorithms. Being Perl it is very portable. Somewhat faster but less portable is ag: the silver searcher, which uses a faster string algorithm (at the time or writing and mmap. I mention these (a) so as not to lose the info, but (b) because it may be of use to someone.
metaprogramming.rb is code extracted from http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html (or http://tinyurl.com/9qmo3 for short). It is by Why the Lucky Stiff of Redhanded fame. On the topic of metaprogramming, this ruby-talk posting about class instance variables is useful. as is this entry from the MobCode blog's Code category.
The Kirbybase database is a simple plain text database system. It is also available for Python.
Ruby Programming Language Enables Concise Network Programming by Mark Watson is a good collection of short networking exaples for HTTP and XML servers and clients, including SOAP and XML-RPC. It is from devx.com.
The support files for Vim that apply to ruby are now available from http://vim-ruby.rubyforge.org/, and the pages referenced from there. I contributed folding to the syntax file, and rolled a very basic compiler file for vim6.1 To actually enable the folding syntax you need to give the command
:set fdm=syntax
which will enable folding and fold as much as it can.
My own version of the syntax file has
highlight Folded ctermfg=Blue ctermbg=DarkRed set fdm=syntax
because I find the white background of the folds to be too bright.
To enable the compiler features you need to use the
:compiler ruby
or
:comp ruby
command and then you can run a script with
:make %
and have the errors located by vim for ease of editing.
Tim Hammerquist has improved on my compiler file with his version which can be found at http://vim.sourceforge.net/scripts/script.php?script_id=349.
Gavin Sinclair has become the maintainer of the Ruby Indent file and the file type plugin for Ruby, see [Ruby-Talk:47005], See his page for more information.
Doug Kearns is maintaining the Ruby Syntax file now [Ruby-Talk:46932], and it is at ruby.vim.
Most of this will be trivial to start with, but as I become more familiar with the language the standard of the code should improve. It does not include the software on My Applied Electromagnetics Group Intranet pages.
mkcontents.rb
will
create a contents chunk from the headings in an HTML file. It
takes 3 args, input, modified input, and
contents. The contents
is plugged back in in the appropriate place in modified input
to create the completed file.
yield
calls.
gets
as the operation to time out.=begin
...=end
in a here document, and have these sections ignored when the string is constructed? It seems not. The solution to this was suggested by Dave Thomas
and it is to have the information in DATA, the file after __END__.
ARGF
. It shows how lines can be
read in sequence from all input files, and how a change in the input file
can be detected. It doesn't demonstrate that if ARGV
is changed, ARGF
will change dynamically.#!
line
at the start of scripts. This means it can pickup warning flags and
so on from that line.
-p n
option of
patch
need not be used on the resulting patch file..
timeout.rb
. The
reason for writing it was that the old version behaves like a boolean
or a success/failure producing timeout, but, like Schrödinger's
cat, you cannot tell how it will behave till you invoke the timeout
method. I wanted it to behave as a something that would return a
boolean, or behave as something that would give a result on success, and
an exception on failure. So I re-wrote it.
ruby -r profile script
at the time.
They are invoked asstderr_to filename command with args
stderr_append filename command with args
filename
is where the output is to go.
Be careful about quoting in command with args
,
because of the way the shell will consume one level of \
before the command string reaches ruby.
require
, class
,
module
, include
and new
keywords is very
simplistic. Example output can be seen in
rdescriber_out.html
.
Modified so that when it is recursing it no longer descends into "." and
"..". for a version that descends directories (up to 10 deep) there is
deeprdescriber.
This has now been out-evolved by
RDoc - Documentation from Ruby Source Files
from the Pragmatic Programmers (see above).
Nonetheless, I still find it has its uses. I've extended it in the
past year to produce diagrams in GIF,
SVG,
and PNG formats, (nested
with the <OBJECT> tag) with Graphvis,
and it now puts all its output
into the directory ./RDESCRIBER/
,
so as not to clutter up the current directory.
And I have further enhanced it to produce the diagrams in colour.
At present these are preset, and unalterable values of colour.
Its detection of of Class.new
missed those
occurrences which were not next to an = sign. Now more are picked
up and multiple occurrences on one line for keywords will work
now as well, improving the coverage.
If this is actually useful, something to detect memory leaks might be
more useful, in which case looking at Visualizing memory leaks in Ruby
would be useful, found from [HN:7385380].
uniq
operator for Array that uses ==
for comparisons, rather than .id
. This is important when
nesting structures, which may be similar but will have different ids.vi[m]
with the:[range]!html_spell.rb
!{motion}html_spell.rb
(etc) commands
so that the misspelled words precede the text. In vim use * to
find the next occurrence of the word under the cursor.
html_spell.rb
above, but comment lines out.
rdate
command allows time to be synchronised between
two machines, but it results in a jump in the local time, which may be a
backward jump. The date
command has a -a
option to overcome this, but rdate
does not. This command
calculates the offset for data -a
so time can be adjusted
smoothly. It relies on the timex module by Tanaka Akira.
ps
, and
uses tput
to clear the screen. I might add command-line
options to allow adjustment of the refresh rate and number of processes,
but since it does what I want at the moment, this is unlikely.
dmu.ac.uk
, but it makes a
stab at detecting
Exim
filter files and responding sensibly to that
knowledge.
*
in a parameter list. As this program shows, the only
thing to rememeber is that *formal_parameter
will wrap
the remaining arguemts in an array, and *a
will expand
a
in place. This means that return *a
is
pretty redundant, and using * in a formal parameter means an extra
level of nesting which may not be needed.
require
'ing the files so they are assembled in the
correct order.md5sum.bat
.
buffer +=
string
repeatedly. It may be quicker still just to add
the strings to an array and do the join('')
once...it
was much quicker. This has been revised to reflect this.
gmake check | colourize red FAIL yellow PASS blue
SKIP
class <<variable; ... end
) inside a
class_eval(string)
call. This way even the
definition of methods becomes dynamic.FILE
interface, where each method has a prefix denoting the class it belongs
to, and the first argument is a pointer to the instance of that class.
So for example, fprintf(FILE *stream, char * const format, ...)
.
It is pretty much a work in progress, but it seems to be functioning correctly.grep
program for finding
files, on a system where I failed to install glark.
extend
works,
include
won't work.
Created on 01-MAR-2000 by
.Last Modified on 12-MAR-2014 by
. Re-validate this page.RCS: $Id: index.html,v 1.169 2014/03/12 12:23:16 hgs Exp hgs $
For automatic address collectors: <postmaster@localhost> <abuse@localhost> blockme@relays.osirusoft.com