diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-26 18:22:10 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-26 18:22:10 +0200 | 
| commit | d23181c138e8f0258641308ffd34370d3b132e8e (patch) | |
| tree | f0e28aa0fed6b3093f091d12260637fbcc551c47 /examples | |
| download | zorglub-d23181c138e8f0258641308ffd34370d3b132e8e.zip zorglub-d23181c138e8f0258641308ffd34370d3b132e8e.tar.gz  | |
initial commit
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/sample.ru | 41 | 
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/sample.ru b/examples/sample.ru new file mode 100644 index 0000000..846bb45 --- /dev/null +++ b/examples/sample.ru @@ -0,0 +1,41 @@ +#! /usr/bin/ruby +# +$LOAD_PATH << File.join(File.dirname( File.absolute_path(__FILE__)), '..', 'lib') +# +require 'zorglub' +# +class Node1 < Zorglub::Node +    # +    def index a1, *a2 +        response.write "<title>Node1</title>" +        response.write "<p>a1 : #{a1.inspect}</p>" +        response.write "<p>a2 : #{a2.inspect}</p>" +        response.finish +    end +    # +end +# +APP = Zorglub::App.new do +    map '/url1', Node1 +end +# +class Node2 < Zorglub::Node +    # +    map APP, '/url2' +    # +    def index a1, *a2 +        response.write "<title>Node2</title>" +        response.write "<p>a1 : #{a1.inspect}</p>" +        response.write "<p>a2 : #{a2.inspect}</p>" +        response.finish +    end +    # +end +# +puts APP.to_hash.inspect +# +map '/' do +    use Rack::ShowExceptions +    run APP +end +#  | 
