Permalink
Browse files

Add license info for i18n and gettext gems.

  • Loading branch information...
1 parent b724798 commit f4c9419adbbd44b3a68ef78b9aca31117c037045 @KL-7 KL-7 committed Apr 22, 2012
Showing with 109 additions and 1 deletion.
  1. +95 −1 NOTICE
  2. +8 −0 lib/interpolation.rb
  3. +6 −0 spec/interpolation_spec.rb
View
96 NOTICE
@@ -1,6 +1,7 @@
-twitter-cldr-rb is a Ruby implementation of the Common Locale Data Repository
+twitter-cldr-rb is a Ruby implementation of the Common Locale Data Repository
Copyright (C) 2012 Twitter, Inc.
+
Portions of this gem were borrowed from Sven Fuchs' ruby-cldr gem. Here is
the license that accompanied Mr. Fuchs' code:
@@ -24,3 +25,96 @@ 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.
+
+
+Backporting of String interpolation from Ruby 1.9 to Ruby 1.8 implemented in
+this gem (see file interpolation.rb) was partially copied and heavily based
+on the implementation of i18n and gettext gems. Below are the license agreements
+that accompanied these gems.
+
+License agreement of the i18n gem (https://github.com/svenfuchs/i18n):
+
+Copyright (c) 2008 The Ruby I18n team
+
+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.
+
+License of the gettext gem (https://github.com/mutoh/gettext):
+
+Copyright (C) 2005-2009 Masao Mutoh
+
+You may redistribute it [the code] and/or modify it under the same license
+terms as Ruby or LGPL [http://www.gnu.org/licenses/lgpl-3.0.txt].
+
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
+You can redistribute it and/or modify it under either the terms of the GPL
+version 2 (see the file GPL), or the conditions below:
+
+ 1. You may make and give away verbatim copies of the source form of the
+ software without restriction, provided that you duplicate all of the
+ original copyright notices and associated disclaimers.
+
+ 2. You may modify your copy of the software in any way, provided that
+ you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise
+ make them Freely Available, such as by posting said
+modifications to Usenet or an equivalent medium, or by allowing
+the author to include your modifications in the software.
+
+ b) use the modified software only within your corporation or
+ organization.
+
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
+
+ d) make other distribution arrangements with the author.
+
+ 3. You may distribute the software in object code or binary form,
+ provided that you do at least ONE of the following:
+
+ a) distribute the binaries and library files of the software,
+together with instructions (in the manual page or equivalent)
+on where to get the original distribution.
+
+ b) accompany the distribution with the machine-readable source of
+the software.
+
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
+
+ d) make other distribution arrangements with the author.
+
+ 4. You may modify and include the part of the software into any other
+ software (possibly commercial). But some files in the distribution
+ are not written by the author, so that they are not under these terms.
+
+ For the list of those files and their copying conditions, see the
+ file LEGAL.
+
+ 5. The scripts and library files supplied as input to or produced as
+ output from the software do not automatically fall under the
+ copyright of the software, but belong to whomever generated them,
+ and may be sold commercially, and may be aggregated with this
+ software.
+
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE.
View
8 lib/interpolation.rb
@@ -1,5 +1,13 @@
# encoding: UTF-8
+# The implementation of the TwitterCldr.interpolate method that backports String interpolation capabilities
+# (originally implemented in String#% method) from Ruby 1.9 to Ruby 1.8 is heavily influenced by the
+# implementation of the same feature in i18n (https://github.com/svenfuchs/i18n/blob/89ea337f48562370988421e50caa7c2fe89452c7/lib/i18n/core_ext/string/interpolate.rb)
+# and gettext (https://github.com/mutoh/gettext/blob/11b8c1525ba9f00afb1942f7ebf34bec12f7558b/lib/gettext/core_ext/string.rb) gems.
+#
+# See NOTICE file for corresponding license agreements.
+
+
# KeyError is raised during interpolation when there is a placeholder that doesn't have corresponding key in the
# interpolation hash. KeyError is defined in 1.9. We define it for prior versions of Ruby to have the same behavior.
class KeyError < IndexError
View
6 spec/interpolation_spec.rb
@@ -1,5 +1,11 @@
# encoding: UTF-8
+# Some test cases were taken from i18n (https://github.com/svenfuchs/i18n/blob/89ea337f48562370988421e50caa7c2fe89452c7/test/core_ext/string/interpolate_test.rb)
+# and gettext (https://github.com/mutoh/gettext/blob/11b8c1525ba9f00afb1942f7ebf34bec12f7558b/test/test_string.rb) gems.
+#
+# See NOTICE file for corresponding license agreements.
+
+
require 'spec_helper'
describe TwitterCldr do

0 comments on commit f4c9419

Please sign in to comment.