Sha256: 3132a0109577f0df872c0d3342a806859eab3ec79383a84f2b820d5f17a85eec

Contents?: true

Size: 350 Bytes

Versions: 5

Compression:

Stored size: 350 Bytes

Contents

require 'wurfl-lite-middleware/version'
require 'wurfl-lite'

class WURFL
  class Middleware
    def initialize( app )
      @app = app
      @wurfl = ENV.has_key?( 'WURFL_XML' ) ? WURFL.new( ENV[ 'WURFL_XML' ] ) : WURFL.new
    end
    def call( env )
      env['WURFL'] = @wurfl[ env[ 'HTTP_USER_AGENT' ] ]
      @app.call( env )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wurfl-lite-middleware-1.0.3 lib/wurfl-lite-middleware.rb
wurfl-lite-middleware-1.0.2 lib/wurfl-lite-middleware.rb
wurfl-lite-middleware-1.0.1 lib/wurfl-lite-middleware.rb
wurfl-lite-middleware-1.0.0 lib/wurfl-lite-middleware.rb
wurfl-lite-middleware-0.0.1 lib/wurfl-lite-middleware.rb