iso 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,13 +1,12 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
2
 
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
3
+ gem "i18n"
4
+
8
5
  group :development do
9
6
  gem "rspec", "~> 2.8.0"
10
7
  gem "rdoc", "~> 3.12"
11
8
  gem "bundler", "~> 1.2.0"
12
9
  gem "jeweler", "~> 1.8.4"
10
+ gem "guard-rspec"
11
+ gem "localeapp"
13
12
  end
data/Gemfile.lock CHANGED
@@ -2,16 +2,42 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  diff-lcs (1.1.3)
5
+ ffi (1.1.5)
5
6
  git (1.2.5)
7
+ gli (2.0.0)
8
+ guard (1.3.2)
9
+ listen (>= 0.4.2)
10
+ thor (>= 0.14.6)
11
+ guard-rspec (1.2.1)
12
+ guard (>= 1.1)
13
+ i18n (0.6.0)
6
14
  jeweler (1.8.4)
7
15
  bundler (~> 1.0)
8
16
  git (>= 1.2.5)
9
17
  rake
10
18
  rdoc
11
19
  json (1.7.5)
20
+ listen (0.4.7)
21
+ rb-fchange (~> 0.0.5)
22
+ rb-fsevent (~> 0.9.1)
23
+ rb-inotify (~> 0.8.8)
24
+ localeapp (0.5.1)
25
+ gli
26
+ i18n
27
+ json
28
+ rest-client
29
+ ya2yaml
30
+ mime-types (1.19)
12
31
  rake (0.9.2.2)
32
+ rb-fchange (0.0.5)
33
+ ffi
34
+ rb-fsevent (0.9.1)
35
+ rb-inotify (0.8.8)
36
+ ffi (>= 0.5.0)
13
37
  rdoc (3.12)
14
38
  json (~> 1.4)
39
+ rest-client (1.6.7)
40
+ mime-types (>= 1.16)
15
41
  rspec (2.8.0)
16
42
  rspec-core (~> 2.8.0)
17
43
  rspec-expectations (~> 2.8.0)
@@ -20,12 +46,17 @@ GEM
20
46
  rspec-expectations (2.8.0)
21
47
  diff-lcs (~> 1.1.2)
22
48
  rspec-mocks (2.8.0)
49
+ thor (0.16.0)
50
+ ya2yaml (0.31)
23
51
 
24
52
  PLATFORMS
25
53
  ruby
26
54
 
27
55
  DEPENDENCIES
28
56
  bundler (~> 1.2.0)
57
+ guard-rspec
58
+ i18n
29
59
  jeweler (~> 1.8.4)
60
+ localeapp
30
61
  rdoc (~> 3.12)
31
62
  rspec (~> 2.8.0)
data/Guardfile ADDED
@@ -0,0 +1,24 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :version => 2 do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+
9
+ # Rails example
10
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
+ watch('config/routes.rb') { "spec/routing" }
15
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+
17
+ # Capybara request specs
18
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
19
+
20
+ # Turnip features and steps
21
+ watch(%r{^spec/acceptance/(.+)\.feature$})
22
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
23
+ end
24
+
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # iso
2
+
3
+ This project is a subset implementation of the ISO spec.
4
+
5
+ Currently only the language and region subtags are supported - there is no plan to implement the others.
6
+
7
+ ## Languages
8
+
9
+ Languages are defined by **ISO 639-1 alpha-2**; that is the 2 letter lowercase language code.
10
+
11
+ These have been augmented to contain the plural rule names and the language's direction.
12
+
13
+ > ISO::Language.find('ru')
14
+
15
+ => #<ISO::Language:0x007fe2ba43db50
16
+ @plural_rule_names=["one", "few", "many", "other"],
17
+ @direction="ltr",
18
+ @code="ru",
19
+ @name="Russian">
20
+
21
+ ## Regions
22
+
23
+ Regions are defined by **ISO 3166-1**; that is the 2 letter uppercase region code.
24
+
25
+ > ISO::Region.find('MX')
26
+
27
+ => #<ISO::Region:0x007fe2ba070e50
28
+ @code="MX",
29
+ @name="Mexico">
30
+
31
+ ## Tags
32
+
33
+ The combination of a language and a region is called a Tag ::
34
+
35
+ > ISO::Tag.new('pt-BR')
36
+
37
+ => #<ISO::Tag:0x007fe2bb005b90 @code="pt-BR",
38
+ @language=#<ISO::Language:0x007fe2ba256918
39
+ @plural_rule_names=["one", "other"],
40
+ @direction="ltr",
41
+ @code="pt",
42
+ @name="Portuguese">,
43
+ @region=#<ISO::Region:0x007fe2ba412e28
44
+ @code="BR",
45
+ @name="Brazil">>
46
+
47
+ ## Contributing to iso
48
+
49
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
50
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
51
+ * Fork the project.
52
+ * Start a feature/bugfix branch.
53
+ * Commit and push until you are happy with your contribution.
54
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
55
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
56
+
57
+ #### Copyright
58
+
59
+ Copyright (c) 2012 Christopher Dell. See LICENSE.txt for further details.
60
+
data/Rakefile CHANGED
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
17
17
  gem.name = "iso"
18
18
  gem.homepage = "http://github.com/tigrish/iso"
19
19
  gem.license = "MIT"
20
- gem.summary = %Q{A ruby implementation of ISO languages and regions and they're translation data.}
21
- gem.description = %Q{A ruby implementation of ISO languages and regions and they're translation data (such as language direction, pluralization rules).}
20
+ gem.summary = %Q{A ruby implementation of ISO}
21
+ gem.description = %Q{A subset of the ISO spec implemented in ruby}
22
22
  gem.email = "chris@tigrish.com"
23
23
  gem.authors = ["Christopher Dell"]
24
24
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -0,0 +1,246 @@
1
+ AD:
2
+ AE:
3
+ AF:
4
+ AG:
5
+ AI:
6
+ AL:
7
+ AM:
8
+ AN:
9
+ AO:
10
+ AQ:
11
+ AR:
12
+ AS:
13
+ AT:
14
+ AU:
15
+ AW:
16
+ AX:
17
+ AZ:
18
+ BA:
19
+ BB:
20
+ BD:
21
+ BE:
22
+ BF:
23
+ BG:
24
+ BH:
25
+ BI:
26
+ BJ:
27
+ BL:
28
+ BM:
29
+ BN:
30
+ BO:
31
+ BR:
32
+ BS:
33
+ BT:
34
+ BV:
35
+ BW:
36
+ BY:
37
+ BZ:
38
+ CA:
39
+ CC:
40
+ CD:
41
+ CF:
42
+ CG:
43
+ CH:
44
+ CI:
45
+ CK:
46
+ CL:
47
+ CM:
48
+ CN:
49
+ CO:
50
+ CR:
51
+ CU:
52
+ CV:
53
+ CX:
54
+ CY:
55
+ CZ:
56
+ DE:
57
+ DJ:
58
+ DK:
59
+ DM:
60
+ DO:
61
+ DZ:
62
+ EC:
63
+ EE:
64
+ EG:
65
+ EH:
66
+ ER:
67
+ ES:
68
+ ET:
69
+ FI:
70
+ FJ:
71
+ FK:
72
+ FM:
73
+ FO:
74
+ FR:
75
+ GA:
76
+ GB:
77
+ GD:
78
+ GE:
79
+ GF:
80
+ GG:
81
+ GH:
82
+ GI:
83
+ GL:
84
+ GM:
85
+ GN:
86
+ GP:
87
+ GQ:
88
+ GR:
89
+ GS:
90
+ GT:
91
+ GU:
92
+ GW:
93
+ GY:
94
+ HK:
95
+ HM:
96
+ HN:
97
+ HR:
98
+ HT:
99
+ HU:
100
+ ID:
101
+ IE:
102
+ IL:
103
+ IM:
104
+ IN:
105
+ IO:
106
+ IQ:
107
+ IR:
108
+ IS:
109
+ IT:
110
+ JE:
111
+ JM:
112
+ JO:
113
+ JP:
114
+ KE:
115
+ KG:
116
+ KH:
117
+ KI:
118
+ KM:
119
+ KN:
120
+ KP:
121
+ KR:
122
+ KW:
123
+ KY:
124
+ KZ:
125
+ LA:
126
+ LB:
127
+ LC:
128
+ LI:
129
+ LK:
130
+ LR:
131
+ LS:
132
+ LT:
133
+ LU:
134
+ LV:
135
+ LY:
136
+ MA:
137
+ MC:
138
+ MD:
139
+ ME:
140
+ MF:
141
+ MG:
142
+ MH:
143
+ MK:
144
+ ML:
145
+ MM:
146
+ MN:
147
+ MO:
148
+ MP:
149
+ MQ:
150
+ MR:
151
+ MS:
152
+ MT:
153
+ MU:
154
+ MV:
155
+ MW:
156
+ MX:
157
+ MY:
158
+ MZ:
159
+ NA:
160
+ NC:
161
+ NE:
162
+ NF:
163
+ NG:
164
+ NI:
165
+ NL:
166
+ 'NO':
167
+ NP:
168
+ NR:
169
+ NU:
170
+ NZ:
171
+ OM:
172
+ PA:
173
+ PE:
174
+ PF:
175
+ PG:
176
+ PH:
177
+ PK:
178
+ PL:
179
+ PM:
180
+ PN:
181
+ PR:
182
+ PS:
183
+ PT:
184
+ PW:
185
+ PY:
186
+ QA:
187
+ RE:
188
+ RO:
189
+ RS:
190
+ RU:
191
+ RW:
192
+ SA:
193
+ SB:
194
+ SC:
195
+ SD:
196
+ SE:
197
+ SG:
198
+ SH:
199
+ SI:
200
+ SJ:
201
+ SK:
202
+ SL:
203
+ SM:
204
+ SN:
205
+ SO:
206
+ SR:
207
+ ST:
208
+ SV:
209
+ SY:
210
+ SZ:
211
+ TC:
212
+ TD:
213
+ TF:
214
+ TG:
215
+ TH:
216
+ TJ:
217
+ TK:
218
+ TL:
219
+ TM:
220
+ TN:
221
+ TO:
222
+ TR:
223
+ TT:
224
+ TV:
225
+ TW:
226
+ TZ:
227
+ UA:
228
+ UG:
229
+ UM:
230
+ US:
231
+ UY:
232
+ UZ:
233
+ VA:
234
+ VC:
235
+ VE:
236
+ VG:
237
+ VI:
238
+ VN:
239
+ VU:
240
+ WF:
241
+ WS:
242
+ YE:
243
+ YT:
244
+ ZA:
245
+ ZM:
246
+ ZW:
@@ -0,0 +1,296 @@
1
+ aa:
2
+ ab:
3
+ ae:
4
+ af:
5
+ ak:
6
+ am:
7
+ an:
8
+ ar:
9
+ direction: rtl
10
+ plural_rule_names:
11
+ - zero
12
+ - one
13
+ - two
14
+ - few
15
+ - many
16
+ - other
17
+ as:
18
+ av:
19
+ ay:
20
+ az:
21
+ plural_rule_names:
22
+ - other
23
+ ba:
24
+ be:
25
+ bg:
26
+ bh:
27
+ bi:
28
+ bm:
29
+ bn:
30
+ bo:
31
+ br:
32
+ bs:
33
+ plural_rule_names:
34
+ - one
35
+ - few
36
+ - many
37
+ - other
38
+ ca:
39
+ ce:
40
+ ch:
41
+ co:
42
+ cr:
43
+ cs:
44
+ plural_rule_names:
45
+ - one
46
+ - few
47
+ - other
48
+ cu:
49
+ cv:
50
+ cy:
51
+ plural_rule_names:
52
+ - one
53
+ - two
54
+ - many
55
+ - other
56
+ da:
57
+ de:
58
+ dv:
59
+ dz:
60
+ ee:
61
+ el:
62
+ en:
63
+ eo:
64
+ es:
65
+ et:
66
+ eu:
67
+ fa:
68
+ direction: rtl
69
+ plural_rule_names:
70
+ - other
71
+ ff:
72
+ fi:
73
+ fj:
74
+ fo:
75
+ fr:
76
+ fy:
77
+ ga:
78
+ gd:
79
+ gl:
80
+ gn:
81
+ gu:
82
+ gv:
83
+ ha:
84
+ he:
85
+ direction: rtl
86
+ hi:
87
+ ho:
88
+ hr:
89
+ plural_rule_names:
90
+ - one
91
+ - few
92
+ - many
93
+ - other
94
+ ht:
95
+ hu:
96
+ plural_rule_names:
97
+ - other
98
+ hy:
99
+ hz:
100
+ ia:
101
+ id:
102
+ plural_rule_names:
103
+ - other
104
+ ie:
105
+ ig:
106
+ ii:
107
+ ik:
108
+ io:
109
+ is:
110
+ it:
111
+ iu:
112
+ ja:
113
+ plural_rule_names:
114
+ - other
115
+ jv:
116
+ ka:
117
+ kg:
118
+ ki:
119
+ kj:
120
+ kk:
121
+ kl:
122
+ km:
123
+ kn:
124
+ plural_rule_names:
125
+ - other
126
+ ko:
127
+ plural_rule_names:
128
+ - other
129
+ kr:
130
+ ks:
131
+ ku:
132
+ kv:
133
+ kw:
134
+ ky:
135
+ la:
136
+ lb:
137
+ lg:
138
+ li:
139
+ ln:
140
+ lo:
141
+ plural_rule_names:
142
+ - zero
143
+ - one
144
+ - two
145
+ - few
146
+ - many
147
+ - other
148
+ lt:
149
+ plural_rule_names:
150
+ - one
151
+ - few
152
+ - other
153
+ lu:
154
+ lv:
155
+ plural_rule_names:
156
+ - zero
157
+ - one
158
+ - other
159
+ mg:
160
+ mh:
161
+ mi:
162
+ mk:
163
+ ml:
164
+ mn:
165
+ mr:
166
+ ms:
167
+ ms:
168
+ mt:
169
+ my:
170
+ plural_rule_names:
171
+ - one
172
+ - few
173
+ - other
174
+ - other
175
+ na:
176
+ nb:
177
+ nd:
178
+ ne:
179
+ ng:
180
+ nl:
181
+ nn:
182
+ no:
183
+ nr:
184
+ nv:
185
+ ny:
186
+ oc:
187
+ oj:
188
+ om:
189
+ or:
190
+ os:
191
+ pa:
192
+ pi:
193
+ pl:
194
+ plural_rule_names:
195
+ - one
196
+ - few
197
+ - other
198
+ ps:
199
+ pt:
200
+ qu:
201
+ rm:
202
+ plural_rule_names:
203
+ - zero
204
+ - one
205
+ - two
206
+ - few
207
+ - many
208
+ - other
209
+ rn:
210
+ ro:
211
+ plural_rule_names:
212
+ - one
213
+ - few
214
+ - other
215
+ ru:
216
+ plural_rule_names:
217
+ - one
218
+ - few
219
+ - many
220
+ - other
221
+ rw:
222
+ sa:
223
+ sc:
224
+ sd:
225
+ se:
226
+ sg:
227
+ si:
228
+ sk:
229
+ plural_rule_names:
230
+ - one
231
+ - few
232
+ - other
233
+ sl:
234
+ plural_rule_names:
235
+ - one
236
+ - two
237
+ - few
238
+ - other
239
+ sm:
240
+ sn:
241
+ so:
242
+ sq:
243
+ sr:
244
+ plural_rule_names:
245
+ - one
246
+ - few
247
+ - many
248
+ - other
249
+ ss:
250
+ st:
251
+ su:
252
+ sv:
253
+ sw:
254
+ ta:
255
+ te:
256
+ tg:
257
+ th:
258
+ plural_rule_names:
259
+ - other
260
+ ti:
261
+ tk:
262
+ tl:
263
+ tn:
264
+ to:
265
+ tr:
266
+ plural_rule_names:
267
+ - other
268
+ ts:
269
+ tt:
270
+ tw:
271
+ ty:
272
+ ug:
273
+ uk:
274
+ plural_rule_names:
275
+ - one
276
+ - few
277
+ - many
278
+ - other
279
+ ur:
280
+ direction: rtl
281
+ uz:
282
+ ve:
283
+ vo:
284
+ vi:
285
+ plural_rule_names:
286
+ - other
287
+ wa:
288
+ wo:
289
+ xh:
290
+ yi:
291
+ yo:
292
+ za:
293
+ zh:
294
+ plural_rule_names:
295
+ - other
296
+ zu: