Sha256: 2d408d7f8ca3816033c4b595796b920f5af5029dac66c55093ebe81cc684ec49

Contents?: true

Size: 542 Bytes

Versions: 7

Compression:

Stored size: 542 Bytes

Contents

module Fakeit
  module App
    class AppBuilder
      def initialize(spec_file, options)
        @config_route = Routes::ConfigRoute.new(options)
        @openapi_route = Routes::OpenapiRoute.new(spec_file)
      end

      def build
        proc do |env|
          request = Rack::Request.new(env)

          case request.path_info
          when '/__fakeit_config__'
            @config_route.call(request)
          else
            @openapi_route.call(request, @config_route.options)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fakeit-0.9.2 lib/fakeit/app/app_builder.rb
fakeit-0.9.1 lib/fakeit/app/app_builder.rb
fakeit-0.9.0 lib/fakeit/app/app_builder.rb
fakeit-0.8.1 lib/fakeit/app/app_builder.rb
fakeit-0.8.0 lib/fakeit/app/app_builder.rb
fakeit-0.7.1 lib/fakeit/app/app_builder.rb
fakeit-0.7.0 lib/fakeit/app/app_builder.rb