viljushka 0.7.0 → 0.7.1
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/features/convert_latin_to_cyrillic.feature +0 -2
- data/features/downcase.feature +1 -0
- data/features/upcase.feature +1 -0
- data/lib/viljushka/boc.rb +49 -29
- data/lib/viljushka/version.rb +1 -1
- metadata +6 -6
data/features/downcase.feature
CHANGED
data/features/upcase.feature
CHANGED
data/lib/viljushka/boc.rb
CHANGED
|
@@ -2,35 +2,55 @@
|
|
|
2
2
|
module Viljushka
|
|
3
3
|
module Boc
|
|
4
4
|
|
|
5
|
-
Latin = %w(DJ Dj dj DŽ Dž dž LJ Lj lj NJ Nj nj A a B b V v G g D d Đ đ
|
|
6
|
-
Cyrillic = %w(Ђ Ђ ђ Џ Џ џ Љ Љ љ Њ Њ њ А а Б б В в Г г Д д Ђ ђ
|
|
7
|
-
|
|
8
|
-
Up = %w(Dž Ž Ć Č Š A B C D E F G H I J K L M N O P Q R S T U V W X Y Z А Б В Г Д Ђ Е Ж З И Ј К Л М Н Љ Њ О П Р С Т Ћ У Ф Х Ц Ч Џ Ш)
|
|
9
|
-
Low = %w(dž ž ć č š a b c d e f g h i j k l m n o p q r s t u v w x y z а б в г д ђ е ж з и ј к л м н љ њ о п р с т ћ у ф х ц ч џ ш)
|
|
10
|
-
|
|
11
|
-
def
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
Latin = %w(DJ Dj dj DŽ Dž dž LJ Lj lj NJ Nj nj A a B b V v G g D d Đ đ E e Ž ž Z z I i J j K k L l M m N n O o P p R r S s T t Ć ć U u F f H h C c Č č Š š)
|
|
6
|
+
Cyrillic = %w(Ђ Ђ ђ Џ Џ џ Љ Љ љ Њ Њ њ А а Б б В в Г г Д д Ђ ђ Е е Ж ж З з И и Ј ј К к Л л М м Н н О о П п Р р С с Т т Ћ ћ У у Ф ф Х х Ц ц Ч ч Ш ш)
|
|
7
|
+
|
|
8
|
+
Up = %w(Dž Ž Ć Č Š Đ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z А Б В Г Д Ђ Е Ж З И Ј К Л М Н Љ Њ О П Р С Т Ћ У Ф Х Ц Ч Џ Ш)
|
|
9
|
+
Low = %w(dž ž ć č š đ a b c d e f g h i j k l m n o p q r s t u v w x y z а б в г д ђ е ж з и ј к л м н љ њ о п р с т ћ у ф х ц ч џ ш)
|
|
10
|
+
|
|
11
|
+
def to_cyr
|
|
12
|
+
convert(self.dup, Latin, Cyrillic)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
alias_method :po_vuku, :to_cyr
|
|
16
|
+
|
|
17
|
+
def to_cyr!
|
|
18
|
+
convert(self, Latin, Cyrillic)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
alias_method :po_vuku!, :to_cyr!
|
|
22
|
+
|
|
23
|
+
def to_lat
|
|
24
|
+
convert(self.dup, Cyrillic, Latin)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
alias_method :po_gaju, :to_lat
|
|
28
|
+
|
|
29
|
+
def to_lat!
|
|
30
|
+
convert(self, Cyrillic, Latin)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
alias_method :po_gaju!, :to_lat!
|
|
34
|
+
|
|
35
|
+
def downcase
|
|
36
|
+
convert(self.dup, Up, Low)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def downcase!
|
|
40
|
+
convert(self, Up, Low)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def upcase
|
|
44
|
+
convert(self.dup, Low, Up)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def upcase!
|
|
48
|
+
convert(self, Low, Up)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def capitalize
|
|
52
|
+
arr = self.scan(/./)
|
|
53
|
+
convert(arr.shift, Low, Up) + convert(arr.join, Up, Low)
|
|
34
54
|
end
|
|
35
55
|
|
|
36
56
|
private
|
data/lib/viljushka/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: viljushka
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-02-
|
|
12
|
+
date: 2012-02-26 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &17207042200 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,10 +21,10 @@ dependencies:
|
|
|
21
21
|
version: 2.0.0
|
|
22
22
|
type: :development
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *17207042200
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: cucumber
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &17207040380 !ruby/object:Gem::Requirement
|
|
28
28
|
none: false
|
|
29
29
|
requirements:
|
|
30
30
|
- - ! '>='
|
|
@@ -32,7 +32,7 @@ dependencies:
|
|
|
32
32
|
version: 1.0.0
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements: *
|
|
35
|
+
version_requirements: *17207040380
|
|
36
36
|
description: Character conversion from Latin alphabet to Serbian Cyrillic script and
|
|
37
37
|
vice versa
|
|
38
38
|
email: asimic@gmail.com
|