Sha256: 5ac9b98e8a2620b10926060315e687be006071c357acec0e6c9f09358ce1b4bc

Contents?: true

Size: 560 Bytes

Versions: 7

Compression:

Stored size: 560 Bytes

Contents

require 'sinatra/base'

module FakeSQS
  class WebInterface < Sinatra::Base

    configure do
      use FakeSQS::CatchErrors, response: ErrorResponse
    end

    helpers do

      def action
        params.fetch("Action")
      end

    end

    get "/" do
      200
    end

    delete "/" do
      settings.api.reset
      200
    end

    put "/" do
      settings.api.expire
      200
    end

    post "/" do
      settings.api.call(action, params)
    end

    post "/:queue" do |queue|
      settings.api.call(action, queue, params)
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fake_sqs-0.0.10 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.9 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.8 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.7 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.6 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.5 lib/fake_sqs/web_interface.rb
fake_sqs-0.0.4 lib/fake_sqs/web_interface.rb