Sha256: df8e18951d897a6bb09d3003d4c6692d5bfb68d7e0b173075f928250bd5a0d35

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

require 'sinatra/base'
require 'sinatra/handler_options_patch'
require 'haml'
require 'sinatra/flash'
require 'sinatra/partials'
require 'rest-assured/config'
require 'rest-assured/models/double'
require 'rest-assured/models/redirect'
require 'rest-assured/models/request'
require 'rest-assured/routes/double'
require 'rest-assured/routes/redirect'
require 'rest-assured/routes/response'

module RestAssured
  class Application < Sinatra::Base

    include Config

    enable :method_override

    enable :sessions
    register Sinatra::Flash

    set :public_folder, File.expand_path('../../../public', __FILE__)
    set :views, File.expand_path('../../../views', __FILE__)
    set :haml, :format => :html5

    helpers Sinatra::Partials

    helpers do
      def browser?
        request.user_agent =~ /Safari|Firefox|Opera|MSIE|Chrome/
      end
    end

    include DoubleRoutes
    include RedirectRoutes

    %w{get post put delete}.each do |verb|
      send verb, /.*/ do
        Response.perform(self)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rest-assured-1.1.10 lib/rest-assured/application.rb
rest-assured-1.1.9 lib/rest-assured/application.rb
rest-assured-1.1.8 lib/rest-assured/application.rb
rest-assured-1.1.7 lib/rest-assured/application.rb
rest-assured-1.1.6 lib/rest-assured/application.rb
rest-assured-1.1.5 lib/rest-assured/application.rb
rest-assured-1.1.4 lib/rest-assured/application.rb
rest-assured-1.1.3 lib/rest-assured/application.rb
rest-assured-1.1.2 lib/rest-assured/application.rb
rest-assured-1.1.1 lib/rest-assured/application.rb
rest-assured-1.1.0 lib/rest-assured/application.rb
rest-assured-1.0.0 lib/rest-assured/application.rb
rest-assured-1.0.0.rc2 lib/rest-assured/application.rb
rest-assured-1.0.0.rc1 lib/rest-assured/application.rb