Skip to content

Commit

Permalink
Some initial content for documentation site.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ford committed Sep 23, 2010
1 parent db5e8e8 commit 634fd8e
Show file tree
Hide file tree
Showing 20 changed files with 1,386 additions and 53 deletions.
2 changes: 1 addition & 1 deletion doc-src/Rules
Expand Up @@ -20,7 +20,7 @@ compile '*' do
end

route '/stylesheet/' do
'/style.css'
'/stylesheet.css'
end

route '*' do
Expand Down
92 changes: 92 additions & 0 deletions doc-src/content/contributing.html
@@ -0,0 +1,92 @@
---
title: Contributing
---

Contributing to Rubinius
========================

The Rubinius project welcomes your contributions. There are many things to do
to help out. Most importantly, you should do something that interests you.
That is the best way to have enthusiasm and energy for your work.

If you have questions about Rubinius, the best way to get answers is to chat
with us in the #rubinius IRC channel on irc.freenode.net.

Below are several ideas for things to do on Rubinius.


Run Your Code
-------------

Your code is often more vicious than the specs. Run your pet project under
rubinius and report issues. See [how to write a ticket](/howto/write_a_ticket).


Ask For Help
------------

Anything that we can do to help, we will. Make sure to do your own research
too, if possible. Rubinius attempts to be a project that you can easily study,
learn from, and hopefully extend.

We will certainly accept and appreciate simple bug reports, but we can give
priority to tickets that include simple steps to reproduce the issue. Even
better are tickets that include RubySpecs that demonstrate the bug and a patch
that fixes it.


Write Specs
-----------

1. Run 'bin/mspec tag --list incomplete <dir>' to show specs that have been
tagged as incomplete. These specs may simply need review, or there could
be specs missing for a particular class.

NOTE: You can specify the pseudo-directory ':files' for <dir>, which will
show tags for all the specs that should run on Rubinius. Or you can
specify any subdirectory of the spec/ directory to list tags for specs in
that subdirectory.

2. Find unspecified behaviors. See [how to write a Ruby
spec](/howto/write_a_ruby_spec).


Fix Failing Specs
-----------------

1. Run 'bin/mspec tag --list fails <dir>' to show specs tagged as failing.

NOTE: You can specify the pseudo-directory ':files' for <dir>, which will
show tags for all the specs that should run on Rubinius. Or you can
specify any subdirectory of the spec/ directory to list tags for specs in
that subdirectory.

2. Pick a spec that looks interesting and see if you can write a patch that
will make it pass.


Write Docs
----------

Study how Rubinius works and write highlevel documentation that will help
others learn about the implementation details. See documents under doc/vm for
examples.


Cleanup Code
------------

Search for tags like TODO, HACK, FIXME in the code and submit patches to fix
them. Here's a command to search the code:

'grep -re "@todo\|TODO\|HACK\|FIXME" .'

Review the [style guide](/style_guide) for coding guidelines.


Triage Tickets
--------------

* Revive or close old tickets.
* Build minimal test cases that reproduce the bugs. Then see if there are
already RubySpecs for the issue. If not, consider writing some.
108 changes: 108 additions & 0 deletions doc-src/content/getting_started.html
@@ -0,0 +1,108 @@
---
title: Getting Started
---

Getting Started
===============

This guide will help you get Rubinius running. It assumes you know something
about Ruby and about installing software on your system.

If you have trouble following the directions here, visit the #rubinius IRC
channel on irc.freenode.net for help.

Requirements
------------

Ensure you have the following programs and libraries installed. Also see the
subsections below for special requirements for your particular operating
system.

The following are suggestions for getting more information about the programs
and libraries needed to build Rubinius. Your operating system or package
manager may have other packages available.

* [GCC and G++ 4.x](http://gcc.gnu.org/)
* [GNU Bison](http://www.gnu.org/software/bison/)
* [MRI Ruby 1.8.7+](http://www.ruby-lang.org/) If your system does not have
Ruby 1.8.7 installed, consider using [RVM](http://rvm.beginrescueend.com/)
to install it.
* [Rubygems](http://www.rubygems.org/)
* [Git](http://git.or.cz/)
* [ZLib](http://www.zlib.net/)
* pthread - The pthread library should be installed by your operating system
* [gmake](http://savannah.gnu.org/projects/make/)
* [rake](http://rake.rubyforge.org/) `[sudo] gem install rake`


### Apple OS X

The easiest way to get a build environment on Apple OS X is to install the
XCode Tools and Utilities. Once installed, you can enable developer mode crash
reporting at: /Developer/Applications/Utilities/CrashReporterPrefs.app


### Debian/Ubuntu

* ruby-dev or ruby1.8-dev
* libreadline5-dev
* zlib1g-dev
* libssl-dev


Building Rubinius
-----------------

You can build and run Rubinius from the source directory. You do not need to
install Rubinius to run it. The directions below will detail both installing
Rubinius and running it from the source directory.

Rubinius uses LLVM for the JIT compiler. Rubinius depends on a particular
version of LLVM. If you have installed LLVM on your system, pass the
'--skip-system' flag to the configure script in the directions below.

The Rubinius source code is on Github: git://github.com/evanphx/rubinius.git


### Installing Rubinius

1. `./configure --prefix=/path/to/install/dir`
2. `rake install`
3. `Add /path/to/install/dir/bin to your PATH`


### Running from the Source Directory

If you plan to work on Rubinius itself, this is the simplest option.

1. `./configure`
2. `rake`
3. `Add /path/to/source/dir/bin to your PATH`


Running Rubinius
----------------

Once you have followed the steps for building (and possibly installing)
Rubinius, you can verify it is working:

rbx -v

Rubinius generally works like Ruby from the command-line. For example:

rbx -e 'puts "Hello!"'

To run a ruby file named 'code.rb':

rbx code.rb

To run IRB:

rbx


Troubleshooting
---------------

See [common problems](/common_problems) and visit us in the #rubinius IRC
channel on irc.freenode.net.
21 changes: 21 additions & 0 deletions doc-src/content/howto/write_a_ruby_spec.html
@@ -0,0 +1,21 @@
---
title: Howto - Write a Ruby spec
---

Howto - Write a Ruby Spec
=========================

Make sure you have read:

* [Getting Started](/getting_started)
* [Specs](/specs)

Then, follow these steps to write a spec for a Ruby method:

1. Edit a file under 'spec/ruby/...'
2. Run 'bin/mspec -tr spec/ruby/some/spec_file.rb'
3. Repeat until the spec passes on MatzRuby
4. Commit your changes
7. Use 'git format-patch'
8. Create a gist with your patch and link to it in a ticket on the issue
tracker at http://github.com/evanphx/rubinius/issues.
141 changes: 141 additions & 0 deletions doc-src/content/howto/write_a_ticket.html
@@ -0,0 +1,141 @@
---
title: Howto - Write a ticket
---

Howto - Write a Ticket
======================

The Rubinius issue tracker is http://github.com/evanphx/rubinius/issues.

To be useful, tickets must be concise, focused, and actionable. If not, the
ticket will languish and become clutter. Accordingly, tickets must fall into
one (or more) of the following categories:

1. A precise command line history showing how to install and invoke the
program and showing the backtrace for an exception.
2. A short piece of code illustrating the problem and the command line to
invoke it.
3. A patch, **including specs if they do not already exist**, and showing
the spec runs before and after applying the patch.

If your issue doesn't fit into one of the categories, it is not invalid. It is
simply not appropriate for a ticket.

1. If it is a feature, consider discussing it on the mailing list. Also, you
could take a crack at implementing it and demonstrate how your feature is
useful.
2. If it is a library or gem that is not working, take some time to dig in
and see if you can create a reproduction for an issue and post that as a
ticket.

There are various wishlist items, upcoming features, and lists of gems in the
doc/todo/ directory.


General procedure for submitting a ticket
-----------------------------------------

1. Double-check.

1. Do a full rebuild ('rake clean; rake') after a 'git pull' or fresh clone.
2. Read doc/common_problems.txt see if something there resolves the issue.
3. Read doc/rubinius_specs.txt

2. Give your ticket a specific, preferably short title.

3. Give your ticket appropriate tags.

4. Give enough detail about the issue.

* The command line for invoking the program
* The backtrace or result from the program versus expected result.
* Your machine information. 'uname -a' is usually good (if there are any
"unknown" fields in it, please elaborate on those.)


Additional instructions for tickets with patches
------------------------------------------------

* Can be just a set of specs.
* Patches must be accompanied by specs unless the specs already exist.
* Relevant part of spec output and the exact 'bin/mspec' invocation from the
existing or added spec *before the fix*.
* The spec output and the exact 'bin/mspec' invocation showing success
*after* the fix.
* Additional description of your patch and how it fixes the problem. In
particular with new functionality please indicate if it was already
discussed on #rubinius or ruby-dev.

Unless for some reason impossible, please use 'git-format-patch' to create the
patchset. It is much easier to apply and it preserves the correct attribution.
Otherwise, a unified diff.


Example of submitting a patch
-----------------------------

Suppose the following spec exists and is failing:

describe "Kernel.format" do
it "is accessible as a module function" do
Kernel.format("%s", "hello").should == "hello"
end
end

1. Ticket Title:

"[PATCH] No method 'format' on Kernel (Module)"

2. Tags:

"patch core spec"

3. Ticket Message:

The method 'format' is not available as a module function of Kernel.

$ bin/mspec spec/ruby/core/kernel/format_spec.rb
Started
.E

1)
Kernel.format is accessible as a module function ERROR
No method 'format' on Kernel (Module):

The method 'format' already exists but has not been set as a module
function. This patch does so.

After the patch is applied:

$ bin/mspec spec/ruby/core/kernel/format_spec.rb
Started
..

Finished in 0.016031 seconds

2 examples, 2 expectations, 0 failures, 0 errors

4. Attachment:

Finally, put your patch in a gist and add the link to the gist to your issue.
Below the patch is reproduced inline for completeness:

From c61cecce6442347ebbdf1ded7a5c0832c97582c1 Mon Sep 17 00:00:00 2001
From: Brian Ford <bford@engineyard.com>
Date: Sat, 19 Jan 2008 17:48:19 -0800
Subject: [PATCH] Set Kernel#format as a module function.


diff --git a/kernel/core/kernel.rb b/kernel/core/kernel.rb
index 2d2e508..f2a382e 100644
--- a/kernel/core/kernel.rb
+++ b/kernel/core/kernel.rb
@@ -150,6 +150,7 @@ module Kernel
end
alias_method :format, :sprintf
module_function :sprintf
+ module_function :format
module_function :abort

def puts(*a)

0 comments on commit 634fd8e

Please sign in to comment.