This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Bronson McKinley (author)
Sat Jan 17 19:42:35 -0800 2009
| a8798ed0 » | Jed Hurt | 2008-03-11 | 1 | # = Merb Standalone SWX Ruby Server | |
| 2 | # | ||||
| 3 | # An example of how simple it is to build a standalone SWX Ruby server using Merb. | ||||
| 4 | # | ||||
| 5 | # == Prerequisites | ||||
| 6 | # | ||||
| 7 | # * SWX Ruby Gem (gem install swxruby) | ||||
| 8 | # * merb-core 0.9.1 or later (gem install merb-core) | ||||
| 9 | # | ||||
| 10 | # == Take it for a spin | ||||
| 11 | # | ||||
| 12 | # * Open a terminal in the examples/standalone directory and execute 'merb -I standalone.rb' to fire up the Merb server. | ||||
| 13 | # * Open standalone.fla in Flash 8 or later. | ||||
| 14 | # * Publish Preview (ctrl+enter on Windows; cmd+enter on OS X). | ||||
| 15 | # * Watch as the output panel begins tracing "Hello from Merb!". | ||||
| 16 | require 'rubygems' | ||||
| 60f5761d » | Jed Hurt | 2008-03-11 | 17 | require 'swxruby' | |
| 18 | |||||
| 19 | # ================= | ||||
| 20 | # = Service Class = | ||||
| 21 | # ================= | ||||
| 22 | class SwxServiceClasses::HelloMerb | ||||
| 23 | def just_say_the_words | ||||
| 24 | 'Hello from Merb!' | ||||
| 25 | end | ||||
| 26 | end | ||||
| 27 | |||||
| 28 | # ==================== | ||||
| 29 | # = Merb Application = | ||||
| 30 | # ==================== | ||||
| f5e151f4 » | Jed Hurt | 2008-03-11 | 31 | Merb::Router.prepare { |r| r.match('/').to(:controller => 'swx_ruby_controller', :action =>'gateway') } | |
| 60f5761d » | Jed Hurt | 2008-03-11 | 32 | ||
| f5e151f4 » | Jed Hurt | 2008-03-11 | 33 | class SwxRubyController < Merb::Controller | |
| 60f5761d » | Jed Hurt | 2008-03-11 | 34 | def gateway | |
| 10851c37 » | Bronson McKinley | 2009-01-17 | 35 | send_data(SwxGateway.process(params), :filename => 'data.swf', :type => 'application/swf', :disposition => 'inline') | |
| 60f5761d » | Jed Hurt | 2008-03-11 | 36 | end | |
| 37 | end | ||||







