Skip to content

Commit

Permalink
Add real project stuff, like a README and a Rakefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Feb 8, 2010
1 parent f811914 commit 63349fa
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
20 changes: 20 additions & 0 deletions MIT-LICENSE
@@ -0,0 +1,20 @@
Copyright (c) 2010 Nathan Weizenbaum

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.
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@
# rb-kqueue

This is a simple wrapper over the [kqueue](http://en.wikipedia.org/wiki/Kqueue)
BSD event notification interface (supported on FreeBSD, NetBSD, OpenBSD, and Darwin).
It uses the [FFI](http://wiki.github.com/ffi/ffi) gem to avoid having to compile a C extension.
51 changes: 51 additions & 0 deletions Rakefile
@@ -0,0 +1,51 @@
require 'rubygems'
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rb-kqueue"
gem.summary = "A Ruby wrapper for BSD's kqueue, using FFI"
gem.description = gem.summary
gem.email = "nex342@gmail.com"
gem.homepage = "http://github.com/nex3/rb-kqueue"
gem.authors = ["Nathan Weizenbaum"]
gem.add_dependency "ffi", ">= 0.5.0"
gem.add_development_dependency "yard", ">= 0.4.0"
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

module Jeweler::VersionHelper::PlaintextExtension
def write_with_inotify
write_without_inotify
filename = File.join(File.dirname(__FILE__), "lib/rb-kqueue.rb")
text = File.read(filename)
File.open(filename, 'w') do |f|
f.write text.gsub(/^( VERSION = ).*/, '\1' + [major, minor, patch].inspect)
end
end
alias_method :write_without_inotify, :write
alias_method :write, :write_with_inotify
end

class Jeweler::Commands::Version::Base
def commit_version_with_inotify
return unless self.repo
self.repo.add(File.join(File.dirname(__FILE__), "lib/rb-kqueue.rb"))
commit_version_without_inotify
end
alias_method :commit_version_without_inotify, :commit_version
alias_method :commit_version, :commit_version_with_inotify
end

begin
require 'yard'
YARD::Rake::YardocTask.new
rescue LoadError
task :yardoc do
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
end
end
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
0.0.0
2 changes: 2 additions & 0 deletions lib/rb-kqueue.rb
Expand Up @@ -8,6 +8,8 @@
require 'rb-kqueue/queue'

module KQueue
VERSION = [0, 0, 0]

def self.handle_error(errno = FFI.errno)
raise SystemCallError.new(
"KQueue failed" +
Expand Down

0 comments on commit 63349fa

Please sign in to comment.