Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding version and test case

  • Loading branch information...
commit 9ad71a372518d12149592da6aceb5273f21c6a38 1 parent 848900f
@tenderlove authored
View
13 .gitignore
@@ -1,12 +1,7 @@
.*.swp
*.tmproj
-ext/nokogiri/*.o
-ext/nokogiri/Makefile
-ext/nokogiri/*.log
-ext/nokogiri/*.bundle
-ext/nokogiri/*.a
-ext/nokogiri/*.so
-ext/nokogiri/conftest.dSYM
-lib/nokogiri/css/generated_parser.rb
-lib/nokogiri/css/generated_tokenizer.rb
+vendor/zmq-0.3/
+vendor/bin/
+vendor/include/
+vendor/lib/
tags
View
38 Rakefile
@@ -2,10 +2,44 @@
require 'rubygems'
require 'hoe'
-require './lib/quail.rb'
+require './lib/quail/version'
-Hoe.new('quail', Quail::VERSION) do |p|
+kind = Config::CONFIG['DLEXT']
+
+EXT = "ext/quail/native.#{kind}"
+HOE = Hoe.new('quail', Quail::VERSION) do |p|
p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
+ p.clean_globs = [
+ 'ext/quail/Makefile',
+ 'ext/quail/*.{o,so,bundle,a,dylib,log}',
+ ]
end
+namespace :build do
+ file 'ext/quail/Makefile' do
+ Dir.chdir('ext/quail') do
+ ruby 'extconf.rb'
+ end
+ end
+
+ file EXT => ['vendor/lib/libzmq.a', 'ext/quail/Makefile'] do
+ Dir.chdir('ext/quail') do
+ sh 'make'
+ end
+ end
+
+ file "vendor/lib/libzmq.a" do
+ prefix = File.join(File.dirname(__FILE__), 'vendor')
+ Dir.chdir('vendor/zmq-0.3') do
+ sh "./configure --prefix=#{prefix}"
+ sh "make"
+ sh "make install"
+ end
+ end
+
+ task :all => [EXT]
+end
+
+task :build => ["build:all"]
+
# vim: syntax=Ruby
View
4 lib/quail.rb
@@ -1,3 +1 @@
-class Quail
- VERSION = '1.0.0'
-end
+require 'quail/native'
View
3  lib/quail/version.rb
@@ -0,0 +1,3 @@
+module Quail
+ VERSION = '0.0.0'
+end
View
13 test/helper.rb
@@ -0,0 +1,13 @@
+require 'test/unit'
+
+%w(../lib ../ext).each do |path|
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), path)))
+end
+
+require 'quail'
+
+module Quail
+ class TestCase < Test::Unit::TestCase
+ undef :default_test
+ end
+end
View
11 test/test_quail.rb
@@ -0,0 +1,11 @@
+require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
+
+class TestQuail < Quail::TestCase
+ def test_constant_global
+ assert_equal(1, Quail::GLOBAL)
+ end
+
+ def test_constant_local
+ assert_equal(0, Quail::LOCAL)
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.