Merge
This commit is contained in:
12
Rakefile
12
Rakefile
@@ -1,6 +1,12 @@
|
|||||||
|
require 'rake/testtask'
|
||||||
|
|
||||||
ROOT = File.dirname(__FILE__)
|
ROOT = File.dirname(__FILE__)
|
||||||
|
|
||||||
task :test do
|
Rake::TestTask.new do |t|
|
||||||
$:.unshift File.join(ROOT, "lib")
|
t.verbose = true
|
||||||
$:.unshift File.join(ROOT, "test")
|
t.test_files = FileList["test/**/t_*.rb"]
|
||||||
|
end
|
||||||
|
|
||||||
|
task :gem do
|
||||||
|
sh "gem build netlinkrb.gemspec"
|
||||||
end
|
end
|
||||||
|
2
debian/control
vendored
2
debian/control
vendored
@@ -3,7 +3,7 @@ Maintainer: Matthew Bloch <matthew@bytemark.co.uk>
|
|||||||
Uploaders: Patrick J Cherry <patrick@bytemark.co.uk>
|
Uploaders: Patrick J Cherry <patrick@bytemark.co.uk>
|
||||||
Section: ruby
|
Section: ruby
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper (>= 7), cdbs, ruby1.8, ruby1.9, ruby-pkg-tools
|
Build-Depends: debhelper (>= 7), cdbs, ruby1.8, ruby1.9.1, ruby-pkg-tools
|
||||||
Standards-Version: 3.8.0
|
Standards-Version: 3.8.0
|
||||||
|
|
||||||
Package: liblinux-netlink-ruby
|
Package: liblinux-netlink-ruby
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
require 'socket'
|
require 'socket'
|
||||||
require 'linux/constants'
|
require 'linux/constants'
|
||||||
require 'ffi'
|
|
||||||
|
begin
|
||||||
|
require 'ffi'
|
||||||
|
rescue LoadError
|
||||||
|
require('rubygems') ? retry : raise
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Good things about FFI::Struct:
|
# Good things about FFI::Struct:
|
||||||
# - robust pre-existing code
|
# - robust pre-existing code
|
||||||
|
@@ -1,7 +1,12 @@
|
|||||||
# Patchup to add Socket#sendmsg and Socket#recvmsg for ruby 1.8
|
# Patchup to add Socket#sendmsg and Socket#recvmsg for ruby 1.8
|
||||||
|
|
||||||
if BasicSocket.instance_methods.grep(/^sendmsg$/).empty?
|
if BasicSocket.instance_methods.grep(/^sendmsg$/).empty?
|
||||||
require 'ffi'
|
begin
|
||||||
|
require 'ffi'
|
||||||
|
rescue LoadError
|
||||||
|
require('rubygems') ? retry : raise
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
class BasicSocket
|
class BasicSocket
|
||||||
module FFIExt
|
module FFIExt
|
||||||
|
17
netlinkrb.gemspec
Normal file
17
netlinkrb.gemspec
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
lib = File.expand_path("../lib", __FILE__)
|
||||||
|
$:.unshift lib unless $:.include? lib
|
||||||
|
|
||||||
|
Gem::Specification.new do |s|
|
||||||
|
s.name = "netlinkrb"
|
||||||
|
s.version = "0.10"
|
||||||
|
s.platform = Gem::Platform::RUBY
|
||||||
|
s.authors = ["Brian Candler", "Patrick Cherry", "Alex Young"]
|
||||||
|
s.email = ["matthew@bytemark.co.uk"]
|
||||||
|
s.summary = "Interface to Linux' Netlink API"
|
||||||
|
s.description = "Ruby native interface to the Netlink API which avoids shelling out to command-line tools as much as possible."
|
||||||
|
s.files = Dir["{lib,examples}/**/*"] + %w{README}
|
||||||
|
s.require_path = "lib"
|
||||||
|
s.add_dependency "ffi"
|
||||||
|
end
|
Reference in New Issue
Block a user