summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/g/mrblib_example
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-09-21 19:56:28 +0800
committerDaniel Bovensiepen <[email protected]>2012-09-21 19:56:28 +0800
commitd6f2f55b46ceddd986e7ba42fb8269aef0ca8e77 (patch)
tree9e3a405436789e9c782a6c4c00eafed4301df809 /mrbgems/g/mrblib_example
parentf93572c531c1e69dc0c5d2c2bfd03fc83044158c (diff)
downloadmruby-d6f2f55b46ceddd986e7ba42fb8269aef0ca8e77.tar.gz
mruby-d6f2f55b46ceddd986e7ba42fb8269aef0ca8e77.zip
Add Support for Ruby Extensions, C Extensions and Test Integration
Diffstat (limited to 'mrbgems/g/mrblib_example')
-rw-r--r--mrbgems/g/mrblib_example/Makefile7
-rw-r--r--mrbgems/g/mrblib_example/README.md4
-rw-r--r--mrbgems/g/mrblib_example/mrblib/mrblib_example.rb5
-rw-r--r--mrbgems/g/mrblib_example/test/mrblib_example.rb3
4 files changed, 19 insertions, 0 deletions
diff --git a/mrbgems/g/mrblib_example/Makefile b/mrbgems/g/mrblib_example/Makefile
new file mode 100644
index 000000000..a43677842
--- /dev/null
+++ b/mrbgems/g/mrblib_example/Makefile
@@ -0,0 +1,7 @@
+include ../../Makefile4gem
+
+GEM := mrblib_example
+
+gem-all :
+
+gem-clean :
diff --git a/mrbgems/g/mrblib_example/README.md b/mrbgems/g/mrblib_example/README.md
new file mode 100644
index 000000000..42792567f
--- /dev/null
+++ b/mrbgems/g/mrblib_example/README.md
@@ -0,0 +1,4 @@
+hello world
+=========
+
+This is an example gem which implements just one method +HW.say+ in a C extension.
diff --git a/mrbgems/g/mrblib_example/mrblib/mrblib_example.rb b/mrbgems/g/mrblib_example/mrblib/mrblib_example.rb
new file mode 100644
index 000000000..444f32236
--- /dev/null
+++ b/mrbgems/g/mrblib_example/mrblib/mrblib_example.rb
@@ -0,0 +1,5 @@
+class MRBLib
+ def MRBLib.mrblib_method
+ puts "A Ruby Extension"
+ end
+end
diff --git a/mrbgems/g/mrblib_example/test/mrblib_example.rb b/mrbgems/g/mrblib_example/test/mrblib_example.rb
new file mode 100644
index 000000000..40189ffdd
--- /dev/null
+++ b/mrbgems/g/mrblib_example/test/mrblib_example.rb
@@ -0,0 +1,3 @@
+assert('MRBLib extension') do
+ MRBLib.respond_to? :mrblib_method
+end