babosa 0.3.9 → 0.3.10
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/README.md +24 -26
- data/lib/babosa/transliterator/macedonian.rb +2 -2
- data/lib/babosa/utf8/java_proxy.rb +0 -2
- data/lib/babosa/version.rb +1 -1
- metadata +31 -15
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Babosa
|
|
2
2
|
|
|
3
|
+
[](https://travis-ci.org/norman/babosa)
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
Babosa is a library for creating human-friendly identifiers, aka "slugs". It can
|
|
4
7
|
also be useful for normalizing and sanitizing data.
|
|
5
8
|
|
|
@@ -34,7 +37,6 @@ Currently supported languages include:
|
|
|
34
37
|
* Swedish
|
|
35
38
|
* Ukrainian
|
|
36
39
|
|
|
37
|
-
|
|
38
40
|
I'll gladly accept contributions from fluent speakers to support more languages.
|
|
39
41
|
|
|
40
42
|
### Strip non-ASCII characters
|
|
@@ -84,7 +86,7 @@ It will automatically use whatever Unicode library you have loaded before
|
|
|
84
86
|
Babosa, or fall back to a simple built-in library. Supported
|
|
85
87
|
Unicode libraries include:
|
|
86
88
|
|
|
87
|
-
* Java (only JRuby of course)
|
|
89
|
+
* Java (only on JRuby of course)
|
|
88
90
|
* Active Support
|
|
89
91
|
* [Unicode](https://github.com/blackwinter/unicode)
|
|
90
92
|
* Built-in
|
|
@@ -152,24 +154,24 @@ And a spec (you can use this as a template):
|
|
|
152
154
|
end
|
|
153
155
|
|
|
154
156
|
|
|
155
|
-
### Rails 3
|
|
157
|
+
### Rails 3.x and higher
|
|
156
158
|
|
|
157
|
-
Some of Babosa's functionality was added to Active Support 3.
|
|
159
|
+
Some of Babosa's functionality was added to Active Support 3.0.0.
|
|
158
160
|
|
|
159
161
|
Babosa now differs from ActiveSupport primarily in that it supports non-Latin
|
|
160
162
|
strings by default, and has per-locale ASCII transliterations already baked-in.
|
|
161
|
-
If you are considering using Babosa with Rails
|
|
163
|
+
If you are considering using Babosa with Rails, you may want to first take a
|
|
162
164
|
look at Active Support's
|
|
163
|
-
[transliterate](http://
|
|
165
|
+
[transliterate](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-transliterate)
|
|
164
166
|
and
|
|
165
|
-
[parameterize](http://
|
|
167
|
+
[parameterize](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-parameterize)
|
|
166
168
|
to see if they suit your needs.
|
|
167
169
|
|
|
168
170
|
### Babosa vs. Stringex
|
|
169
171
|
|
|
170
172
|
Babosa provides much of the functionality provided by the
|
|
171
173
|
[Stringex](https://github.com/rsl/stringex) gem, but in the subjective opinion
|
|
172
|
-
of the author, is for most use cases a
|
|
174
|
+
of the author, is for most use cases a better choice.
|
|
173
175
|
|
|
174
176
|
#### Fewer Features
|
|
175
177
|
|
|
@@ -180,15 +182,9 @@ addition to string processing. Babosa only does string processing.
|
|
|
180
182
|
#### Less Aggressive Unicode Transliteration
|
|
181
183
|
|
|
182
184
|
Stringex uses an agressive Unicode to ASCII mapping which outputs gibberish for
|
|
183
|
-
almost anything but Western European langages
|
|
184
|
-
for which fluent speakers have provided
|
|
185
|
-
output makes sense to users.
|
|
186
|
-
|
|
187
|
-
#### Better Locale Support
|
|
188
|
-
|
|
189
|
-
Recent versions of Stringex support locale-specific transliterations, but
|
|
190
|
-
include no built-in support for any languages. Babosa works out of the box for
|
|
191
|
-
most European languages and is easy to extend if your language is not supported.
|
|
185
|
+
almost anything but Western European langages and Mandarin Chinese. Babosa
|
|
186
|
+
supports only languages for which fluent speakers have provided
|
|
187
|
+
transliterations, to ensure that the output makes sense to users.
|
|
192
188
|
|
|
193
189
|
#### Unicode Support
|
|
194
190
|
|
|
@@ -203,15 +199,15 @@ offer transliterations like this out of the box:
|
|
|
203
199
|
|
|
204
200
|
"$12 worth of Ruby power".to_url => "12-dollars-worth-of-ruby-power"
|
|
205
201
|
|
|
206
|
-
This is because the symbol "$" is used
|
|
202
|
+
This is because the symbol "$" is used in many Latin American countries for the
|
|
207
203
|
peso. Stringex does this in many places, for example, transliterating all Han
|
|
208
204
|
characters into Pinyin, effectively treating Japanese text as if it were
|
|
209
|
-
Chinese.
|
|
205
|
+
Mandarin Chinese.
|
|
210
206
|
|
|
211
207
|
|
|
212
208
|
### More info
|
|
213
209
|
|
|
214
|
-
Please see the [API docs](http://
|
|
210
|
+
Please see the [API docs](http://rubydoc.info/github/norman/babosa/master/frames) and source code for
|
|
215
211
|
more info.
|
|
216
212
|
|
|
217
213
|
## Getting it
|
|
@@ -222,7 +218,7 @@ Babosa can be installed via Rubygems:
|
|
|
222
218
|
|
|
223
219
|
You can get the source code from its [Github repository](http://github.com/norman/babosa).
|
|
224
220
|
|
|
225
|
-
Babosa is tested to be compatible with Ruby 1.8.
|
|
221
|
+
Babosa is tested to be compatible with Ruby 1.8.7-2.0.0, JRuby 1.4+, and
|
|
226
222
|
Rubinius 1.0+ It's probably compatible with other Rubies as well.
|
|
227
223
|
|
|
228
224
|
## Reporting bugs
|
|
@@ -243,12 +239,13 @@ tracker](http://github.com/norman/babosa/issues).
|
|
|
243
239
|
|
|
244
240
|
Many thanks to the following people for their help:
|
|
245
241
|
|
|
242
|
+
* [Martins Zakis](https://github.com/martins) - Bug fixes
|
|
246
243
|
* [Vassilis Rodokanakis](https://github.com/vrodokanakis) - Greek support
|
|
247
244
|
* [Peco Danajlovski](https://github.com/Vortex) - Macedonian support
|
|
248
|
-
* [Philip Arndt](https://github.com/parndt) -
|
|
245
|
+
* [Philip Arndt](https://github.com/parndt) - Bug fixes
|
|
249
246
|
* [Jonas Forsberg](https://github.com/himynameisjonas) - Swedish support
|
|
250
247
|
* [Jaroslav Kalistsuk](https://github.com/jarosan) - Greek support
|
|
251
|
-
* [Steven Heidel](https://github.com/stevenheidel) -
|
|
248
|
+
* [Steven Heidel](https://github.com/stevenheidel) - Bug fixes
|
|
252
249
|
* [Edgars Beigarts](https://github.com/ebeigarts) - Support for multiple transliterators
|
|
253
250
|
* [Tiberiu C. Turbureanu](https://gitorious.org/~tct) - Romanian support
|
|
254
251
|
* [Kim Joar Bekkelund](https://github.com/kjbekkelund) - Norwegian support
|
|
@@ -260,7 +257,8 @@ Many thanks to the following people for their help:
|
|
|
260
257
|
|
|
261
258
|
## Changelog
|
|
262
259
|
|
|
263
|
-
* 0.3.
|
|
260
|
+
* 0.3.10 - Fixed Macedonian "S/S". Don't `include JRuby` unnecessarily.
|
|
261
|
+
* 0.3.9 - Added missing Greek vowels with diaeresis.
|
|
264
262
|
* 0.3.8 - Correct and improve Macedonian support.
|
|
265
263
|
* 0.3.7 - Fix compatibility with Ruby 1.8.7. Add Swedish support.
|
|
266
264
|
* 0.3.6 - Allow multiple transliterators. Add Greek support.
|
|
@@ -278,7 +276,7 @@ Many thanks to the following people for their help:
|
|
|
278
276
|
|
|
279
277
|
## Copyright
|
|
280
278
|
|
|
281
|
-
Copyright (c) 2010-
|
|
279
|
+
Copyright (c) 2010-2013 Norman Clarke
|
|
282
280
|
|
|
283
281
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
284
282
|
this software and associated documentation files (the "Software"), to deal in
|
|
@@ -296,4 +294,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
296
294
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
297
295
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
298
296
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
299
|
-
SOFTWARE.
|
|
297
|
+
SOFTWARE.
|
|
@@ -10,7 +10,7 @@ module Babosa
|
|
|
10
10
|
"Џ" => "Dzh",
|
|
11
11
|
"Ж" => "Zh",
|
|
12
12
|
"Ц" => "C",
|
|
13
|
-
"
|
|
13
|
+
"Ѕ" => "Z",
|
|
14
14
|
"Ј" => "J",
|
|
15
15
|
"ѓ" => "gj",
|
|
16
16
|
"љ" => "lj",
|
|
@@ -19,7 +19,7 @@ module Babosa
|
|
|
19
19
|
"џ" => "dzh",
|
|
20
20
|
"ж" => "zh",
|
|
21
21
|
"ц" => "c",
|
|
22
|
-
"
|
|
22
|
+
"ѕ" => "z",
|
|
23
23
|
"ј" => "j"
|
|
24
24
|
}
|
|
25
25
|
end
|
data/lib/babosa/version.rb
CHANGED
metadata
CHANGED
|
@@ -2,63 +2,79 @@
|
|
|
2
2
|
name: babosa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.3.
|
|
5
|
+
version: 0.3.10
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Norman Clarke
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
17
16
|
none: false
|
|
18
17
|
requirements:
|
|
19
18
|
- - ! '>='
|
|
20
19
|
- !ruby/object:Gem::Version
|
|
21
20
|
version: 2.3.0
|
|
22
|
-
|
|
21
|
+
name: activesupport
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
|
23
25
|
none: false
|
|
24
26
|
requirements:
|
|
25
27
|
- - ! '>='
|
|
26
28
|
- !ruby/object:Gem::Version
|
|
27
29
|
version: 2.3.0
|
|
28
|
-
prerelease: false
|
|
29
|
-
type: :development
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
32
|
+
none: false
|
|
33
|
+
requirements:
|
|
34
|
+
- - ~>
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 2.11.0
|
|
31
37
|
name: rspec
|
|
38
|
+
type: :development
|
|
39
|
+
prerelease: false
|
|
32
40
|
requirement: !ruby/object:Gem::Requirement
|
|
33
41
|
none: false
|
|
34
42
|
requirements:
|
|
35
43
|
- - ~>
|
|
36
44
|
- !ruby/object:Gem::Version
|
|
37
|
-
version: 2.
|
|
45
|
+
version: 2.11.0
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
38
47
|
version_requirements: !ruby/object:Gem::Requirement
|
|
39
48
|
none: false
|
|
40
49
|
requirements:
|
|
41
|
-
- -
|
|
50
|
+
- - ! '>='
|
|
42
51
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
44
|
-
prerelease: false
|
|
45
|
-
type: :development
|
|
46
|
-
- !ruby/object:Gem::Dependency
|
|
52
|
+
version: '0'
|
|
47
53
|
name: simplecov
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
48
56
|
requirement: !ruby/object:Gem::Requirement
|
|
49
57
|
none: false
|
|
50
58
|
requirements:
|
|
51
59
|
- - ! '>='
|
|
52
60
|
- !ruby/object:Gem::Version
|
|
53
61
|
version: '0'
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
54
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
55
64
|
none: false
|
|
56
65
|
requirements:
|
|
57
66
|
- - ! '>='
|
|
58
67
|
- !ruby/object:Gem::Version
|
|
59
68
|
version: '0'
|
|
60
|
-
|
|
69
|
+
name: rake
|
|
61
70
|
type: :development
|
|
71
|
+
prerelease: false
|
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ! '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0'
|
|
62
78
|
description: ! " A library for creating slugs. Babosa an extraction and improvement
|
|
63
79
|
of the\n string code from FriendlyId, intended to help developers create similar\n
|
|
64
80
|
\ libraries or plugins.\n"
|
|
@@ -132,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
132
148
|
version: '0'
|
|
133
149
|
requirements: []
|
|
134
150
|
rubyforge_project: ! '[none]'
|
|
135
|
-
rubygems_version: 1.8.
|
|
151
|
+
rubygems_version: 1.8.23
|
|
136
152
|
signing_key:
|
|
137
153
|
specification_version: 3
|
|
138
154
|
summary: A library for creating slugs.
|