srbovanje 1.0.0 → 3.0.1
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/LICENSE +22 -0
- data/README.md +44 -10
- data/ext/lib/preslovi.x86_64-darwin.h +82 -0
- data/ext/lib/preslovi.x86_64-darwin.so +0 -0
- data/ext/lib/preslovi.x86_64-linux.h +66 -0
- data/ext/lib/preslovi.x86_64-linux.so +0 -0
- data/lib/i18n_config.rb +5 -0
- data/lib/srbovanje.rb +11 -3
- data/lib/srbovanje/preslovi.rb +16 -0
- data/lib/srbovanje/railtie.rb +9 -0
- data/lib/srbovanje/srbovanje.rb +10 -92
- data/lib/srbovanje/string_ext.rb +7 -7
- metadata +48 -53
- 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
|
+
SHA256:
|
3
|
+
metadata.gz: 4da72b0c0c61f64acd60aad069bc601572e5a004d38f09a12340fb102ad03190
|
4
|
+
data.tar.gz: e8757f48fbf9a9c09447c840de502cf77f29e6056fc93c8e95403adc4b177e90
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 93e028587d103b26670b5f2d52f65c759e78a0af02710df3cac05fd561895812de84e5e5df9cb40859cdd09e77127de6f9f0c1b091402eabeb00f5135370fe52
|
7
|
+
data.tar.gz: f6a3dc243b299bf24acc78c0f9c051096731bbd9b3f778d7cc2a750fa0baa41180404dc6ec0e92e55390c142ad3e143b459ad4468466acd4343d792fa150aa8b
|
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/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2009 Dejan Simic
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,27 +1,61 @@
|
|
1
1
|
srbovanje
|
2
2
|
=========
|
3
3
|
|
4
|
-
Ruby gem za preslovanjavanje ćirilice na latinicu i tzv. "ošišanu" latinicu
|
5
|
-
|
4
|
+
Ruby gem za preslovanjavanje ćirilice na latinicu i tzv. "ošišanu" (ASCII) latinicu.
|
6
5
|
|
7
6
|
## Instaliranje
|
8
7
|
|
9
|
-
|
8
|
+
U Gemfile projekta dodajte:
|
9
|
+
|
10
|
+
gem 'srbovanje'
|
10
11
|
|
12
|
+
Podržane platforme su Linux i macOS (darwin).
|
11
13
|
|
12
14
|
## Korišćenje
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
```ruby
|
17
|
+
>> "Ђурђевак".latinicom
|
18
|
+
=> "Đurđevak"
|
19
|
+
|
20
|
+
>> "Ђурђевак".latinicom_ascii
|
21
|
+
=> "Djurdjevak"
|
22
|
+
```
|
23
|
+
|
24
|
+
Ako zatreba, tu je i niz sa slovima abecede:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
>> Srbovanje.abeceda
|
28
|
+
=> ["A", "B", "C", "Č", "Ć", "D", "Dž", "Đ", "E", "F", "G", "H", "I", "J", "K", "L", "Lj", "M", "N", "Nj", "O", "P", "R", "S", "Š", "T", "U", "V", "Z", "Ž"]
|
29
|
+
```
|
30
|
+
|
31
|
+
Ako koristite Srbovanje uz Rails dobićete setovana pravila za preslovljavanja
|
32
|
+
koje koristi i18n gem, tako da će npr. parameterize raditi pravilnije:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
## bez Srbovanja
|
36
|
+
|
37
|
+
>> "Karađorđeva šnicla".parameterize
|
38
|
+
=> "karadordeva-snicla"
|
39
|
+
|
40
|
+
>> "Шабан Шаулић".parameterize
|
41
|
+
=> ""
|
42
|
+
|
43
|
+
## uz Srbovanje
|
44
|
+
|
45
|
+
>> "Karađorđeva šnicla".parameterize
|
46
|
+
=> "karadjordjeva-snicla"
|
16
47
|
|
17
|
-
|
18
|
-
|
48
|
+
>> "Шабан Шаулић".parameterize
|
49
|
+
=> "saban-saulic"
|
50
|
+
```
|
19
51
|
|
20
|
-
|
21
|
-
=> ["A", "B", "C", "Č", "Ć", "D", "DŽ", "Đ", "E", "F", "G", "H", "I", "J", "K", "L", "LJ", "M", "N", "NJ", "O", "P", "R", "S", "Š", "T", "U", "V", "Z", "Ž"]
|
52
|
+
## Performanse
|
22
53
|
|
54
|
+
Od verzije 3.0, Srbovanje koristi [Go](https://golang.org/) ekstenziju zbog
|
55
|
+
dramatično boljih (30x) performansi. Ekstenzija je unapred kompajlirana i
|
56
|
+
spakovana uz gem, tako da instaliranje nema dodatnih zahteva.
|
23
57
|
|
24
|
-
## MIT
|
58
|
+
## MIT License
|
25
59
|
|
26
60
|
Copyright (c) 2009 Dejan Simic
|
27
61
|
|
@@ -0,0 +1,82 @@
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
2
|
+
|
3
|
+
/* package command-line-arguments */
|
4
|
+
|
5
|
+
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
7
|
+
|
8
|
+
#include <stddef.h> /* for ptrdiff_t below */
|
9
|
+
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
12
|
+
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#endif
|
18
|
+
|
19
|
+
/* Start of preamble from import "C" comments. */
|
20
|
+
|
21
|
+
|
22
|
+
#line 3 "preslovi.go"
|
23
|
+
|
24
|
+
#include <stdio.h>
|
25
|
+
#include <stdlib.h>
|
26
|
+
|
27
|
+
#line 1 "cgo-generated-wrapper"
|
28
|
+
|
29
|
+
|
30
|
+
/* End of preamble from import "C" comments. */
|
31
|
+
|
32
|
+
|
33
|
+
/* Start of boilerplate cgo prologue. */
|
34
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
35
|
+
|
36
|
+
#ifndef GO_CGO_PROLOGUE_H
|
37
|
+
#define GO_CGO_PROLOGUE_H
|
38
|
+
|
39
|
+
typedef signed char GoInt8;
|
40
|
+
typedef unsigned char GoUint8;
|
41
|
+
typedef short GoInt16;
|
42
|
+
typedef unsigned short GoUint16;
|
43
|
+
typedef int GoInt32;
|
44
|
+
typedef unsigned int GoUint32;
|
45
|
+
typedef long long GoInt64;
|
46
|
+
typedef unsigned long long GoUint64;
|
47
|
+
typedef GoInt64 GoInt;
|
48
|
+
typedef GoUint64 GoUint;
|
49
|
+
typedef __SIZE_TYPE__ GoUintptr;
|
50
|
+
typedef float GoFloat32;
|
51
|
+
typedef double GoFloat64;
|
52
|
+
typedef float _Complex GoComplex64;
|
53
|
+
typedef double _Complex GoComplex128;
|
54
|
+
|
55
|
+
/*
|
56
|
+
static assertion to make sure the file is being used on architecture
|
57
|
+
at least with matching size of GoInt.
|
58
|
+
*/
|
59
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
60
|
+
|
61
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
62
|
+
typedef _GoString_ GoString;
|
63
|
+
#endif
|
64
|
+
typedef void *GoMap;
|
65
|
+
typedef void *GoChan;
|
66
|
+
typedef struct { void *t; void *v; } GoInterface;
|
67
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
68
|
+
|
69
|
+
#endif
|
70
|
+
|
71
|
+
/* End of boilerplate cgo prologue. */
|
72
|
+
|
73
|
+
#ifdef __cplusplus
|
74
|
+
extern "C" {
|
75
|
+
#endif
|
76
|
+
|
77
|
+
extern char* latinicom(char* s);
|
78
|
+
extern char* latinicom_ascii(char* s);
|
79
|
+
|
80
|
+
#ifdef __cplusplus
|
81
|
+
}
|
82
|
+
#endif
|
Binary file
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/* Created by "go tool cgo" - DO NOT EDIT. */
|
2
|
+
|
3
|
+
/* package command-line-arguments */
|
4
|
+
|
5
|
+
/* Start of preamble from import "C" comments. */
|
6
|
+
|
7
|
+
|
8
|
+
#line 3 "/home/airninja/tmp/srbovanje/ext/preslovi.go"
|
9
|
+
|
10
|
+
#include <stdio.h>
|
11
|
+
#include <stdlib.h>
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
/* End of preamble from import "C" comments. */
|
16
|
+
|
17
|
+
|
18
|
+
/* Start of boilerplate cgo prologue. */
|
19
|
+
|
20
|
+
#ifndef GO_CGO_PROLOGUE_H
|
21
|
+
#define GO_CGO_PROLOGUE_H
|
22
|
+
|
23
|
+
typedef signed char GoInt8;
|
24
|
+
typedef unsigned char GoUint8;
|
25
|
+
typedef short GoInt16;
|
26
|
+
typedef unsigned short GoUint16;
|
27
|
+
typedef int GoInt32;
|
28
|
+
typedef unsigned int GoUint32;
|
29
|
+
typedef long long GoInt64;
|
30
|
+
typedef unsigned long long GoUint64;
|
31
|
+
typedef GoInt64 GoInt;
|
32
|
+
typedef GoUint64 GoUint;
|
33
|
+
typedef __SIZE_TYPE__ GoUintptr;
|
34
|
+
typedef float GoFloat32;
|
35
|
+
typedef double GoFloat64;
|
36
|
+
typedef float _Complex GoComplex64;
|
37
|
+
typedef double _Complex GoComplex128;
|
38
|
+
|
39
|
+
/*
|
40
|
+
static assertion to make sure the file is being used on architecture
|
41
|
+
at least with matching size of GoInt.
|
42
|
+
*/
|
43
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
44
|
+
|
45
|
+
typedef struct { const char *p; GoInt n; } GoString;
|
46
|
+
typedef void *GoMap;
|
47
|
+
typedef void *GoChan;
|
48
|
+
typedef struct { void *t; void *v; } GoInterface;
|
49
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
50
|
+
|
51
|
+
#endif
|
52
|
+
|
53
|
+
/* End of boilerplate cgo prologue. */
|
54
|
+
|
55
|
+
#ifdef __cplusplus
|
56
|
+
extern "C" {
|
57
|
+
#endif
|
58
|
+
|
59
|
+
|
60
|
+
extern char* latinicom(char* p0);
|
61
|
+
|
62
|
+
extern char* latinicom_ascii(char* p0);
|
63
|
+
|
64
|
+
#ifdef __cplusplus
|
65
|
+
}
|
66
|
+
#endif
|
Binary file
|
data/lib/i18n_config.rb
ADDED
data/lib/srbovanje.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
3
|
+
require 'srbovanje/srbovanje'
|
4
|
+
require 'srbovanje/preslovi'
|
5
|
+
require 'srbovanje/string_ext'
|
4
6
|
|
5
|
-
|
6
|
-
require 'srbovanje/
|
7
|
+
if defined?(Rails)
|
8
|
+
require 'srbovanje/railtie'
|
9
|
+
elsif defined?(I18n)
|
10
|
+
require 'i18n_config'
|
11
|
+
end
|
12
|
+
|
13
|
+
module Srbovanje
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
|
5
|
+
module Preslovi
|
6
|
+
extend FFI::Library
|
7
|
+
|
8
|
+
PLATFORM = "#{Gem::Platform.local.cpu}-#{Gem::Platform.local.os}"
|
9
|
+
|
10
|
+
ffi_lib "#{__dir__}/../../ext/lib/preslovi.#{PLATFORM}.so"
|
11
|
+
|
12
|
+
attach_function :latinicom, [:string], :string
|
13
|
+
attach_function :latinicom_ascii, [:string], :string
|
14
|
+
|
15
|
+
extend self
|
16
|
+
end
|
data/lib/srbovanje/srbovanje.rb
CHANGED
@@ -1,102 +1,20 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
module Srbovanje
|
2
3
|
|
3
|
-
|
4
|
-
def self.abeceda
|
5
|
-
%w(A B C Č Ć D DŽ Đ E F G H I J K L LJ M N NJ O P R S Š T U V Z Ž)
|
6
|
-
end
|
4
|
+
ABECEDA = %w(A B C Č Ć D Dž Đ E F G H I J K L Lj M N Nj O P R S Š T U V Z Ž)
|
7
5
|
|
8
|
-
def
|
9
|
-
|
6
|
+
def latinicom(text)
|
7
|
+
Preslovi.latinicom(text).force_encoding('utf-8').encode
|
10
8
|
end
|
11
9
|
|
12
|
-
def
|
13
|
-
|
14
|
-
'а' => 'a',
|
15
|
-
'А' => 'A',
|
16
|
-
'б' => 'b',
|
17
|
-
'Б' => 'B',
|
18
|
-
'в' => 'v',
|
19
|
-
'В' => 'V',
|
20
|
-
'г' => 'g',
|
21
|
-
'Г' => 'G',
|
22
|
-
'д' => 'd',
|
23
|
-
'Д' => 'D',
|
24
|
-
'ђ' => 'đ',
|
25
|
-
'Ђ' => 'Đ',
|
26
|
-
'е' => 'e',
|
27
|
-
'Е' => 'E',
|
28
|
-
'ж' => 'ž',
|
29
|
-
'Ж' => 'Ž',
|
30
|
-
'з' => 'z',
|
31
|
-
'З' => 'Z',
|
32
|
-
'и' => 'i',
|
33
|
-
'И' => 'I',
|
34
|
-
'ј' => 'j',
|
35
|
-
'Ј' => 'J',
|
36
|
-
'к' => 'k',
|
37
|
-
'К' => 'K',
|
38
|
-
'л' => 'l',
|
39
|
-
'Л' => 'L',
|
40
|
-
'љ' => 'lj',
|
41
|
-
'Љ' => 'LJ',
|
42
|
-
'м' => 'm',
|
43
|
-
'М' => 'M',
|
44
|
-
'н' => 'n',
|
45
|
-
'Н' => 'N',
|
46
|
-
'њ' => 'nj',
|
47
|
-
'Њ' => 'NJ',
|
48
|
-
'о' => 'o',
|
49
|
-
'О' => 'O',
|
50
|
-
'п' => 'p',
|
51
|
-
'П' => 'P',
|
52
|
-
'р' => 'r',
|
53
|
-
'Р' => 'R',
|
54
|
-
'с' => 's',
|
55
|
-
'С' => 'S',
|
56
|
-
'т' => 't',
|
57
|
-
'Т' => 'T',
|
58
|
-
'ћ' => 'ć',
|
59
|
-
'Ћ' => 'Ć',
|
60
|
-
'ц' => 'c',
|
61
|
-
'Ц' => 'C',
|
62
|
-
'у' => 'u',
|
63
|
-
'У' => 'U',
|
64
|
-
'ф' => 'f',
|
65
|
-
'Ф' => 'F',
|
66
|
-
'х' => 'h',
|
67
|
-
'Х' => 'H',
|
68
|
-
'ч' => 'č',
|
69
|
-
'Ч' => 'Č',
|
70
|
-
'џ' => 'dž',
|
71
|
-
'Џ' => 'DŽ',
|
72
|
-
'ш' => 'š',
|
73
|
-
'Ш' => 'Š' }
|
10
|
+
def latinicom_ascii(text)
|
11
|
+
Preslovi.latinicom_ascii(text).force_encoding('utf-8').encode
|
74
12
|
end
|
75
13
|
|
76
|
-
def
|
77
|
-
|
78
|
-
'ћ' => 'c',
|
79
|
-
'ć' => 'c',
|
80
|
-
'ч' => 'c',
|
81
|
-
'č' => 'c',
|
82
|
-
'Ћ' => 'C',
|
83
|
-
'Ć' => 'C',
|
84
|
-
'Ч' => 'C',
|
85
|
-
'Č' => 'C',
|
86
|
-
'ж' => 'z',
|
87
|
-
'ž' => 'z',
|
88
|
-
'Ж' => 'Z',
|
89
|
-
'Ž' => 'Z',
|
90
|
-
'š' => 's',
|
91
|
-
'ш' => 's',
|
92
|
-
'Ш' => 'S',
|
93
|
-
'Š' => 'S',
|
94
|
-
'đ' => 'dj',
|
95
|
-
'ђ' => 'dj',
|
96
|
-
'Ђ' => 'DJ',
|
97
|
-
'Đ' => 'DJ',
|
98
|
-
'џ' => 'dz',
|
99
|
-
'Џ' => 'DZ')
|
14
|
+
def abeceda
|
15
|
+
ABECEDA
|
100
16
|
end
|
101
17
|
|
18
|
+
extend self
|
19
|
+
|
102
20
|
end
|
data/lib/srbovanje/string_ext.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
String.class_eval do
|
4
4
|
|
5
5
|
# Preslovljava na latinicu
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
def latinicom
|
7
|
+
Srbovanje.latinicom(self)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Preslovljava na ASCII ("ošišanu") latinicu
|
11
|
+
def latinicom_ascii
|
12
|
+
Srbovanje.latinicom_ascii(self)
|
13
13
|
end
|
14
14
|
|
15
15
|
end
|
metadata
CHANGED
@@ -1,74 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: srbovanje
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Dejan Simic
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
11
|
+
date: 2020-08-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
description: Transliteracija ćirilice na latinicu i tzv. "ošišanu" (ASCII) latinicu.
|
23
28
|
email: desimic@gmail.com
|
24
29
|
executables: []
|
25
|
-
|
26
30
|
extensions: []
|
27
|
-
|
28
31
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
|
31
|
-
-
|
32
|
+
files:
|
33
|
+
- CHANGELOG.md
|
34
|
+
- LICENSE
|
35
|
+
- README.md
|
36
|
+
- ext/lib/preslovi.x86_64-darwin.h
|
37
|
+
- ext/lib/preslovi.x86_64-darwin.so
|
38
|
+
- ext/lib/preslovi.x86_64-linux.h
|
39
|
+
- ext/lib/preslovi.x86_64-linux.so
|
40
|
+
- lib/i18n_config.rb
|
41
|
+
- lib/srbovanje.rb
|
42
|
+
- lib/srbovanje/preslovi.rb
|
43
|
+
- lib/srbovanje/railtie.rb
|
32
44
|
- lib/srbovanje/srbovanje.rb
|
33
45
|
- lib/srbovanje/string_ext.rb
|
34
|
-
- lib/srbovanje.rb
|
35
|
-
- test/srbovanje_test.rb
|
36
|
-
- test/string_ext_test.rb
|
37
|
-
- test/test_helper.rb
|
38
|
-
- README.md
|
39
|
-
has_rdoc: true
|
40
46
|
homepage: https://github.com/dejan/srbovanje
|
41
|
-
licenses:
|
42
|
-
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
43
50
|
post_install_message:
|
44
51
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
52
|
+
require_paths:
|
47
53
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
-
|
50
|
-
requirements:
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
51
56
|
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
version: "0"
|
57
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
60
61
|
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 0
|
65
|
-
version: "0"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
66
64
|
requirements: []
|
67
|
-
|
68
|
-
rubyforge_project:
|
69
|
-
rubygems_version: 1.6.2
|
65
|
+
rubygems_version: 3.1.2
|
70
66
|
signing_key:
|
71
|
-
specification_version:
|
72
|
-
summary:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Transliteracija ćirilice na latinicu i tzv. "ošišanu" (ASCII) latinicu.
|
73
69
|
test_files: []
|
74
|
-
|
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