Reactive-Extensions/Rx.rb — pull request #1 by jamesottaway (2013-03-21 04:24:07+00:00)
Title: Structure the repo more like a Ruby gem

I've done a little work to get the library into a state where it can be built and released as a gem, including moving the code into separate files, grouping the classes in a module, tying it all together in `lib/rx.rb`, and describing the gem in the `rx.rb.gemspec` file.

You can see the Rake tasks available for managing the gem, and for running the specs. `rake build` will spit out a `rx.rb-0.0.1.gem` file, `rake install` will install that into the system gem dir, and `rake release` will push it up to Rubygems.org

The final Rake task, `rake spec`, will spit out something like this to show the specs pass:

``` ruby
/Users/james/.rbenv/versions/1.9.3-p125/bin/ruby -S rspec ./spec/rx/observable_spec.rb
**.........................

Pending:
RX::Observable #to_observable
# No reason given
# ./spec/rx/observable_spec.rb:60
RX::Observable #select_many
# No reason given
# ./spec/rx/observable_spec.rb:93

Finished in 0.00728 seconds
27 examples, 0 failures, 2 pending
```

I also moved the example code at the bottom of `lib/rx.rb` into RSpec to make them a little easier to execute and prove everything is working.

Two specs are marked as pending, as there is an issue in how the `AutoDetachDisposable` calls `#dispose` on the disposable inside its `#set` method.

What do you think?