Skip to content

Commit

Permalink
update history and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Nov 23, 2009
1 parent 06312f1 commit b160093
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions History.txt
@@ -1,3 +1,9 @@
=
* API Additions
* Add Ernie.expose
* Internal Changes
* Remove 15s internal timeout

= 1.1.0 / 2009-10-28
* Major changes
* Remove dependency on Erlectricity
Expand Down
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -51,6 +51,8 @@ Running
Example Handler
---------------

Using the DSL:

require 'ernie'

mod(:calc) do
Expand All @@ -59,6 +61,18 @@ Example Handler
end
end

Using Ernie.expose:

require 'ernie'

module Calc
def add(a, b)
a + b
end
end

Ernie.expose(:calc, Calc)


Example BERT-RPC call for above example
---------------------------------------
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions examples/expose.rb
@@ -0,0 +1,27 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ernie'

module Test
# Add two numbers together
def add(a, b)
a + b
end

# Return the given number of bytes
def bytes(n)
'x' * n
end

# Sleep for +sec+ and then return :ok
def slow(sec)
sleep(sec)
:ok
end

# Throw an error
def error
raise "abandon hope!"
end
end

Ernie.expose(:test, Test)

0 comments on commit b160093

Please sign in to comment.