Sha256: 7d395e8892c634a14f723d1d276dab45e591f6ba19fcdad521ab0927c1c56295

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents


module Magpie

  BIRD_APP = Rack::Builder.new {

    use Rack::ContentType, "text/xml"
    use Rack::ContentLength

    map "/alipay" do
      use Alipay
      run lambda{ |env| [200, {}, [""]]}
    end

    map "/chinabank" do
      use Chinabank
      run lambda { |env| [200, {}, [""]]}
    end

    map "/tenpay" do
      use Tenpay
      run lambda { |env| [200, {}, [""]]}
    end

  }

  SNAKE_APP = Rack::Builder.new {

    use Rack::ContentType, "text/html"
    use Rack::ContentLength
    use Rack::Static, :urls => ["/images"], :root => File.join(Dir.pwd, "..", "static")

    use Snake do |snake|
      snake.tongue :alipay,    :states => :index
      snake.tongue :chinabank, :states => :index, :actions => :index
      snake.tongue :tenpay,    :states => :index, :actions => :index
      snake.tongue :order,     :actions => :pay
    end

    run lambda { |env| [200, { }, [""]]}
  }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magpie-0.8.8 lib/apps.rb