wurfl-lite-middleware 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ vendor/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in wurfl-lite-middleware.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,5 @@
1
+ class WURFL
2
+ class Middleware
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'wurfl-lite-middleware/version'
2
+ require 'wurfl-lite'
3
+
4
+ class WURFL
5
+ class Middleware
6
+ def initialize( app )
7
+ @app = app
8
+ @wurfl = ENV.has_key?( 'WURFL_XML' ) ? WURFL.new( ENV[ 'WURFL_XML' ] ) : WURFL.new
9
+ end
10
+ def call( env )
11
+ env['WURFL'] = @wurfl[ env[ 'HTTP_USER_AGENT' ] ]
12
+ @app.call( env )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "wurfl-lite-middleware/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "wurfl-lite-middleware"
7
+ s.version = WURFL::Middleware::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Clive Crous"]
10
+ s.email = ["clive@crous.co.za"]
11
+ s.homepage = "http://www.darkarts.co.za/wurfl-lite-middleware"
12
+ s.summary = %q{A Rack middleware implementation of wurfl-lite}
13
+ s.description = %q{A Rack middleware implementation of wurfl-lite}
14
+
15
+ s.add_dependency "wurfl-lite", ">= 0.0.1"
16
+ s.add_dependency "rack", ">= 1.2.1"
17
+
18
+ s.add_development_dependency "bundler", ">= 1.0.0"
19
+ s.add_development_dependency "rake", ">= 0.8.7"
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.require_paths = ["lib"]
25
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wurfl-lite-middleware
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Clive Crous
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-02-08 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: wurfl-lite
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 0
30
+ - 1
31
+ version: 0.0.1
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rack
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 2
45
+ - 1
46
+ version: 1.2.1
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 1
59
+ - 0
60
+ - 0
61
+ version: 1.0.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rake
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
74
+ - 8
75
+ - 7
76
+ version: 0.8.7
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *id004
80
+ description: A Rack middleware implementation of wurfl-lite
81
+ email:
82
+ - clive@crous.co.za
83
+ executables: []
84
+
85
+ extensions: []
86
+
87
+ extra_rdoc_files: []
88
+
89
+ files:
90
+ - .gitignore
91
+ - Gemfile
92
+ - Rakefile
93
+ - lib/wurfl-lite-middleware.rb
94
+ - lib/wurfl-lite-middleware/version.rb
95
+ - wurfl-lite-middleware.gemspec
96
+ has_rdoc: true
97
+ homepage: http://www.darkarts.co.za/wurfl-lite-middleware
98
+ licenses: []
99
+
100
+ post_install_message:
101
+ rdoc_options: []
102
+
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: -254384017
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ hash: -254384017
120
+ segments:
121
+ - 0
122
+ version: "0"
123
+ requirements: []
124
+
125
+ rubyforge_project:
126
+ rubygems_version: 1.3.7
127
+ signing_key:
128
+ specification_version: 3
129
+ summary: A Rack middleware implementation of wurfl-lite
130
+ test_files: []
131
+