Skip to content

Commit

Permalink
Copyedit documentation and convert to Markdown format; add Yardoc to …
Browse files Browse the repository at this point in the history
…gems for documentation generation
  • Loading branch information
pjlegato committed Nov 22, 2011
1 parent 04d1030 commit 2b5ad59
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 58 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ tmp

## PROJECT::SPECIFIC
*.db

# Autogenerated documentation

.yardoc
4 changes: 4 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-o doc/autogenerated --markup markdown
--no-private --protected
lib/**/*.rb
README.md
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ gem 'rspec', '>=2.7.0', :require => ['rspec', 'rspec/autorun']
# Gems used in bin scripts
gem 'getopt'
gem 'duration'

group :development do
gem "yard" # YARD documentation generator
gem "bluecloth" # Provides markdown text markup format to YARD
end
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
bluecloth (2.2.0)
diff-lcs (1.1.3)
duration (0.1.0)
getopt (1.4.1)
Expand All @@ -12,13 +13,16 @@ GEM
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
yard (0.7.3)

PLATFORMS
java
ruby

DEPENDENCIES
bluecloth
bundler (>= 1.0.13)
duration
getopt
rspec (>= 2.7.0)
yard
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# ib-ruby

Ruby Implementation of the Interactive Brokers Trader Workstation (TWS) API v.965.

Copyright (C) 2006-2011 Paul Legato, Wes Devauld, and Ar Vicco.

https://github.com/pjlegato/ib-ruby

__WARNING:__ This software is provided __AS-IS__ with __NO WARRANTY__, express or
implied. Your use of this software is at your own risk. It may contain
any number of bugs, known or unknown, which might cause you to lose
money if you use it. You've been warned.

__It is specifically NOT RECOMMENDED that this code be used for live trading.__

This code is not sanctioned or supported by Interactive Brokers
This software is available under the LGPL. See the file LICENSE for full licensing details.


## REQUIREMENTS:

Either the Interactive Brokers
[TWS](http://www.interactivebrokers.com/en/p.php?f=tws)or
[IB Gateway](http://www.interactivebrokers.com/en/control/systemstandalone-ibGateway.php?os=unix&ib_entity=llc)
software must be installed and configured to allow API connections
from the computer you plan to run ib-ruby on, which is typically
localhost if you're running ib-ruby on the same machine as TWS.

## INSTALLATION:

### From RubyGems

$ sudo gem install ib-ruby

### From Source

$ git clone https://github.com/pjlegato/ib-ruby
$ cd ib-ruby; rake gem:install

## SYNOPSIS:

First, start up Interactive Broker's Trader Work Station or Gateway.
Make sure it is configured to allow API connections on localhost.

>> require 'ib-ruby'
>> ib = IB::Connection.new
>> ib.subscribe(:Alert, :AccountValue) { |msg| puts msg.to_human }
>> ib.send_message :RequestAccountData, :subscribe => true

Your code and TWS interact via an exchange of messages. You
subscribe to message types you're interested in using
`IB::Connection#subscribe` and request data from TWS using
`IB::Connection#send_message`.

The code blocks (or procs) given to `#subscribe` will be executed when
a message of the requested type is received, with the received message as
its argument.

See `lib/ib-ruby/messages` for a full list of supported incoming/outgoing messages and
their attributes. The original TWS docs and code samples can be found
in the `misc/` folder.

The sample scripts in the `bin/` directory provide examples of how
common tasks can be achieved using ib-ruby.


## LICENSE:

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA

58 changes: 0 additions & 58 deletions README.rdoc

This file was deleted.

0 comments on commit 2b5ad59

Please sign in to comment.