Skip to content
Browse files

added Rakefile to ease compilation

  • Loading branch information...
1 parent 6c496e5 commit d398c4df7f2f40e6e13431e0eea4a8b0384ed0c4 @banister banister committed
Showing with 64 additions and 5 deletions.
  1. +57 −0 Rakefile
  2. +4 −4 mixico.gemspec
  3. +3 −1 test/test.rb
View
57 Rakefile
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+direc = File.dirname(__FILE__)
+dlext = Config::CONFIG['DLEXT']
+
+require 'rake/clean'
+require 'rake/gempackagetask'
+require './lib/mixico/version'
+
+CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
+CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
+
+def apply_spec_defaults(s)
+ s.name = "mixico"
+ s.version = Mixico::VERSION
+ s.summary = "mixin hijinks — enable and disable mixins"
+ s.description = s.summary
+ s.files = Dir['COPYING', 'README', '**/*.rb', '**/*.c', '**/*.h']
+ s.authors = ["why the lucky stiff", "Konstantin Haase", "John Mair (banisterfiend)"]
+ s.email = "konstantin.mailinglists@googlemail.com"
+ s.homepage = "http://github.com/rkh/mixico/tree"
+ s.has_rdoc = 'yard'
+end
+
+task :test do
+ sh "bacon -k #{direc}/test/test.rb"
+end
+
+[:mingw32, :mswin32].each do |v|
+ namespace v do
+ spec = Gem::Specification.new do |s|
+ apply_spec_defaults(s)
+ s.platform = "i386-#{v}"
+ s.files += FileList["lib/**/*.#{dlext}"].to_a
+ end
+
+ Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.need_zip = false
+ pkg.need_tar = false
+ end
+ end
+end
+
+namespace :ruby do
+ spec = Gem::Specification.new do |s|
+ apply_spec_defaults(s)
+ s.platform = Gem::Platform::RUBY
+ s.extensions = ["ext/mixico/extconf.rb"]
+ end
+
+ Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.need_zip = false
+ pkg.need_tar = false
+ end
+end
+
+
+
View
8 mixico.gemspec
@@ -7,10 +7,10 @@ spec = Gem::Specification.new do |s|
s.version = Mixico::VERSION
s.summary = "mixin hijinks — enable and disable mixins"
s.description = s.summary
- s.files = Dir['COPYING', 'README', '**/*.rb', '**/*.c', '**/*.h']
-# + ['lib/1.8/mixico.so', 'lib/1.9/mixico.so']
- s.extensions = ["ext/mixico/extconf.rb"]
- #s.platform = 'i386-mswin32'
+ s.files = Dir['COPYING', 'README', '**/*.rb', '**/*.c', '**/*.h'] +
+ ['lib/1.8/mixico.so', 'lib/1.9/mixico.so']
+ #s.extensions = ["ext/mixico/extconf.rb"]
+ s.platform = 'i386-mingw32'
s.authors = ["why the lucky stiff", "Konstantin Haase", "John Mair (banisterfiend)"]
s.email = "konstantin.mailinglists@googlemail.com"
s.homepage = "http://github.com/rkh/mixico/tree"
View
4 test/test.rb
@@ -3,7 +3,9 @@
require 'bacon'
require "#{direc}/../lib/mixico"
-describe "mix_eval" do
+puts "Testing Mixico version #{Mixico::VERSION}..."
+puts "Ruby version #{RUBY_VERSION}"
+describe Mixico do
before do
@m = Module.new {
def hello

0 comments on commit d398c4d

Please sign in to comment.
Something went wrong with that request. Please try again.