From: Tom Hughes Date: Mon, 24 May 2010 11:10:46 +0000 (+0100) Subject: Pull in some upstream updates to http_accept_language X-Git-Tag: live~6261^2~5 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/6e7acd171fa81a73d64089a2a3be689921f428d8 Pull in some upstream updates to http_accept_language --- diff --git a/vendor/plugins/http_accept_language/MIT-LICENSE b/vendor/plugins/http_accept_language/MIT-LICENSE deleted file mode 100644 index 8eaf6db4a..000000000 --- a/vendor/plugins/http_accept_language/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2008 [name of plugin creator] - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/plugins/http_accept_language/README.rdoc b/vendor/plugins/http_accept_language/README.rdoc index 3eff7d9b3..e644183ae 100644 --- a/vendor/plugins/http_accept_language/README.rdoc +++ b/vendor/plugins/http_accept_language/README.rdoc @@ -2,7 +2,7 @@ A small effort in making a plugin which helps you detect the users preferred language, as sent by the HTTP header. -= Features +== Features * Splits the http-header into languages specified by the user * Returns empty array if header is illformed. @@ -12,7 +12,7 @@ A small effort in making a plugin which helps you detect the users preferred lan * Gives compatible languages See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html -= Example +== Example class SomeController < ApplicationController def some_action @@ -24,7 +24,7 @@ See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html request.preferred_language_from(available) # => 'nl-BE' - request.user_preferred_language + request.user_preferred_languages # => [ 'en-GB'] available = %w{en-US} request.compatible_language_from(available) @@ -32,8 +32,13 @@ See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html end end -= Changenotes +== Installation + +Install the gem http_accept_language, require it in your Rails app. + +== Changelog -2009-03-12: Rails 2.3 compatible +* 2010-01-05: Gem release +* 2009-03-12: Rails 2.3 compatible -Copyright (c) 2008 Iain Hecker, released under the MIT license +Copyright (c) 2008-2010 Iain Hecker, released under the MIT license diff --git a/vendor/plugins/http_accept_language/Rakefile b/vendor/plugins/http_accept_language/Rakefile index c764e2be4..6c5a4f57a 100644 --- a/vendor/plugins/http_accept_language/Rakefile +++ b/vendor/plugins/http_accept_language/Rakefile @@ -1,10 +1,21 @@ require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' -desc 'Default: run unit tests.' -task :default => :test +begin + require 'jeweler' + Jeweler::Tasks.new do |gem| + gem.name = "http_accept_language" + gem.summary = %Q{Parse the HTTP Accept Language Header} + gem.description = %Q{Find out which locale the user preferes by reading the languages they specified in their browser} + gem.email = "iain@iain.nl" + gem.homepage = "http://github.com/iain/http_accept_language" + gem.authors = ["Iain Hecker"] + end + Jeweler::GemcutterTasks.new +rescue LoadError + puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" +end +require 'rake/testtask' desc 'Test the http_accept_language plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' @@ -12,6 +23,10 @@ Rake::TestTask.new(:test) do |t| t.verbose = true end +desc 'Default: run unit tests.' +task :default => :test + +require 'rake/rdoctask' desc 'Generate documentation for the http_accept_language plugin.' Rake::RDocTask.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' diff --git a/vendor/plugins/http_accept_language/VERSION b/vendor/plugins/http_accept_language/VERSION new file mode 100644 index 000000000..7dea76edb --- /dev/null +++ b/vendor/plugins/http_accept_language/VERSION @@ -0,0 +1 @@ +1.0.1 diff --git a/vendor/plugins/http_accept_language/tasks/http_accept_language_tasks.rake b/vendor/plugins/http_accept_language/tasks/http_accept_language_tasks.rake deleted file mode 100644 index cfa447609..000000000 --- a/vendor/plugins/http_accept_language/tasks/http_accept_language_tasks.rake +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :http_accept_language do -# # Task goes here -# end