Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit b75b18b18d82031f0bbca8e53d8b3b7313200958 0 parents
@tenderlove authored
11 .autotest
@@ -0,0 +1,11 @@
+require 'autotest/restart'
+
+Autotest.add_hook :initialize do |at|
+ at.add_mapping(/.*\.c/) do |f, _|
+ at.files_matching(/test_.*rb$/)
+ end
+end
+
+Autotest.add_hook :run_command do |at|
+ system "rake clean compile"
+end
6 CHANGELOG.rdoc
@@ -0,0 +1,6 @@
+=== 1.0.0 / 2009-12-12
+
+* 1 major enhancement
+
+ * Birthday!
+
9 Manifest.txt
@@ -0,0 +1,9 @@
+.autotest
+CHANGELOG.rdoc
+Manifest.txt
+README.rdoc
+Rakefile
+ext/stree/extconf.rb
+ext/stree/stree.c
+lib/stree.rb
+test/test_stree.rb
48 README.rdoc
@@ -0,0 +1,48 @@
+= stree
+
+* FIX (url)
+
+== DESCRIPTION:
+
+FIX (describe your package)
+
+== FEATURES/PROBLEMS:
+
+* FIX (list of features or problems)
+
+== SYNOPSIS:
+
+ FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+* FIX (sudo gem install, anything else)
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2009 FIX
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 Rakefile
@@ -0,0 +1,23 @@
+# -*- ruby -*-
+
+require 'rubygems'
+require 'hoe'
+
+HOE = Hoe.spec 'stree' do
+ developer('Aaron Patterson', 'aaron@tenderlovemaking.com')
+ self.readme_file = 'README.rdoc'
+ self.history_file = 'CHANGELOG.rdoc'
+ self.extra_rdoc_files = FileList['*.rdoc']
+ self.extra_dev_deps << ['rake-compiler', '>= 0']
+ self.spec_extras = { :extensions => ["ext/stree/extconf.rb"] }
+end
+
+require "rake/extensiontask"
+
+Rake::ExtensionTask.new(HOE.name, HOE.spec) do |ext|
+ ext.lib_dir = File.join('lib', 'stree')
+end
+
+Rake::Task[:test].prerequisites << :compile
+
+# vim: syntax=ruby
2  ext/stree/extconf.rb
@@ -0,0 +1,2 @@
+require 'mkmf'
+create_makefile('stree/stree')
12 ext/stree/stree.c
@@ -0,0 +1,12 @@
+#include <ruby.h>
+
+static VALUE hello_world(VALUE klass)
+{
+ return rb_str_new2("hello world");
+}
+
+void Init_stree()
+{
+ VALUE mStree = rb_define_module("Stree");
+ rb_define_singleton_method(mStree, "hello_world", hello_world, 0);
+}
5 lib/stree.rb
@@ -0,0 +1,5 @@
+require 'stree/stree'
+
+module Stree
+ VERSION = '1.0.0'
+end
8 test/test_stree.rb
@@ -0,0 +1,8 @@
+require "test/unit"
+require "stree"
+
+class TestStree < Test::Unit::TestCase
+ def test_hello_world
+ assert_equal 'hello world', Stree.hello_world
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.