charlock_holmes 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57e54315a83df12c843ea67de7213128f74f2a7e
4
- data.tar.gz: f773e478f37f51fe159787964aadf794c25d347a
3
+ metadata.gz: 7500e422c42f6d71a4c5f9636aacd33b08b18e6b
4
+ data.tar.gz: e5b90461b236138f959f2f228c507ecab06f06da
5
5
  SHA512:
6
- metadata.gz: cc59faffae9eacb3515fbc653b326f26fde8b607177f11ba64fcbcdd4033f06b03531c2f3e388d4d66ce09433f39164583b024beb189b8b37adc9a26eaf2586d
7
- data.tar.gz: 7e7cbe1bb7d7bc8bfbae5417ce1c8047aa9e324fdfa528952c848f3180ac90c3ea3c81bfe74829352a1e81ac3648ac195d0f02f38ad4935876a5af20615396a3
6
+ metadata.gz: a29314ed7ad3d8afa68c461d08ef3b6cc09f73d590b35f90200ad93f675288890f40a0d24f7c4d54a8e99792891b58e76d36aa6e476a392b378182fb8dd32537
7
+ data.tar.gz: a12c6bc1823c037a6b7b2a2fba7f1531072fc192e5411aa14de8eda041a1e5e92057b81b6344d27fd44f8dc63d81fceb092b1b9ab407ae2c04a158dcd3f87958
@@ -25,18 +25,20 @@ dir_config 'icu'
25
25
 
26
26
  rubyopt = ENV.delete("RUBYOPT")
27
27
 
28
+ icuconfig = ""
28
29
  icu4c = "/usr"
29
30
  # detect homebrew installs
30
31
  if !have_library 'icui18n'
31
32
  base = if !`which brew`.empty?
32
- `brew --prefix`.strip
33
+ `brew --cellar`.strip
33
34
  elsif File.exists?("/usr/local/Cellar/icu4c")
34
35
  '/usr/local/Cellar'
35
36
  end
36
37
 
37
- if base and icu4c = Dir[File.join(base, 'Cellar/icu4c/*')].sort.last
38
+ if base and icu4c = Dir[File.join(base, 'icu4c/*')].sort.last
38
39
  $INCFLAGS << " -I#{icu4c}/include "
39
40
  $LDFLAGS << " -L#{icu4c}/lib "
41
+ icuconfig = "#{icu4c}/bin/icu-config"
40
42
  end
41
43
  end
42
44
 
@@ -53,8 +55,7 @@ have_library 'icuuc' or abort 'libicuuc missing'
53
55
  have_library 'icudata' or abort 'libicudata missing'
54
56
 
55
57
  # icu4c might be built in C++11 mode, but it also might not have been
56
- icuconfig = `which icu-config`.chomp
57
- icuconfig = "#{icu4c}/bin/icu-config" if icuconfig.empty?
58
+ icuconfig = `which icu-config`.chomp if icuconfig.empty?
58
59
  if File.exist?(icuconfig) && `#{icuconfig} --cxxflags`.include?("c++11")
59
60
  $CXXFLAGS << ' -std=c++11'
60
61
  end
@@ -36,7 +36,7 @@ static VALUE rb_cTransliterator;
36
36
 
37
37
  static VALUE rb_transliterator_id_list(VALUE self) {
38
38
  UErrorCode status = U_ZERO_ERROR;
39
- StringEnumeration *id_list;
39
+ icu::StringEnumeration *id_list;
40
40
  int32_t id_list_size;
41
41
  const char *curr_id;
42
42
  int32_t curr_id_len;
@@ -44,7 +44,7 @@ static VALUE rb_transliterator_id_list(VALUE self) {
44
44
  VALUE rb_curr_id;
45
45
 
46
46
  id_list_size = 0;
47
- id_list = Transliterator::getAvailableIDs(status);
47
+ id_list = icu::Transliterator::getAvailableIDs(status);
48
48
  if(!U_SUCCESS(status)) {
49
49
  rb_raise(rb_eArgError, "%s", u_errorName(status));
50
50
  }
@@ -78,12 +78,12 @@ static VALUE rb_transliterator_id_list(VALUE self) {
78
78
  static VALUE rb_transliterator_transliterate(VALUE self, VALUE rb_txt, VALUE rb_id) {
79
79
  UErrorCode status = U_ZERO_ERROR;
80
80
  UParseError p_error;
81
- Transliterator *trans;
81
+ icu::Transliterator *trans;
82
82
  const char *txt;
83
83
  size_t txt_len;
84
84
  const char *id;
85
85
  size_t id_len;
86
- UnicodeString *u_txt;
86
+ icu::UnicodeString *u_txt;
87
87
  std::string result;
88
88
  VALUE rb_out;
89
89
 
@@ -98,14 +98,14 @@ static VALUE rb_transliterator_transliterate(VALUE self, VALUE rb_txt, VALUE rb_
98
98
  id = RSTRING_PTR(rb_id);
99
99
  id_len = RSTRING_LEN(rb_id);
100
100
 
101
- trans = Transliterator::createInstance(UnicodeString(id, id_len), UTRANS_FORWARD, p_error, status);
101
+ trans = icu::Transliterator::createInstance(icu::UnicodeString(id, id_len), UTRANS_FORWARD, p_error, status);
102
102
  if(!U_SUCCESS(status)) {
103
103
  rb_raise(rb_eArgError, "%s", u_errorName(status));
104
104
  }
105
105
 
106
- u_txt = new UnicodeString(txt, txt_len);
106
+ u_txt = new icu::UnicodeString(txt, txt_len);
107
107
  trans->transliterate(*u_txt);
108
- StringByteSink<std::string> sink(&result);
108
+ icu::StringByteSink<std::string> sink(&result);
109
109
  u_txt->toUTF8(sink);
110
110
 
111
111
  delete u_txt;
@@ -1,3 +1,3 @@
1
1
  module CharlockHolmes
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charlock_holmes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez
@@ -9,50 +9,50 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-14 00:00:00.000000000 Z
12
+ date: 2018-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.7.5
20
+ version: '1.0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.7.5
27
+ version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: minitest
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '0'
34
+ version: '5.11'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: '5.11'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: chardet
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: '0.9'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: '0.9'
56
56
  description: charlock_holmes provides binary and text detection as well as text transcoding
57
57
  using libicu
58
58
  email: seniorlopez@gmail.com