panmind-http_accept_language 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/http_accept_language.rb +10 -6
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/http_accept_language.rb
CHANGED
@@ -80,10 +80,14 @@ module HttpAcceptLanguage
|
|
80
80
|
languages.map {|l| l.to_s.sub(/-\w{2}/, '')}.uniq
|
81
81
|
end
|
82
82
|
end
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
|
84
|
+
# ActionDispatch is for Rails >= 3, Action Controller for Rails < 3
|
85
|
+
# Only the first class that matches gets the module included.
|
86
|
+
if defined? Rails
|
87
|
+
base = defined?(ActionDispatch) ? ActionDispatch : ActionController
|
88
|
+
[:Request, :AbstractRequest, :CgiRequest].each do |c|
|
89
|
+
next unless base.const_defined?(c)
|
90
|
+
base.const_get(c).instance_eval { include HttpAcceptLanguage }
|
91
|
+
break
|
92
|
+
end
|
89
93
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panmind-http_accept_language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Iain Hecker
|