Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 17b2fa9f5d34f6d86d46ccd87ea4293ba2d4de21 0 parents
@tenderlove authored
23 .autotest
@@ -0,0 +1,23 @@
+# -*- ruby -*-
+
+require 'autotest/restart'
+
+# Autotest.add_hook :initialize do |at|
+# at.extra_files << "../some/external/dependency.rb"
+#
+# at.libs << ":../some/external"
+#
+# at.add_exception 'vendor'
+#
+# at.add_mapping(/dependency.rb/) do |f, _|
+# at.files_matching(/test_.*rb$/)
+# end
+#
+# %w(TestA TestB).each do |klass|
+# at.extra_class_map[klass] = "test/test_misc.rb"
+# end
+# end
+
+# Autotest.add_hook :run_command do |at|
+# system "rake build"
+# end
6 CHANGELOG.rdoc
@@ -0,0 +1,6 @@
+=== 1.0.0 / 2010-01-19
+
+* 1 major enhancement
+
+ * Birthday!
+
7 Manifest.txt
@@ -0,0 +1,7 @@
+History.txt
+Manifest.txt
+README.txt
+Rakefile
+bin/deebee
+lib/deebee.rb
+test/test_deebee.rb
48 README.rdoc
@@ -0,0 +1,48 @@
+= deebee
+
+* 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) 2010 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.
20 Rakefile
@@ -0,0 +1,20 @@
+# -*- ruby -*-
+
+require 'rubygems'
+require 'hoe'
+require "rake/extensiontask"
+
+Hoe.plugin :debugging, :doofus, :git
+
+Hoe.spec 'deebee' do
+ developer 'Aaron Patterson', 'aaronp@rubyforge.org'
+ self.readme_file = 'README.rdoc'
+ self.history_file = 'CHANGELOG.rdoc'
+ self.extra_rdoc_files = FileList['*.rdoc']
+
+ Rake::ExtensionTask.new "deebee", spec do |ext|
+ ext.lib_dir = File.join(*['lib', 'deebee', ENV['FAT_DIR']].compact)
+ end
+end
+
+# vim: syntax=ruby
16 ext/deebee/deebee.c
@@ -0,0 +1,16 @@
+#include <deebee.h>
+
+VALUE mSqlite3;
+VALUE cDeeBee;
+
+static VALUE libversion(VALUE self)
+{
+ return INT2NUM(sqlite3_libversion_number());
+}
+
+void Init_deebee()
+{
+ mSqlite3 = rb_define_module("SQLite3");
+ cDeeBee = rb_define_class_under(mSqlite3, "DeeBee", rb_cObject);
+ rb_define_singleton_method(cDeeBee, "libversion", libversion, 0);
+}
7 ext/deebee/deebee.h
@@ -0,0 +1,7 @@
+#ifndef DEEBEE
+#define DEEBEE
+
+#include <ruby.h>
+#include <sqlite3.h>
+
+#endif
22 ext/deebee/extconf.rb
@@ -0,0 +1,22 @@
+ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/
+
+require 'mkmf'
+
+# :stopdoc:
+
+RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+
+$CFLAGS << ' -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion' <<
+ ' -Wmissing-noreturn -Winline'
+
+sqlite = dir_config 'sqlite3', '/opt/local/include', '/opt/local/lib'
+
+def asplode missing
+ abort "#{missing} is missing. Try 'port install sqlite3 +universal' " +
+ "or 'yum install sqlite3-devel'"
+end
+
+asplode('sqlite3.h') unless find_header 'sqlite3.h'
+asplode('sqlite3') unless find_library 'sqlite3', 'sqlite3_libversion_number'
+
+create_makefile('deebee')
7 lib/deebee.rb
@@ -0,0 +1,7 @@
+require 'deebee/deebee'
+
+module SQLite3
+ class DeeBee
+ VERSION = '1.0.0'
+ end
+end
8 test/test_deebee.rb
@@ -0,0 +1,8 @@
+require "test/unit"
+require "deebee"
+
+class TestDeebee < Test::Unit::TestCase
+ def test_libversione
+ assert_not_nil SQLite3::DeeBee.libversion
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.