Is there an English version of the Ruby Hacking Guide? - ruby

As far as I can tell, a complete English translation of the Ruby Hacking Guide does not exist. I find this unbelievable given the fact that it was originally written in 2004. Of course, a few attempts have been made:
The RubyForge project is ostensibly the most official, but even a cursory look through the mailing list archives reveals that it has low traffic and is more or less dead.
C. E. Thornton also took a stab at translating it, calling his version the Integrated Ruby Hacker's Guide. While substantial, it too is incomplete: the "blue" chapters are machine translated.
This site gives the most thorough background that I could find.
My questions are as follows.
Does anyone know if there is another significant English translation of the Ruby Hacking Guide available?
Is there an active translation effort in progress?
Even if someone were to produce an English version of the Ruby Hacking Guide, would it still be relevant?
Apart from the Ruby Hacking Guide, what is the best resource for English-speaking developers who want to work on/understand Ruby internals?

The most important stuff is already translated in your links. Ruby has changed a lot since 2004, especially with 1.9. It would be better to write a new Ruby Hacking Guide instead of translating the old one.
I read a lot of books about Ruby but the Dave Thomas' screencast was by far the best on understanding the ruby fundamentals.
http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming
There is always the option to read the original source code of Ruby. A good alternative is the source code of http://rubini.us/ as most of it is already in Ruby.

http://ruby-hacking-guide.github.io had its translation completed in September 2013.
The site is based on https://github.com/ruby-hacking-guide/ruby-hacking-guide.github.com . Some minor changes have been made since September 2013.

Related

Collaborative Ruby resources for novices

I am very much a Ruby newb - hoping to migrate to Ruby on Rails (although I have walked through Mike Hartl's Tutorial, which was excellent). I just want to solidify my Ruby knowledge first.
I am working on a hobby Ruby project to help me learn. I am pretty happy with how far I have got so far, but wanted to discuss/share it with other like-minded novice/beginner programmers.
Can anyone point me to a 'community' that promotes collaboration, critisim and discussion on code (ideally Ruby, obvs)?
If such a community doesn't exist, does anyone have any advice on how to find other like-minded programmers working on small-scale scripts/programs?
I have an account on Github, and on here (obviously!). Whilst Github is great for navigating around, cloning and looking at people's code, I don't feel anywhere near the level where I can start to actually contribute to anything and likewise request people look at my code. Maybe I am just being a wuss and I should just jump in the deep end? Perhaps I am not using GitHub correctly as a 'social network'.
Also, from what I can see, StackOverflow is not the place to send out 'Hey, check this out and let me know what you think' type requests either.
Not meant to be a discussion - just whether anyone knows if such 'networks' exist.
It depends on where you're located, but hacknights (Ruby or otherwise) are probably up your alley. There are different flavors (Are you solving a stated problem? Working on something general?) but usually you can work with others in a collaborative and low-stakes environment. I'd suggest searching for "hacknight" in your area and look at any past or upcoming nights.
As an example, see http://www.meetup.com/torontoruby/events/53887372/
RailsCasts - very interesting project for knowing ruby-technologies.
Also you can going to software-company and start working, and you get criticism, discussions and collaboration :)

Automation of webbrowser using watir and ruby

I have installed ruby 1.9.2 and watir on my windows 7 system. Now I want to automate my web browser. Suppose there are 10 different links which I want my browser to browse after certain amount of time. How do I do this? I am new to ruby and watir. Can someone suggest me how the process of coding would be or suggest me a site or an ebook where I can get material regarding this.
Since a lot of the basics of scripting (conditional logic, loops, waiting, etc) are relative to the basic Ruby language and not the specific classes and methods implemented by Watir, I'd suggest starting off with a good book on scripting with Ruby.
My favorite is by one of the original folks responsible for Watir itself, Brian Marick "Everyday Scripting with Ruby: for Teams, Testers, and You".
In terms of watir, there's the tutorials in the Watir wiki, and the book that Zelkjo is working on.
The thing you describe, is 90% scripting (repeating a given type of action, with a different input, after a specified time interval) and 10% watir (navigating to the link value), so I'd start with the scripting stuff first.
For someone on a budget, I would also offer the following "free" books (I put 'free' in quotes because I'm familiar with all the time and effort that goes into authoring a book, and these are not 'free'. They come at the expense of a lot of blood, sweat and tears on the part of authors/editors etc. who have then been generous enough to then offer up their work without pay. I think calling them 'free' devalues the labor that went into creating them.)
"Programming Ruby: The Pragmatic Programmers Guide" is often installed by the Ruby installer (depending on version) or can be accessed at the link above. I've used this more as a reference than a learning tool, but it might work for you.
Why’s (Poignant) Guide to Ruby, available in both HTML and PDF versions, is somewhat iconic in the Ruby community. I found the writing style amusing and got some good stuff out it it, but then I'v been programming in a variety of languages since the days of teletypes and 110baud acoustically coupled modems.
Mr. Neighborly’s Humble Little Ruby Book - I've not read this one, but it seems well regarded if a tiny bit out of date. Aaron Sumner said of it "it’s relatively short (under 150 pages) and in a very friendly, accessible tone. If you’re still getting familiar with the Ruby language itself, it’s as good an introduction as there is out there."
All of those are I think more geared to someone who already understands programming, and not as good for a new tester starting out doing automation. For that you'd be better served spending the money for Marik's book, Since he's worked as a tester, and understands testing, and the book is largely aimed at testers, I thus think you can get far more out of it. Seriously it may not be free, but consider it an investment in your education and career.
I would suggest that you browser Watir web site: http://watir.com/
I have also started writing a book (current version is 0.6):
https://github.com/zeljkofilipin/watirbook
https://github.com/zeljkofilipin/watirbook/downloads

Learn Ruby Without Poignancy

I suppose this is two very closely related questions:
Everyone says to start with Why's (Poignant) Guide to Ruby, and I can't stand that book; what's another good starting point for an experienced programmer that has a more serious tone?
If I'm not the sort of person who appreciates _why, should I skip Ruby because the community will not be to my taste?
I'm currently rolling through Programming Ruby: The Pragmatic Programmer's Guide. So far I think the concepts are well-defined by the authors, and the examples provided help clarify any misunderstandings. The book is available for free online or you can order a copy:
http://www.ruby-doc.org/docs/ProgrammingRuby/
Update: More current version of book (Thanks bgporter)
http://pragprog.com/titles/ruby3/programming-ruby-1-9
The only problem with the online version is that it is a little outdated. I don't know Ruby that well yet so I can't say how much of the book is still valid in all cases, but the examples have worked for me so far when I run them. Note that the book available for purchase is up to date. It's hard to beat free, so be sure to check this guide out.
That being said, I don't think you should skip out on Ruby just yet. I've had a blast learning the language so far, and I'm looking forward to doing some full-fledged web development with Rails soon. At the very least give the language a chance; I think you'll find it a joy to work with.
I bought a lot of books learning ruby, the Well Grounded Rubyist was hands down the best.
And while we aren't really a community of _whys, we are a community of people who appreciate creativity and cleverness in code. If you are the sort of person who thinks there should only be one way to do something, and that way should be the clearest and most straight forward possible, python is probably for you. If you are the person who likes to push the language as far as it will go to create interesting and clever APIs, ruby is probably for you.
The Ruby Programming Language.
Programming Ruby would be my choice. It's also known as the Pickaxe book because of the cover:
It's a great introduction to Ruby. Why they still have the huge API reference in it in this day and age escapes me, though. It makes it thick as a brick, which is its only fault.
You can also find it online, although I think it's the first edition, which is well dated: http://ruby-doc.org/docs/ProgrammingRuby/. The third edition is the one in print now, it was updated just months ago and covers Ruby 1.9.2, which is the latest version of Ruby at this time.
I don't particularly like _why either. He created some great libraries, but I can't stand the Poignant guide, nor any of the talks he made. You don't have to like him, or be like him to belong in the Ruby community.
Ruby Koans are great for learning those small things that make Ruby unique.
It's basically set of excercises that show you how things work. Each excercise is in form of a failing test, and you have to make sure it passes. And they're fun! :)
If you're going to do them all, I also suggest enabling autotest, so you won't have to run them manualy. This article explains how.
Not everyone says start with Why's book, for instance, me.
Here's a quick list of my on-disk Ruby books and references. You can search for their individual titles on the interwebs. Some are commercial, and some are free. I linked the ones that are part of an app's documentation that I saved as PDFs so I'd have them on my laptop.
Agile Web Development with Rails
Programming Ruby
Ruby Best Practices
Sequel cheatsheet
Sinatra Book
The Ruby Cookbook
The Ruby Programming Language
The Ruby Way
The Well Grounded Rubyist
Why's book is worthy, but reminds me of Hunter S. Thompson trying to write a programming book, complete with Ralph Steadman drawings, which really disturbs me.
Also, don't overlook using ri, which is the on-disk reference to Ruby's libraries and gems. Also, the core library and standard library docs are really useful.
I was in your position this summer. Why was not for me, but I did find an excellent online resource: http://railstutorial.org/. It is actually for learning Ruby on Rails, but you can use it to learn Ruby as well. I'm not very experienced but I believe you can be part of the Ruby community without appreciating Why :-).
http://railsforzombies.org/ is a nice one , although it is not a book
Chris Pine's Learn to Program It's very straightforward. I started learning right away. It was very encouraging.
My colleague has written an excellent post summarizing starting points, books to read and paths to follow when learning ruby at http://www.jasimabasheer.com/posts/meta_introduction_to_ruby.html
I'd recommend taking a look at it, it has a wealth of information.
To add more info to the answers above, not really a book to learn ruby but a some companion resources for the learning process:
Ruby Language Quick Ref
Essential Ruby Refcard

Is there a website to look up common, already written functions?

I'm sitting here writing a function that I'm positive has been written before, somewhere on earth. It's just too common to have not been attempted, and I'm wondering why I can't just go to a website and search for a function that I can then copy and paste into my project in 2 seconds, instead of wasting my day reinventing the wheel.
Sure there are certain libraries you can use, but where do you find these libraries and when they are absent, is there a site like I'm describing?
Possibly a wiki of some type that contains free code that anybody can edit and improve?
Edit: I can code things fine, I just don't know HOW to do them. So for example, right now, I'm trying to localize a robot/car/point in space. I KNOW there is a way to do it, just based off of range and distance. Triangulation and Trilateration. How to code that is a different story. A site that could have psuedo code, step by step how to do that would be ridiculously helpful. It would also ensure the optimal solution since everybody can edit it. I'm also writing in Matlab, which I hate because it's quirky, adding to my desire for creating a website like I describe.
StackOverflow.com. No, I'm not joking.
At its best, people come here saying "hasn't some library done X already", and very often the Collective Wisdom answers "yes". But the biggest obstacle is lack of a description language: even here, a big problem for many posters is describing the problem clearly enough for others to recognize it as something they've seen before.
And if people can't understand what you're trying to do, no search engine will.
Firstly, two caveats:
Copy and pasting code you don't understand is a bad idea. Make sure you understand exactly what the code does before you use it.
Make sure you respect the license of the code you are copying. This is important!
Those caveats aside, it's often language dependent. Languages with an open development ethos (not just an open source implementation, think Python as compared to Java) tend to have official archives of open source libraries. For example:
Perl (which probably started this trend) has CPAN
Python has PyPI and Python Cookbook
PHP has PEAR
C++ has boost
Ruby has gems
R has CRAN.
Haskell has Hoogle and Hackage
Furthermore, don't forget to look in your languages standard library. Some modern languages have massive standard libraries, which have often contained the functionality I am looking for:
Java has its API documentation
C# and VB.NET have the massive MSDN
Non-openly developed languages often have non-official community archives. For example:
C# tends to have a lot of code at CodePlex and CodeProject
MATLAB has the Matlab Central File Exchange
A third category of sites are language agnostic. They are often best search through POG (plain old-fashioned Google). For example:
Stack Overflow
SourceForge
The confusingly language agnostic Java2s
Planet source code
Github
Finally, a fourth category of sites that I find increasingly useful are source-code search engines:
Google Codesearch
Koders
You may also be able to find useful source code, or at least get help writing something, through various pastebins.
Pastebin is language-agnostic
HPaste is mostly Haskell, but has a little in other languages.
Often, at the end of the day it is easiest just to google it, though.
There is a wiki that contains free code that anybody can edit and improve:
Rosetta Code.
As a means of an overview there is the "Solutions by Programming Task" page.
From the former page:
"Rosetta Code is a programming chrestomathy site. The
idea is to present solutions to the same task in as
many different languages as possible, to demonstrate
how languages are similar and different, and to aid a
person with a grounding in one approach to a problem
in learning another."
Cutting and pasting code you find on the Internet into production code would be like chewing gum found in the street. - Mike Johnson
With that in mind, try sites that host opensource projects like GitHub, CodePlex, code.google.com, etc.
I'm not sure this question is language agnostic, but I use GitHub this way ;) Other languages may have places where this is possible.
Safari Bookshelf from O'Reilly has many, many books that contain many implementations from which to choose.
http://my.safaribooksonline.com/
I was a subscriber for a few years before coming to my current job, where we have a corporate account! It's one of the best perks, and one of the best resources I have available. I haven't bought a computer book in years.
Aside from sites like this (Stack Overflow) I don't think there's many, maybe CodePlex, but I almost marked you -1 for assuming that code found on the Internet is yours to copy.
I'd suggest reading about software licencing, I hope you'd at least comment where you got it from.

Is there a Perl equivalent of the ruby koans project?

Is there a Perl equivalent to the ruby-koans project?
When I was starting to learn ruby a few months ago I stumbled across ruby-koans and it was a huge help for learning the basics of the language.
I now need to poke at some Perl code, and while I've hacked together a few Perl scripts in the past I've never really learned the language, and every time I have to refer back to older scripts I wrote for even simple things. I have a feeling that something like koans would make it much easier for me to learn and retain knowledge of Perl.
Does anything like that exist?
Two possible options in absence of 100% identical alternative:
A mid-point between perldoc and ruby koans is O'Reilly's Perl Cookbook.
It offers working "how to solve this particular task" examples.
As a DIY perl koan, how about perusing "perl" tag on StackOverflow and trying to answer the questions (without peeking at answers)? Not 100% the same but a great way to learn by doing.
One great resource that I use to quickly move between languages is RosettaCode. Its not tutorials, but a wide assortment of simple programming tasks done in many languages. I find that if I know one or two languages on the page, using them, I can usually figure out how an unfamiliar language on the page works. The Ruby, Python, and Perl sections are even close alphabetically, making jumping back and forth easy.
Perl happens to come with great documentation that is more than just a list of API functions, parameters and return types.
Those tutorials include a lot of code samples that show what to do and what not to do.
In my experience, one needs to read ALL of the bundled documentation at least once before seeking other sources of wisdom.
I don't know of anything exactly like the koans.
The standard docs have lots of example code--especially the tutorial and cookbook style articles.
Some other resources:
Perl Advent Calendar
The Perl Cookbook
PLEAC - Programming Language Examples Alike Cookbook
Here is a repo on GitHub that provides a good number of koans:
https://github.com/forcedotcom/PerlKoans
Try reading "Learning Perl" (not earlier than 4th edition) or "Beginning Perl". Both has exercises.
Still in its infancy but this is a start.
https://github.com/maio/perl-Koans
I just recently came across the Perltuts project. It has a similar feel to Codecademy.

Resources