srbovanje 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +30 -0
- data/README.md +17 -8
- data/lib/srbovanje/railtie.rb +1 -0
- data/lib/srbovanje/string_ext.rb +1 -1
- metadata +14 -18
- data/Rakefile +0 -11
- data/test/srbovanje_test.rb +0 -28
- data/test/string_ext_test.rb +0 -18
- data/test/test_helper.rb +0 -4
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8585bfc72a559e745f7462a5013b39a895ff3706
|
4
|
+
data.tar.gz: 5635dad2e00b862cee73aae52dafc5646983a7ba
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 42f900a613b43bdab1b67906fbb2f70a238376619aa4576502e8369a530611599c9633953cb4461b431fce3b07d9391065d4abfcfac26603875b78d4411c3fbd
|
7
|
+
data.tar.gz: a9cd31e141d928ec2a1d5e3680b8ec0442e861d001345ad277054c93e072a9049d44daad057c1c081c5cafaec47e608f194a13dbade7b65571652f8be971ae85
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
## 2.0.0, 2014-07-13
|
2
|
+
* preimenovana metoda na_latinici => latinicom
|
3
|
+
* utisan warning "[deprecated] I18n.enforce_available_locales will default to true in the future..."
|
4
|
+
|
5
|
+
## 1.0.2, 2013-02-26
|
6
|
+
* Railtie za i18n konfigurisanje
|
7
|
+
|
8
|
+
## 1.0.1, 2013-02-26
|
9
|
+
* Konfigurisanje i18n preslovljavanja
|
10
|
+
|
11
|
+
## 1.0.0, 2013-02-25
|
12
|
+
* Novi, čistiji API; izbačen slugify
|
13
|
+
|
14
|
+
## 0.2.1, 2011-01-05
|
15
|
+
* Ruby 1.9.2 fix: upozorenja
|
16
|
+
* Ruby 1.9.2 fix: load path za testove
|
17
|
+
|
18
|
+
## 0.2.0, 2011-01-05
|
19
|
+
* Fix nadogradnje Stringa upotrebom String.class_eval metode
|
20
|
+
* Ruby 1.9 podrška
|
21
|
+
|
22
|
+
## 0.1.0, 2009-03-14
|
23
|
+
* String#slugify
|
24
|
+
|
25
|
+
## 0.0.2, 2009-03-12
|
26
|
+
* "danger" metode (recode_sr_latin!, recode_sr_ascii_latin!)
|
27
|
+
* String.abeceda
|
28
|
+
|
29
|
+
## 0.0.1, 2009-03-12
|
30
|
+
* Inicijalna verzija
|
data/README.md
CHANGED
@@ -13,10 +13,10 @@ U Gemfile projekta dodajte:
|
|
13
13
|
|
14
14
|
## Korišćenje
|
15
15
|
|
16
|
-
>> "Ђурђевак".
|
16
|
+
>> "Ђурђевак".latinicom
|
17
17
|
=> "Đurđevak"
|
18
18
|
|
19
|
-
>> "Ђурђевак".
|
19
|
+
>> "Ђурђевак".latinicom :ascii
|
20
20
|
=> "DJurdjevak"
|
21
21
|
|
22
22
|
Ako zatreba, tu je i niz sa slovima abecede:
|
@@ -28,13 +28,22 @@ Ako zatreba, tu je i niz sa slovima abecede:
|
|
28
28
|
Ako koristite Srbovanje uz Rails dobićete setovana pravila za preslovnjavanja
|
29
29
|
koje koristi i18n gem, tako da će npr. parameterize raditi pravilnije:
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
## bez Srbovanja
|
32
|
+
|
33
|
+
>> "Karađorđeva šnicla".parameterize
|
34
|
+
=> "karadordeva-snicla"
|
35
|
+
|
36
|
+
>> "Шабан Шаулић".parameterize
|
37
|
+
=> ""
|
38
|
+
|
39
|
+
## uz Srbovanje
|
40
|
+
|
41
|
+
>> "Karađorđeva šnicla".parameterize
|
42
|
+
=> "karadjordjeva-snicla"
|
43
|
+
|
44
|
+
>> "Шабан Шаулић".parameterize
|
45
|
+
=> "saban-saulic"
|
34
46
|
|
35
|
-
# uz Srbovanje
|
36
|
-
>> "Đelem, đelem".parameterize
|
37
|
-
=> "djelem-djelem"
|
38
47
|
|
39
48
|
## MIT Licence
|
40
49
|
|
data/lib/srbovanje/railtie.rb
CHANGED
data/lib/srbovanje/string_ext.rb
CHANGED
@@ -5,7 +5,7 @@ String.class_eval do
|
|
5
5
|
# Preslovljava na latinicu
|
6
6
|
# Params:
|
7
7
|
# +charset+:: ako je :ascii preslovljava u "ošišanu" latinicu.
|
8
|
-
def
|
8
|
+
def latinicom(charset=:utf8)
|
9
9
|
mapping = Srbovanje.latinica_map(charset)
|
10
10
|
self.gsub(/.+?/) do |chr|
|
11
11
|
mapping[chr] || chr
|
metadata
CHANGED
@@ -1,54 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: srbovanje
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dejan Simic
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
13
|
+
description: '"Ђурђевак".latinicom #=> "Đurđevak"'
|
15
14
|
email: desimic@gmail.com
|
16
15
|
executables: []
|
17
16
|
extensions: []
|
18
17
|
extra_rdoc_files: []
|
19
18
|
files:
|
20
|
-
-
|
19
|
+
- CHANGELOG.md
|
20
|
+
- README.md
|
21
21
|
- lib/i18n_config.rb
|
22
|
+
- lib/srbovanje.rb
|
22
23
|
- lib/srbovanje/railtie.rb
|
23
24
|
- lib/srbovanje/srbovanje.rb
|
24
25
|
- lib/srbovanje/string_ext.rb
|
25
|
-
- lib/srbovanje.rb
|
26
|
-
- test/srbovanje_test.rb
|
27
|
-
- test/string_ext_test.rb
|
28
|
-
- test/test_helper.rb
|
29
|
-
- README.md
|
30
26
|
homepage: https://github.com/dejan/srbovanje
|
31
|
-
licenses:
|
27
|
+
licenses:
|
28
|
+
- MIT
|
29
|
+
metadata: {}
|
32
30
|
post_install_message:
|
33
31
|
rdoc_options: []
|
34
32
|
require_paths:
|
35
33
|
- lib
|
36
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
35
|
requirements:
|
39
|
-
- -
|
36
|
+
- - ">="
|
40
37
|
- !ruby/object:Gem::Version
|
41
38
|
version: '0'
|
42
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
40
|
requirements:
|
45
|
-
- -
|
41
|
+
- - ">="
|
46
42
|
- !ruby/object:Gem::Version
|
47
43
|
version: '0'
|
48
44
|
requirements: []
|
49
45
|
rubyforge_project:
|
50
|
-
rubygems_version:
|
46
|
+
rubygems_version: 2.2.2
|
51
47
|
signing_key:
|
52
|
-
specification_version:
|
53
|
-
summary:
|
48
|
+
specification_version: 4
|
49
|
+
summary: Transliteracija ćirilice na latinicu i tzv. ASCII latinicu.
|
54
50
|
test_files: []
|
data/Rakefile
DELETED
data/test/srbovanje_test.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
describe Srbovanje do
|
6
|
-
describe '::abeceda' do
|
7
|
-
it 'vraca abecedu kao niz' do
|
8
|
-
assert_equal 'B', Srbovanje.abeceda[1]
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'ima 30 slova' do
|
12
|
-
assert_equal 30, Srbovanje.abeceda.size
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe 'latinica_map' do
|
17
|
-
it 'vraca potpunu mapu latinice' do
|
18
|
-
assert_equal 'Š', Srbovanje.latinica_full_map['Ш']
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe 'latinica_ascii_map' do
|
23
|
-
it 'vraca mapu ascii latinice' do
|
24
|
-
assert_equal 'dj', Srbovanje.latinica_ascii_map['ђ']
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
data/test/string_ext_test.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
describe String do
|
6
|
-
it 'preslovnjava u latinicu' do
|
7
|
-
assert_equal "NJEGOŠ", "ЊЕГОШ".na_latinici
|
8
|
-
assert_equal "Šaban Šaulić", "Шабан Шаулић".na_latinici
|
9
|
-
assert_equal "elektrodistribucija", "електродистрибуција".na_latinici
|
10
|
-
assert_equal "Đurđevak", "Ђурђевак".na_latinici
|
11
|
-
assert_equal "Latinica", "Latinica".na_latinici
|
12
|
-
assert_equal '[]2#}(,.);2@$"', '[]2#}(,.);2@$"'.na_latinici
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'preslovanjava u ošišanu latinicu' do
|
16
|
-
assert_equal("Zeleznica Srbije", "Железница Србије".na_latinici(:ascii))
|
17
|
-
end
|
18
|
-
end
|
data/test/test_helper.rb
DELETED