diff options
-rw-r--r-- | .document | 11 | ||||
-rw-r--r-- | .gitignore | 40 | ||||
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | LICENSE | 12 | ||||
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | Rakefile | 42 | ||||
-rw-r--r-- | bin/net-dhcp (renamed from lib/net/main.rb) | 0 | ||||
-rw-r--r-- | lib/net-dhcp.rb | 2 | ||||
-rw-r--r-- | lib/net-dhcp/version.rb | 5 | ||||
-rw-r--r-- | lib/net/Rakefile.rb | 17 | ||||
-rw-r--r-- | net-dhcp.gemspec | 35 | ||||
-rw-r--r-- | spec/net-dhcp_spec.rb | 7 | ||||
-rw-r--r-- | spec/spec_helper.rb | 19 |
13 files changed, 178 insertions, 17 deletions
diff --git a/.document b/.document new file mode 100644 index 0000000..1bd5d94 --- /dev/null +++ b/.document @@ -0,0 +1,11 @@ +# .document is used by rdoc and yard to know how to generate documentation +# for example, it can be used to control how rdoc gets built when you do `gem install foo` + +README.rdoc +lib/**/*.rb +bin/* + +# Files below this - are treated as 'extra files', and aren't parsed for ruby code +- +features/**/*.feature +LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1d1987 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +*.gem +.bundle +Gemfile.lock +pkg/* +# rcov generated +coverage + +# rdoc generated +rdoc + +# yard generated +doc +.yardoc + +# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore: +# +# * Create a file at ~/.gitignore +# * Include files you want ignored +# * Run: git config --global core.excludesfile ~/.gitignore +# +# After doing this, these files will be ignored in all your git projects, +# saving you from having to 'pollute' every project you touch with them +# +# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line) +# +# For MacOS: +# +#.DS_Store +# +# For TextMate +#*.tmproj +#tmtags +# +# For emacs: +#*~ +#\#* +#.\#* +# +# For vim: +#*.swp @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +# Specify your gem's dependencies in net-dhcp.gemspec +gemspec @@ -0,0 +1,12 @@ +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. @@ -1,5 +1,6 @@ Net::DHCP library for ruby, originally written by etd. Fork to github by syonbori. +Additional fork and gemification by mjtko. Here is original README: The svn repository for Net::DHCP contains the project files to use with NetBeans IDE. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..14e12d5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,42 @@ +require 'rubygems' + +begin + require 'bundler' +rescue LoadError + $stderr.puts "You must install bundler - run `gem install bundler`" +end + +begin + Bundler.setup +rescue Bundler::BundlerError => e + $stderr.puts e.message + $stderr.puts "Run `bundle install` to install missing gems" + exit e.status_code +end +require 'rake' + +require 'bueller' +Bueller::Tasks.new + +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new(:examples) do |examples| + examples.rspec_opts = '-Ispec' +end + +RSpec::Core::RakeTask.new(:rcov) do |spec| + spec.rspec_opts = '-Ispec' + spec.rcov = true +end + +task :default => :examples + +require 'rake/rdoctask' +Rake::RDocTask.new do |rdoc| + version = File.exist?('VERSION') ? File.read('VERSION') : "" + + rdoc.main = 'README.rdoc' + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "net-dhcp #{version}" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/lib/net/main.rb b/bin/net-dhcp index 9eaa3c5..9eaa3c5 100644 --- a/lib/net/main.rb +++ b/bin/net-dhcp diff --git a/lib/net-dhcp.rb b/lib/net-dhcp.rb new file mode 100644 index 0000000..221418d --- /dev/null +++ b/lib/net-dhcp.rb @@ -0,0 +1,2 @@ +require 'net-dhcp/version' +require 'net/dhcp' diff --git a/lib/net-dhcp/version.rb b/lib/net-dhcp/version.rb new file mode 100644 index 0000000..b3634e7 --- /dev/null +++ b/lib/net-dhcp/version.rb @@ -0,0 +1,5 @@ +module Net + module Dhcp + VERSION = "0.0.1" + end +end diff --git a/lib/net/Rakefile.rb b/lib/net/Rakefile.rb deleted file mode 100644 index 9348669..0000000 --- a/lib/net/Rakefile.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Rakefile.rb -# 4 de octubre de 2007 -# - -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -task :test do - test_task = Rake::TestTask.new("test_all") do |t| - #t.libs << "../test/" - t.test_files = "../test/*" - t.verbose = true - end - - task("test_all").execute -end
\ No newline at end of file diff --git a/net-dhcp.gemspec b/net-dhcp.gemspec new file mode 100644 index 0000000..05e5a87 --- /dev/null +++ b/net-dhcp.gemspec @@ -0,0 +1,35 @@ +$:.push File.expand_path("../lib", __FILE__) +require 'net-dhcp/version' + +Gem::Specification.new do |s| + s.name = 'net-dhcp' + s.version = NetDhcp::VERSION + s.platform = Gem::Platform::RUBY + s.date = '2011-11-17' + s.authors = ['daniel martin gomez (etd)', 'syonbori', 'Mark J. Titorenko'] + s.email = 'mark.titorenko@alces-software.com' + s.homepage = 'http://github.com/mjtko/net-dhcp' + s.summary = %Q{set of classes to low level handle the DHCP protocol} + s.description = %Q{The aim of Net::DHCP is to provide a set of classes to low level handle the DHCP protocol (rfc2131, rfc2132, etc.). With Net::DHCP you will be able to craft custom DHCP packages and have access to all the fields defined for the protocol.} + s.extra_rdoc_files = [ + 'LICENSE', + 'README', + ] + + s.required_rubygems_version = Gem::Requirement.new('>= 1.3.7') + s.rubygems_version = '1.3.7' + s.specification_version = 3 + + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ['lib'] + + s.add_runtime_dependency 'pcap', '~> 0.7.0' + s.add_development_dependency 'rspec' + s.add_development_dependency 'bundler' + s.add_development_dependency 'bueller' + s.add_development_dependency 'rake' + s.add_development_dependency 'rcov' +end + diff --git a/spec/net-dhcp_spec.rb b/spec/net-dhcp_spec.rb new file mode 100644 index 0000000..e5bd552 --- /dev/null +++ b/spec/net-dhcp_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe NetDhcp do + it "fails" do + fail "hey buddy, you should probably rename this file and start specing for real" + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..4b8488f --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,19 @@ +require 'bundler' +begin + Bundler.setup +rescue Bundler::BundlerError => e + $stderr.puts e.message + $stderr.puts "Run `bundle install` to install missing gems" + exit e.status_code +end + +require 'rspec' +require 'net-dhcp' + +# Requires supporting files with custom matchers and macros, etc, +# in ./support/ and its subdirectories. +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} + +RSpec.configure do |config| + +end |