Permalink
Browse files

use jeweler and prepare for release on gemcutter

  • Loading branch information...
1 parent c0fe2cd commit a5973055db0bea5605d19e2e7b0bece13cefc8e5 @pietern committed Feb 10, 2010
Showing with 35 additions and 47 deletions.
  1. +34 −22 Rakefile
  2. +1 −0 VERSION
  3. +0 −1 lib/simple_mmap.rb
  4. +0 −24 lib/simple_mmap/version.rb
View
@@ -1,38 +1,50 @@
-# encoding: utf-8
-
require 'rubygems'
-require 'hoe'
-require './lib/simple_mmap/version.rb'
-require "rake/clean"
-
-Hoe.new('simple_mmap', SimpleMmap::VERSION) do |p|
- p.rubyforge_name = 'simple-mmap'
- p.developer('Johan Sørensen', 'johan@johansorensen.com')
- p.spec_extras = {
- "extensions" => ["Rakefile"]
- }
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "simple-mmap"
+ gem.email = "pcnoordhuis@gmail.com"
+ gem.homepage = "http://github.com/pietern/simple-mmap"
+ gem.authors = ["Johan Sørensen", "Pieter Noordhuis"]
+
+ gem.extensions = ["ext/extconf.rb"]
+ gem.files = FileList['ext/Makefile', 'ext/*.{c,rb}', 'lib/**/*.rb', 'test/**/*.rb']
+ gem.require_paths = ["ext", "lib"]
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
DLEXT = Config::CONFIG['DLEXT']
-
file 'ext/Makefile' => FileList['ext/{*.c,*.h,*.rb}'] do
chdir('ext') { ruby 'extconf.rb' }
end
-CLEAN.include 'ext/Makefile', 'ext/mkmf.log'
file "ext/mapped_file.#{DLEXT}" => FileList['ext/Makefile', 'ext/*.{c,h,rb}'] do |f|
sh 'cd ext && make'
end
-CLEAN.include 'ext/*.{o,bundle,so,dll}'
-file "lib/simple_mmap/mapped_file.#{DLEXT}" => "ext/mapped_file.#{DLEXT}" do |f|
- cp f.prerequisites, "lib/simple_mmap/", :preserve => true
+namespace :ext do
+ task :clean do
+ %W[
+ ext/Makefile
+ ext/mapped_file.#{DLEXT}
+ ].each do |file|
+ sh "rm -f #{file}"
+ end
+ end
+
+ desc 'Build the mapped_file extension'
+ task :build => [:clean, "ext/mapped_file.#{DLEXT}"]
end
-#CLEAN.include "lib/simple_mmap/mapped_file.#{DLEXT}"
-desc 'Build the mapped_file extension'
-task :build => "lib/simple_mmap/mapped_file.#{DLEXT}"
-
-task :test => [:build]
+require 'rake/testtask'
+Rake::TestTask.new(:test => "ext:build") do |test|
+ test.libs << 'ext'
+ test.verbose = true
+end
task :default => :test
View
@@ -0,0 +1 @@
+1.1.0
View
@@ -20,6 +20,5 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
$:.unshift File.dirname(__FILE__)
-require "simple_mmap/version"
require "simple_mmap/mapped_file"
require "simple_mmap/file_window"
@@ -1,24 +0,0 @@
-# Copyright (c) 2009 Johan Sørensen
-#
-# 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.
-
-module SimpleMmap
- VERSION = '1.0.0'
-end

0 comments on commit a597305

Please sign in to comment.