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.
@@ -19,9 +19,7 @@ Feature: Convert Latin To Cyrilic
19
19
  | G | Г |
20
20
  | d | д |
21
21
  | D | Д |
22
- | ð | ђ |
23
22
  | đ | ђ |
24
- | Ð | Ђ |
25
23
  | Đ | Ђ |
26
24
  | dj | ђ |
27
25
  | Dj | Ђ |
@@ -15,6 +15,7 @@ Feature: Convert from uppercase To lowercase
15
15
  | Ć | ć |
16
16
  | Č | č |
17
17
  | Š | š |
18
+ | Đ | đ |
18
19
  | А | а |
19
20
  | Б | б |
20
21
  | В | в |
@@ -11,6 +11,7 @@ Feature: Convert from uppercase To lowercase
11
11
  | dž | DŽ |
12
12
  | lj | LJ |
13
13
  | nj | NJ |
14
+ | đ | Đ |
14
15
  | ž | Ž |
15
16
  | ć | Ć |
16
17
  | č | Č |
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 Đ đ Ð ð 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 method_missing(arg)
12
- if arg.to_s =~ /^(to_cyr|po_vuku)$/
13
- convert(self.dup, Latin, Cyrillic)
14
- elsif arg.to_s =~ /^(to_cyr|po_vuku)!$/
15
- convert(self, Latin, Cyrillic)
16
- elsif arg.to_s =~ /^(to_lat|po_gaju)$/
17
- convert(self.dup, Cyrillic, Latin)
18
- elsif arg.to_s =~ /^(to_lat|po_gaju)!$/
19
- convert(self, Cyrillic, Latin)
20
- elsif arg.to_s =~ /^downcase$/
21
- convert(self.dup, Up, Low)
22
- elsif arg.to_s =~ /^downcase!$/
23
- convert(self, Up, Low)
24
- elsif arg.to_s =~ /^upcase$/
25
- convert(self.dup, Low, Up)
26
- elsif arg.to_s =~ /^upcase!$/
27
- convert(self, Low, Up)
28
- elsif arg.to_s =~ /^capitalize$/
29
- arr = self.scan(/./)
30
- convert(arr.shift, Low, Up) + convert(arr.join, Up, Low)
31
- else
32
- super
33
- end
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
@@ -1,3 +1,3 @@
1
1
  module Viljushka
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
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.0
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-19 00:00:00.000000000Z
12
+ date: 2012-02-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &17202624100 !ruby/object:Gem::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: *17202624100
24
+ version_requirements: *17207042200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cucumber
27
- requirement: &17202668920 !ruby/object:Gem::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: *17202668920
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