Sha256: faca622a211514fcea66c342ec8eef5d3429fb7175393ac89a50860839d92e26

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ernie'

# logfile('/tmp/ernie.log')
# loglevel(Logger::INFO)

mod(:test) do
  # Add two numbers together
  fun(:add) do |a, b|
    a + b
  end

  # Return the given number of bytes
  fun(:bytes) do |bytes|
    'x' * bytes
  end

  # Sleep for +sec+ and then return :ok
  fun(:slow) do |sec|
    sleep(sec)
    :ok
  end

  # Throw an error
  fun(:error) do |a, b|
    raise "abandon hope!"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ernie-1.3.0 examples/dsl.rb