i18n-inflector 1.0.0 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +11 -0
- data/ChangeLog +223 -0
- data/Gemfile +6 -1
- data/Manifest.txt +7 -5
- data/{docs/README → README.rdoc} +37 -26
- data/Rakefile +22 -42
- data/ci/i18n-inflector.gemspec +32 -0
- data/docs/COPYING +41 -45
- data/docs/HISTORY +62 -0
- data/docs/LEGAL +3 -3
- data/docs/LGPL-LICENSE +166 -169
- data/docs/TODO +9 -0
- data/lib/i18n-inflector/errors.rb +93 -0
- data/lib/i18n-inflector/inflector.rb +486 -264
- data/lib/i18n-inflector/long_comments.rb +99 -74
- data/lib/i18n-inflector/shortcuts.rb +139 -47
- data/lib/i18n-inflector/version.rb +28 -0
- data/lib/i18n-inflector.rb +7 -2
- data/test/{backend/inflection_test.rb → inflector_test.rb} +64 -13
- data/test/test_helper.rb +1 -3
- data.tar.gz.sig +0 -0
- metadata +102 -29
- metadata.gz.sig +0 -0
- data/README.textile +0 -27
- data/test/all.rb +0 -8
- data/test/run_all.rb +0 -21
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../../lib/', __FILE__)
|
4
|
+
$:.unshift lib unless $:.include?(lib)
|
5
|
+
require 'i18n-inflector/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = I18n::Inflector::NAME
|
9
|
+
s.version = I18n::Inflector::VERSION
|
10
|
+
s.authors = [I18n::Inflector::DEVELOPER]
|
11
|
+
s.email = I18n::Inflector::EMAIL
|
12
|
+
s.homepage = I18n::Inflector::URL
|
13
|
+
s.summary = I18n::Inflector::SUMMARY
|
14
|
+
s.description = I18n::Inflector::DESCRIPTION
|
15
|
+
|
16
|
+
s.files = Dir.glob("{ci,lib,spec,docs}/**/**") + %w(Gemfile .rspec .yardopts README.rdoc LGPL-LICENSE ChangeLog Manifest.txt)
|
17
|
+
s.extra_rdoc_files = ["README.rdoc", "docs/TODO", "docs/HISTORY", "docs/LGPL-LICENSE", "docs/COPYING"]
|
18
|
+
s.rdoc_options = ["--main", "README.rdoc"]
|
19
|
+
s.platform = Gem::Platform::RUBY
|
20
|
+
s.require_path = 'lib'
|
21
|
+
s.rubyforge_project = '[none]'
|
22
|
+
s.required_rubygems_version = '>= 1.3.5'
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
s.add_dependency 'i18n', '>= 0.5.0'
|
26
|
+
s.add_development_dependency 'test_declarative', '>= 0.0.4'
|
27
|
+
s.add_development_dependency 'rspec', '>= 2.3.0'
|
28
|
+
s.add_development_dependency 'yard', '>= 1.0.7'
|
29
|
+
s.add_development_dependency 'hoe-yard', '>= 0.1.2'
|
30
|
+
s.add_development_dependency 'hoe-bundler', '>= 1.0.0'
|
31
|
+
|
32
|
+
end
|
data/docs/COPYING
CHANGED
@@ -1,61 +1,57 @@
|
|
1
|
-
i18n-inflector is copyrighted free software owned by Paweł Wilk
|
2
|
-
(pw@gnu.org). The Owner of this software permits you to
|
3
|
-
redistribute and/or modify the software under either the terms of the LGPL
|
4
|
-
version 3 (see the file {LGPL-LICENSE}[link:docs/LGPL-LICENSE.html]),
|
5
|
-
or the conditions below ("Ruby License"):
|
1
|
+
i18n-inflector is copyrighted free software owned by Paweł Wilk (pw@gnu.org). The Owner of this software permits you to redistribute and/or modify the software under either the terms of the LGPL version 3 (see the file {file:LGPL-LICENSE LGPL-LICENSE}), or the conditions below ("Ruby License").
|
6
2
|
|
7
|
-
|
8
|
-
software without restriction, provided that you retain ALL of the
|
9
|
-
original copyright notices and associated disclaimers.
|
3
|
+
== 1.
|
10
4
|
|
11
|
-
|
12
|
-
|
5
|
+
You may make and give away verbatim copies of the source form of this software without restriction, provided that you retain ALL of the
|
6
|
+
original copyright notices and associated disclaimers.
|
13
7
|
|
14
|
-
|
15
|
-
make them Freely Available, such as by posting said
|
16
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
17
|
-
the author to include your modifications in the software.
|
8
|
+
== 2.
|
18
9
|
|
19
|
-
|
20
|
-
organization.
|
10
|
+
You may modify your copy of the software in any way, provided that you do at least ONE of the following:
|
21
11
|
|
22
|
-
|
23
|
-
|
12
|
+
a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said
|
13
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
14
|
+
the author to include your modifications in the software.
|
24
15
|
|
25
|
-
|
16
|
+
b) use the modified software only within your corporation or
|
17
|
+
organization.
|
26
18
|
|
27
|
-
|
28
|
-
|
19
|
+
c) give non-standard binaries non-standard names, with
|
20
|
+
instructions on where to get the original software distribution.
|
29
21
|
|
30
|
-
|
31
|
-
together with instructions (in a manual page or equivalent)
|
32
|
-
on where to get the original distribution.
|
22
|
+
d) make other distribution arrangements with the Owner.
|
33
23
|
|
34
|
-
|
35
|
-
the software.
|
24
|
+
== 3.
|
36
25
|
|
37
|
-
|
38
|
-
instructions on where to get the original software distribution.
|
26
|
+
You may distribute the software in object code or binary form, provided that you do at least ONE of the following:
|
39
27
|
|
40
|
-
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in a manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
41
31
|
|
42
|
-
|
43
|
-
|
44
|
-
Sections 1, 2, and 3 above. But some files in the distribution
|
45
|
-
are not written by the Owner, so they may be made available to you
|
46
|
-
under different terms.
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
47
34
|
|
48
|
-
|
49
|
-
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
50
37
|
|
51
|
-
|
52
|
-
output from the software do not automatically fall under the
|
53
|
-
copyright of the software, but belong to whoever generated them,
|
54
|
-
and may be sold commercially, and may be aggregated with this
|
55
|
-
software.
|
38
|
+
d) make other distribution arrangements with the Owner.
|
56
39
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
40
|
+
== 4.
|
41
|
+
|
42
|
+
You may modify and include parts of the software into any other software (possibly commercial), provided you comply with the terms in
|
43
|
+
Sections 1, 2, and 3 above. But some files in the distribution are not written by the Owner, so they may be made available to you
|
44
|
+
under different terms.
|
45
|
+
|
46
|
+
For the list of those files and their copying conditions, see the
|
47
|
+
file LEGAL.
|
48
|
+
|
49
|
+
== 5.
|
50
|
+
|
51
|
+
The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the
|
52
|
+
copyright of the software, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this software.
|
53
|
+
|
54
|
+
== 6.
|
55
|
+
|
56
|
+
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.
|
61
57
|
|
data/docs/HISTORY
CHANGED
@@ -1,3 +1,65 @@
|
|
1
|
+
=== 1.0.10 / 2011-01-10
|
2
|
+
|
3
|
+
* major bugfixes
|
4
|
+
|
5
|
+
* Removed cause of infinite loops while initializing translations
|
6
|
+
* Disabled lookup from being used before translations are initialized
|
7
|
+
* Fixed initialization routine (dangerous typo when setting booleans)
|
8
|
+
|
9
|
+
* minor enhancements
|
10
|
+
|
11
|
+
* Switched to lazy loading of inflection data for certain locales
|
12
|
+
|
13
|
+
=== 1.0.8 / 2011-01-08
|
14
|
+
|
15
|
+
* major enhancements
|
16
|
+
|
17
|
+
* Enabled escaping of patterns using @@{pattern} or \@{pattern}
|
18
|
+
|
19
|
+
=== 1.0.7 / 2011-01-07
|
20
|
+
|
21
|
+
* major bugfixes
|
22
|
+
|
23
|
+
* Fixed interpolation when a translated string begins with a pattern
|
24
|
+
|
25
|
+
=== 1.0.6 / 2010-12-30
|
26
|
+
|
27
|
+
* minor enhancements
|
28
|
+
|
29
|
+
* Added API method inflection_kind(token)
|
30
|
+
* Added API method inflection_true_token(token)
|
31
|
+
* Added API method inflected_locale(locale)
|
32
|
+
|
33
|
+
=== 1.0.5 / 2010-12-29
|
34
|
+
|
35
|
+
* major enhancements
|
36
|
+
|
37
|
+
* Compatible with i18n >= 0.4.1
|
38
|
+
|
39
|
+
=== 1.0.4 / 2010-12-27
|
40
|
+
|
41
|
+
* minor enhancements
|
42
|
+
|
43
|
+
* Documentation updated
|
44
|
+
|
45
|
+
=== 1.0.3 / 2010-12-25
|
46
|
+
|
47
|
+
* major enhancements
|
48
|
+
|
49
|
+
* YARD documentation updated with metatags
|
50
|
+
|
51
|
+
* minor enhancements
|
52
|
+
|
53
|
+
* Some changes in accessors for interpolation switches
|
54
|
+
|
55
|
+
=== 1.0.2 / 2010-12-22
|
56
|
+
|
57
|
+
* minor enhancements
|
58
|
+
|
59
|
+
* Switched to YARD documentation
|
60
|
+
* Tests simplified
|
61
|
+
* Depandencies simplified
|
62
|
+
|
1
63
|
=== 1.0.0 / 2010-12-22
|
2
64
|
|
3
65
|
* 1 major enhancement
|
data/docs/LEGAL
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
LEGAL NOTICE INFORMATION
|
2
2
|
------------------------
|
3
3
|
|
4
|
-
i18n-inflector is Copyright (C)
|
4
|
+
i18n-inflector is Copyright (C) 2011 by Paweł Wilk.
|
5
5
|
|
6
6
|
i18n-inflector is copyrighted software owned by Paweł Wilk
|
7
7
|
(pw@gnu.org). You may redistribute and/or modify this
|
8
8
|
software as long as you comply with either the terms of the LGPL
|
9
|
-
(see the file {LGPL-LICENSE}
|
10
|
-
or Ruby's license (see the file {COPYING}
|
9
|
+
(see the file {file:LGPL-LICENSE}),
|
10
|
+
or Ruby's license (see the file {file:COPYING}).
|
11
11
|
|
data/docs/LGPL-LICENSE
CHANGED
@@ -1,169 +1,166 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
Library.
|
168
|
-
|
169
|
-
</tt>
|
1
|
+
|
2
|
+
= GNU LESSER GENERAL PUBLIC LICENSE
|
3
|
+
Version 3, 29 June 2007
|
4
|
+
|
5
|
+
Copyright (C) 2007 Free Software Foundation, Inc. < http://fsf.org/ >
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies
|
7
|
+
of this license document, but changing it is not allowed.
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
=== 0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
=== 1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
=== 2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
=== 3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
=== 4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
=== 5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
=== 6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
166
|
+
|