unf_ext 0.0.3 → 0.0.4

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/Gemfile CHANGED
@@ -10,4 +10,5 @@ group :development do
10
10
  gem "bundler", "~> 1.0.0"
11
11
  gem "jeweler", "~> 1.6.4"
12
12
  gem "rcov", ">= 0"
13
+ gem "rake-compiler", ">= 0.7.9"
13
14
  end
data/README.md CHANGED
@@ -29,7 +29,7 @@ Requirement
29
29
  Installation
30
30
  ------------
31
31
 
32
- gem install unf
32
+ gem install unf_ext
33
33
 
34
34
  Or:
35
35
 
data/Rakefile CHANGED
@@ -22,10 +22,21 @@ Jeweler::Tasks.new do |gem|
22
22
  gem.email = "knu@idaemons.org"
23
23
  gem.authors = ["Takeru Ohta", "Akinori MUSHA"]
24
24
  # dependencies defined in Gemfile
25
- gem.extensions << "extconf.rb"
26
25
  end
27
26
  Jeweler::RubygemsDotOrgTasks.new
28
27
 
28
+ def generated_gemspec
29
+ eval(File.read(Rake.application.jeweler.gemspec_helper.path))
30
+ rescue
31
+ nil
32
+ end
33
+
34
+ require 'rake/extensiontask'
35
+ Rake::ExtensionTask.new('unf_ext', generated_gemspec) do |ext|
36
+ ext.cross_compile = true
37
+ ext.cross_platform = 'x86-mingw32'
38
+ end
39
+
29
40
  require 'rake/testtask'
30
41
  Rake::TestTask.new(:test) do |test|
31
42
  test.libs << 'lib' << 'test'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -0,0 +1,25 @@
1
+ require 'mkmf'
2
+ have_library('stdc++')
3
+ have_header('ruby/encoding.h')
4
+ create_makefile 'unf_ext'
5
+
6
+ unless CONFIG['CXX']
7
+ case CONFIG['CC']
8
+ when %r{((?:.*[-/])?)gcc([-0-9.]*)$}
9
+ cxx = $1 + 'g++' + $2
10
+ when %r{((?:.*[-/])?)clang([-0-9.]*)$}
11
+ cxx = $1 + 'clang++' + $2
12
+ else
13
+ cxx = CONFIG['CC']
14
+ end
15
+
16
+ warn "CXX is automatically set to #{cxx}"
17
+
18
+ new_mf = <<-EOF << File.read('Makefile')
19
+ CXX=#{cxx}
20
+ EOF
21
+
22
+ File.open('Makefile', 'w') { |mf|
23
+ mf.print new_mf
24
+ }
25
+ end
@@ -17,12 +17,12 @@ namespace UNF {
17
17
 
18
18
  public:
19
19
  Normalizer()
20
- : nf_d(TABLE::CANONICAL_DECOM_NODES, TABLE::VALUE),
21
- nf_kd(TABLE::COMPATIBILITY_DECOM_NODES, TABLE::VALUE),
22
- nf_c(TABLE::CANONICAL_COM_NODES, TABLE::VALUE),
23
- nf_c_qc(TABLE::NFC_ILLEGAL_NODES),
24
- nf_kc_qc(TABLE::NFKC_ILLEGAL_NODES),
25
- ccc(TABLE::CANONICAL_CLASS_NODES)
20
+ : nf_d(TABLE::NODES, TABLE::CANONICAL_DECOM_ROOT, TABLE::STRINGS),
21
+ nf_kd(TABLE::NODES, TABLE::COMPATIBILITY_DECOM_ROOT, TABLE::STRINGS),
22
+ nf_c(TABLE::NODES, TABLE::CANONICAL_COM_ROOT, TABLE::STRINGS),
23
+ nf_c_qc(TABLE::NODES, TABLE::NFC_ILLEGAL_ROOT),
24
+ nf_kc_qc(TABLE::NODES, TABLE::NFKC_ILLEGAL_ROOT),
25
+ ccc(TABLE::NODES, TABLE::CANONICAL_CLASS_ROOT)
26
26
  {}
27
27
 
28
28
  const char* normalize(const char* src, Form form) {