[DRE-commits] [SCM] gem2deb.git branch, master, updated. debian/0.2.3-48-gae05bb2
Antonio Terceiro
terceiro at softwarelivre.org
Sat Jul 9 05:51:12 UTC 2011
The following commit has been merged in the master branch:
commit 87dec109ac067b2ac4b2c5d785e66b82c24fdb3c
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Sun Jul 3 14:32:40 2011 -0700
Add a sample project with name clash
diff --git a/test/sample/simpleextension/Rakefile b/test/sample/simpleextension_with_name_clash/Rakefile
similarity index 76%
copy from test/sample/simpleextension/Rakefile
copy to test/sample/simpleextension_with_name_clash/Rakefile
index ebf5ccb..338cda6 100644
--- a/test/sample/simpleextension/Rakefile
+++ b/test/sample/simpleextension_with_name_clash/Rakefile
@@ -3,12 +3,12 @@ require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
- s.summary = "Simple native extension used to test dh_ruby"
- s.name = 'simpleextension'
+ s.summary = "Simple native extension with .rb/.so name clash used to test dh_ruby"
+ s.name = 'simpleextension_with_name_clash'
s.version = '1.2.3'
s.requirements << 'none'
s.require_path = 'ext'
- s.extensions << 'ext/simpleextension/extconf.rb'
+ s.extensions << 'ex'
#s.autorequire = 'rake'
s.files = Dir.glob('{bin,ext}/**/*')
s.description = <<EOF
diff --git a/test/sample/simpleextension_with_name_clash/debian/ruby-tests.rake b/test/sample/simpleextension_with_name_clash/debian/ruby-tests.rake
new file mode 100644
index 0000000..10bf04e
--- /dev/null
+++ b/test/sample/simpleextension_with_name_clash/debian/ruby-tests.rake
@@ -0,0 +1,5 @@
+require 'rake/testtask'
+
+Rake::TestTask.new(:default) do |t|
+ t.test_files = 'test/simpleextension_with_name_clash_test.rb'
+end
diff --git a/test/sample/simpleextension_with_name_clash/ext/extconf.rb b/test/sample/simpleextension_with_name_clash/ext/extconf.rb
new file mode 100644
index 0000000..a60f380
--- /dev/null
+++ b/test/sample/simpleextension_with_name_clash/ext/extconf.rb
@@ -0,0 +1,2 @@
+require 'mkmf'
+create_makefile('simpleextension_with_name_clash')
diff --git a/test/sample/simpleextension_with_name_clash/ext/simpleextension_with_name_clash.c b/test/sample/simpleextension_with_name_clash/ext/simpleextension_with_name_clash.c
new file mode 100644
index 0000000..0c0b050
--- /dev/null
+++ b/test/sample/simpleextension_with_name_clash/ext/simpleextension_with_name_clash.c
@@ -0,0 +1,14 @@
+#include "ruby.h"
+
+VALUE method_answer42(VALUE module, VALUE self);
+
+void Init_simpleextension_with_name_clash() {
+ VALUE SimpleExtensionWithNameClass = rb_define_module("SimpleExtensionWithNameClash");
+ rb_define_module_function(SimpleExtensionWithNameClass, "answer42", method_answer42, 0);
+ rb_define_const(SimpleExtensionWithNameClass, "Hello_world", rb_str_new2("Hello World"));
+}
+
+VALUE method_answer42(VALUE module, VALUE self) {
+ VALUE answer = rb_const_get(module, rb_intern("ANSWER_42"));
+ return answer;
+}
diff --git a/test/sample/simpleextension_with_name_clash/lib/simpleextension_with_name_clash.rb b/test/sample/simpleextension_with_name_clash/lib/simpleextension_with_name_clash.rb
new file mode 100644
index 0000000..55e08c9
--- /dev/null
+++ b/test/sample/simpleextension_with_name_clash/lib/simpleextension_with_name_clash.rb
@@ -0,0 +1,5 @@
+require 'simpleextension_with_name_clash.so'
+
+module SimpleExtensionWithNameClash
+ ANSWER_42 = 42
+end
diff --git a/test/sample/simpleextension_with_name_clash/test/simpleextension_with_name_clash_test.rb b/test/sample/simpleextension_with_name_clash/test/simpleextension_with_name_clash_test.rb
new file mode 100644
index 0000000..60cba43
--- /dev/null
+++ b/test/sample/simpleextension_with_name_clash/test/simpleextension_with_name_clash_test.rb
@@ -0,0 +1,8 @@
+require 'test/unit'
+require 'simpleextension_with_name_clash'
+
+class SimpleExtensionWithNameClashTest < Test::Unit::TestCase
+ def test_simple
+ assert_equal 42, SimpleExtensionWithNameClash.answer42
+ end
+end
--
gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list