meekish / swxruby

The Ruby Implementation of SWX RPC

This URL has Read+Write access

swxruby / examples / standalone / standalone.rb
60f5761d » Jed Hurt 2008-03-11 Added merb standalone server 1 $:.unshift '/Users/Jed/Development/Libraries/swxruby/lib'
2 require 'swxruby'
3
4 # =================
5 # = Service Class =
6 # =================
7 class SwxServiceClasses::HelloMerb
8 def just_say_the_words
9 'Hello from Merb!'
10 end
11 end
12
13 # ====================
14 # = Merb Application =
15 # ====================
16 Merb::Router.prepare { |r| r.match('/').to(:controller => 'swx_ruby', :action =>'gateway') }
17
18 class SwxRuby < Merb::Controller
19 def gateway
20 send_data(SwxGateway.process(params), :filename => 'data.swf', :type => 'application/swf')
21 end
22 end