[thrift] spruce up Erlang binding for tonight's release

Summary:
 * got rid of most of the otp_base jonx ... save that for a future release unfortunately
 * cleaned up the tutorial server, added -erl to tutorial.thrift's shebang
 * made better README and TODO

Test Plan: checked out a copy, read my directions, built and ran the tutorial, and pretended that it didn't blow


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665273 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tutorial/erl/ErlClient.rb b/tutorial/erl/ErlClient.rb
deleted file mode 100644
index bcf1300..0000000
--- a/tutorial/erl/ErlClient.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.push('../gen-rb')
-
-require 'thrift/transport/tsocket'
-require 'thrift/protocol/tbinaryprotocol'
-
-require 'Calculator'
-
-begin
-  
-  transport = TBufferedTransport.new(TSocket.new('localhost', 9090))
-  protocol = TBinaryProtocol.new(transport)
-  client = Calculator::Client.new(protocol)
-  
-  transport.open()
-  
-  client.ping()
-  print "ping()\n"
-  
-  sum = client.add(1,1)
-  print "1+1=", sum, "\n"
-  
-  work = Work.new()
-  
-  begin
-    work.op = Operation::DIVIDE
-    work.num1 = 1
-    work.num2 = 0
-    quot = client.calculate(1, work)
-    puts "Whoa, we can divide by 0 now?"
-  rescue InvalidOperation => io
-    print "InvalidOperation: ", io.why, "\n"
-  end
-  
-  work.op = Operation::SUBTRACT
-  work.num1 = 15
-  work.num2 = 10
-  diff = client.calculate(1, work)
-  print "15-10=", diff, "\n"
-  
-  log = client.getStruct(1)
-  print "Log: ", log.value, "\n"
-  
-  transport.close()
-
-rescue TException => tx
-  print 'TException: ', tx.message, "\n"
-end
diff --git a/tutorial/erl/server.erl b/tutorial/erl/server.erl
index 2a44e1d..ab2b040 100644
--- a/tutorial/erl/server.erl
+++ b/tutorial/erl/server.erl
@@ -8,7 +8,7 @@
 -include("server/tErlServer.hrl").
 -include("transport/tErlAcceptor.hrl").
 
--include("calculator.hrl").
+-include("calculator_thrift.hrl").
 
 -export([start/0, start/1, stop/1, ping/0, add/2, calculate/2, getStruct/1, zip/0]).
 
@@ -62,7 +62,7 @@
       }]),
 
     Handler   = ?MODULE,
-    Processor = calculator,
+    Processor = calculator_thrift,
 
     TF = tBufferedTransportFactory:new(),
     PF = tBinaryProtocolFactory:new(),
diff --git a/tutorial/erl/server.sh b/tutorial/erl/server.sh
new file mode 100755
index 0000000..a763526
--- /dev/null
+++ b/tutorial/erl/server.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+ERL_THRIFT=../../lib/erl
+
+if ! [ -d ${ERL_THRIFT}/ebin ]; then
+    echo "Please build the Thrift library by running \`make' in ${ERL_THRIFT}"
+    exit 1
+fi
+
+if ! [ -d ../gen-erl ]; then
+    echo "Please run thrift first to generate ../gen-erl/"
+    exit 1
+fi
+
+
+erlc -I ${ERL_THRIFT}/include -I ../gen-erl -o ../gen-erl ../gen-erl/*.erl  &&
+  erlc -I ${ERL_THRIFT}/include -I ../gen-erl *.erl &&
+  erl +K true -pa ${ERL_THRIFT}/ebin -pa ../gen-erl