summaryrefslogtreecommitdiffhomepage
path: root/sample
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-23 11:42:28 -0300
committerSeba Gamboa <[email protected]>2015-09-23 11:42:37 -0300
commit731c5326b47b34364b2a8f69c6d558f52957a562 (patch)
tree213d83fe80cd4ab7922e5e0879d3bcbd01db9a8a /sample
parenta88dcf7f44898495fd2d2535ec0c4508a4458c38 (diff)
downloadyard-mruby-731c5326b47b34364b2a8f69c6d558f52957a562.tar.gz
yard-mruby-731c5326b47b34364b2a8f69c6d558f52957a562.zip
Detecting classes and methods from C sources
Diffstat (limited to 'sample')
-rw-r--r--sample/.yardopts4
-rw-r--r--sample/README.md2
-rw-r--r--sample/src/sample.c8
3 files changed, 9 insertions, 5 deletions
diff --git a/sample/.yardopts b/sample/.yardopts
index 3b09c69..41b06ea 100644
--- a/sample/.yardopts
+++ b/sample/.yardopts
@@ -1 +1,3 @@
-mrblib/**/*.rb - README.md LICENSE.txt
+--plugin mruby
+mrblib/**/*.rb
+src/**/*.c
diff --git a/sample/README.md b/sample/README.md
index 1dea126..657e051 100644
--- a/sample/README.md
+++ b/sample/README.md
@@ -1,4 +1,4 @@
-# sample
+# Sample MRuby GEM
TODO: Write your README
diff --git a/sample/src/sample.c b/sample/src/sample.c
index 43a9e3a..e5cbae7 100644
--- a/sample/src/sample.c
+++ b/sample/src/sample.c
@@ -11,6 +11,8 @@ void sample_deprecated_method( void )
/**
* A sample Ruby method defined from C
+ *
+ * @return [String] Hello World!
*/
mrb_value mrb_Sample_Hello__world(mrb_state *mrb, mrb_value self)
{
@@ -20,9 +22,9 @@ mrb_value mrb_Sample_Hello__world(mrb_state *mrb, mrb_value self)
void
mrb_sample_gem_init(mrb_state *mrb)
{
- struct RClass *Sample = mrb_define_module(mrb, "Sample");
- struct RClass *Sample_Hello = mrb_define_class_under(mrb, Sample, "Hello", mrb->object_class);
- mrb_define_method(mrb,Sample_Hello, "world", mrb_Sample_Hello__world, MRB_ARGS_NONE() );
+ struct RClass *ns = mrb_define_module(mrb, "Sample");
+ struct RClass *cl = mrb_define_class_under(mrb, ns, "Hello", mrb->object_class);
+ mrb_define_method(mrb,cl, "world", mrb_Sample_Hello__world, MRB_ARGS_NONE() );
}
void