New upstream version 0.7.6

parent 07058d60
......@@ -2,41 +2,43 @@
# This file has been automatically generated by gem2tgz #
#########################################################
# -*- encoding: utf-8 -*-
# stub: charlock_holmes 0.7.6 ruby lib
# stub: ext/charlock_holmes/extconf.rb
Gem::Specification.new do |s|
s.name = "charlock_holmes"
s.version = "0.7.5"
s.name = "charlock_holmes".freeze
s.version = "0.7.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Lopez", "Vicent Mart\u{ed}"]
s.date = "2017-08-14"
s.description = "charlock_holmes provides binary and text detection as well as text transcoding using libicu"
s.email = "seniorlopez@gmail.com"
s.extensions = ["ext/charlock_holmes/extconf.rb"]
s.files = ["ext/charlock_holmes/common.h", "ext/charlock_holmes/converter.c", "ext/charlock_holmes/encoding_detector.c", "ext/charlock_holmes/ext.c", "ext/charlock_holmes/extconf.rb", "ext/charlock_holmes/transliterator.cpp", "lib/charlock_holmes.rb", "lib/charlock_holmes/encoding_detector.rb", "lib/charlock_holmes/string.rb", "lib/charlock_holmes/version.rb"]
s.homepage = "https://github.com/brianmario/charlock_holmes"
s.licenses = ["MIT"]
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
s.rubygems_version = "1.8.23"
s.summary = "Character encoding detection, brought to you by ICU"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Brian Lopez".freeze, "Vicent Mart\u{ed}".freeze]
s.date = "2018-03-29"
s.description = "charlock_holmes provides binary and text detection as well as text transcoding using libicu".freeze
s.email = "seniorlopez@gmail.com".freeze
s.extensions = ["ext/charlock_holmes/extconf.rb".freeze]
s.files = ["ext/charlock_holmes/common.h".freeze, "ext/charlock_holmes/converter.c".freeze, "ext/charlock_holmes/encoding_detector.c".freeze, "ext/charlock_holmes/ext.c".freeze, "ext/charlock_holmes/extconf.rb".freeze, "ext/charlock_holmes/transliterator.cpp".freeze, "lib/charlock_holmes.rb".freeze, "lib/charlock_holmes/encoding_detector.rb".freeze, "lib/charlock_holmes/string.rb".freeze, "lib/charlock_holmes/version.rb".freeze]
s.homepage = "https://github.com/brianmario/charlock_holmes".freeze
s.licenses = ["MIT".freeze]
s.rdoc_options = ["--charset=UTF-8".freeze]
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
s.rubygems_version = "2.5.2.1".freeze
s.summary = "Character encoding detection, brought to you by ICU".freeze
if s.respond_to? :specification_version then
s.specification_version = 4
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<chardet>, [">= 0"])
s.add_development_dependency(%q<minitest>, [">= 0"])
s.add_development_dependency(%q<rake-compiler>, [">= 0.7.5"])
s.add_development_dependency(%q<chardet>.freeze, ["~> 0.9"])
s.add_development_dependency(%q<minitest>.freeze, ["~> 5.11"])
s.add_development_dependency(%q<rake-compiler>.freeze, ["~> 1.0"])
else
s.add_dependency(%q<chardet>, [">= 0"])
s.add_dependency(%q<minitest>, [">= 0"])
s.add_dependency(%q<rake-compiler>, [">= 0.7.5"])
s.add_dependency(%q<chardet>.freeze, ["~> 0.9"])
s.add_dependency(%q<minitest>.freeze, ["~> 5.11"])
s.add_dependency(%q<rake-compiler>.freeze, ["~> 1.0"])
end
else
s.add_dependency(%q<chardet>, [">= 0"])
s.add_dependency(%q<minitest>, [">= 0"])
s.add_dependency(%q<rake-compiler>, [">= 0.7.5"])
s.add_dependency(%q<chardet>.freeze, ["~> 0.9"])
s.add_dependency(%q<minitest>.freeze, ["~> 5.11"])
s.add_dependency(%q<rake-compiler>.freeze, ["~> 1.0"])
end
end
......@@ -25,18 +25,20 @@ dir_config 'icu'
rubyopt = ENV.delete("RUBYOPT")
icuconfig = ""
icu4c = "/usr"
# detect homebrew installs
if !have_library 'icui18n'
base = if !`which brew`.empty?
`brew --prefix`.strip
`brew --cellar`.strip
elsif File.exists?("/usr/local/Cellar/icu4c")
'/usr/local/Cellar'
end
if base and icu4c = Dir[File.join(base, 'Cellar/icu4c/*')].sort.last
if base and icu4c = Dir[File.join(base, 'icu4c/*')].sort.last
$INCFLAGS << " -I#{icu4c}/include "
$LDFLAGS << " -L#{icu4c}/lib "
icuconfig = "#{icu4c}/bin/icu-config"
end
end
......@@ -53,8 +55,7 @@ have_library 'icuuc' or abort 'libicuuc missing'
have_library 'icudata' or abort 'libicudata missing'
# icu4c might be built in C++11 mode, but it also might not have been
icuconfig = `which icu-config`.chomp
icuconfig = "#{icu4c}/bin/icu-config" if icuconfig.empty?
icuconfig = `which icu-config`.chomp if icuconfig.empty?
if File.exist?(icuconfig) && `#{icuconfig} --cxxflags`.include?("c++11")
$CXXFLAGS << ' -std=c++11'
end
......
......@@ -36,7 +36,7 @@ static VALUE rb_cTransliterator;
static VALUE rb_transliterator_id_list(VALUE self) {
UErrorCode status = U_ZERO_ERROR;
StringEnumeration *id_list;
icu::StringEnumeration *id_list;
int32_t id_list_size;
const char *curr_id;
int32_t curr_id_len;
......@@ -44,7 +44,7 @@ static VALUE rb_transliterator_id_list(VALUE self) {
VALUE rb_curr_id;
id_list_size = 0;
id_list = Transliterator::getAvailableIDs(status);
id_list = icu::Transliterator::getAvailableIDs(status);
if(!U_SUCCESS(status)) {
rb_raise(rb_eArgError, "%s", u_errorName(status));
}
......@@ -78,12 +78,12 @@ static VALUE rb_transliterator_id_list(VALUE self) {
static VALUE rb_transliterator_transliterate(VALUE self, VALUE rb_txt, VALUE rb_id) {
UErrorCode status = U_ZERO_ERROR;
UParseError p_error;
Transliterator *trans;
icu::Transliterator *trans;
const char *txt;
size_t txt_len;
const char *id;
size_t id_len;
UnicodeString *u_txt;
icu::UnicodeString *u_txt;
std::string result;
VALUE rb_out;
......@@ -98,14 +98,14 @@ static VALUE rb_transliterator_transliterate(VALUE self, VALUE rb_txt, VALUE rb_
id = RSTRING_PTR(rb_id);
id_len = RSTRING_LEN(rb_id);
trans = Transliterator::createInstance(UnicodeString(id, id_len), UTRANS_FORWARD, p_error, status);
trans = icu::Transliterator::createInstance(icu::UnicodeString(id, id_len), UTRANS_FORWARD, p_error, status);
if(!U_SUCCESS(status)) {
rb_raise(rb_eArgError, "%s", u_errorName(status));
}
u_txt = new UnicodeString(txt, txt_len);
u_txt = new icu::UnicodeString(txt, txt_len);
trans->transliterate(*u_txt);
StringByteSink<std::string> sink(&result);
icu::StringByteSink<std::string> sink(&result);
u_txt->toUTF8(sink);
delete u_txt;
......
module CharlockHolmes
VERSION = "0.7.5"
VERSION = "0.7.6"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment