Skip to content

Commit

Permalink
Move extension files into separate subdirectory (and sync with window…
Browse files Browse the repository at this point in the history
…s branch). (Release as 0.4.3.1)

(Closes #4)
  • Loading branch information
blackwinter committed Jan 12, 2013
1 parent c461b63 commit 70ce3a2
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 23 deletions.
14 changes: 0 additions & 14 deletions MANIFEST

This file was deleted.

23 changes: 23 additions & 0 deletions Rakefile
@@ -0,0 +1,23 @@
require "rake/clean"
require "rake/extensiontask"
require "rubygems/package_task"

CLEAN << "pkg" << "tmp" << "lib/unicode"

gem_spec = eval(File.read(File.expand_path("../unicode.gemspec", __FILE__)))

Gem::PackageTask.new(gem_spec) {|pkg|}

Rake::ExtensionTask.new('unicode_native', gem_spec) do |ext|
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
ext.ext_dir = "ext/unicode"
ext.lib_dir = "lib/unicode"
end

desc "Build native gems for Windows"
task :windows_gem => :clean do
ENV["RUBY_CC_VERSION"] = "1.8.7:1.9.3"
sh "rake cross compile"
sh "rake cross native gem"
end
3 changes: 3 additions & 0 deletions ext/unicode/extconf.rb
@@ -0,0 +1,3 @@
require 'mkmf'

create_makefile("unicode/unicode_native")
2 changes: 1 addition & 1 deletion unicode.c → ext/unicode/unicode.c
Expand Up @@ -1230,7 +1230,7 @@ unicode_get_text_elements(VALUE obj, VALUE str)
}

void
Init_unicode()
Init_unicode_native()
{
int i;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions extconf.rb

This file was deleted.

6 changes: 6 additions & 0 deletions lib/unicode.rb
@@ -0,0 +1,6 @@
begin
RUBY_VERSION =~ /(\d+.\d+)/
require "unicode/#{$1}/unicode_native"
rescue LoadError
require 'unicode/unicode_native'
end
File renamed without changes.
15 changes: 10 additions & 5 deletions unicode.gemspec
Expand Up @@ -2,17 +2,22 @@

Gem::Specification.new do |s|
s.name = %q{unicode}
s.version = "0.4.3"
s.version = "0.4.3.1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Yoshida Masato}]
s.date = %q{2012-08-07}
s.email = %q{yoshidam@yoshidam.net}
s.extensions = [%q{extconf.rb}]
s.extra_rdoc_files = [%q{README}]
s.files = [%q{extconf.rb}, %q{unicode.c}, %q{ustring.c}, %q{ustring.h}, %q{wstring.c}, %q{wstring.h}, %q{README}, %q{tools/mkunidata.rb}, %q{tools/normtest.rb}, %q{tools/README}, %q{unidata.map}]
s.extensions = %w[ext/unicode/extconf.rb]
s.extra_rdoc_files = %w[README]
s.files = %w[
README Rakefile unicode.gemspec lib/unicode.rb
test/test.rb tools/README tools/mkunidata.rb tools/normtest.rb
ext/unicode/extconf.rb ext/unicode/unicode.c ext/unicode/unidata.map
ext/unicode/ustring.c ext/unicode/ustring.h ext/unicode/wstring.c ext/unicode/wstring.h
]
s.homepage = %q{http://www.yoshidam.net/Ruby.html#unicode}
s.require_paths = [%q{.}]
s.require_paths = %w[lib]
s.rubygems_version = %q{1.8.6}
s.summary = %q{Unicode normalization library.}
s.description = %q{Unicode normalization library.}
Expand Down

0 comments on commit 70ce3a2

Please sign in to comment.