summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Rodrigues <mikebrodrigues@gmail.com>2014-01-02 04:11:56 -0800
committerMichael Rodrigues <mikebrodrigues@gmail.com>2014-01-02 04:11:56 -0800
commit30a1c390fbba74505fbb158bd598ee8b69c7bfc1 (patch)
tree455464e3ac59a80c2126eb317c95ba787366234b
parent4fd29445f5c85cf727d69e08cf9fa9fd5f003b8a (diff)
parented6c8826cb565fff712e72888112623a383016ce (diff)
downloadnet-dhcp-ruby-30a1c390fbba74505fbb158bd598ee8b69c7bfc1.tar.gz
merged master
-rw-r--r--CHANGELOG8
-rw-r--r--lib/net-dhcp/version.rb2
-rw-r--r--lib/net/dhcp/core.rb12
-rw-r--r--lib/net/dhcp/options.rb2
-rw-r--r--net-dhcp.gemspec8
5 files changed, 17 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0bff925..1fb428c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+*1.2.0
+
+* Fix Array handling for message payloads [presto53]
+* Use a raise syntax that isn't archaic [presto53]
+* Depend on simplecov rather than rcov for Ruby 1.9+ compat [mjtko]
+
*1.1.1
* Replace incorrect equality check with assignment in Message#from_udp_payload to correct behaviour when an unrecognised option or message is encountered [mjtko]
@@ -20,4 +26,4 @@
*1.0.0
-* Initial release to rubygems - originally authored by etd, migrated to github by syonbori, gemified by mjtko. [mjtko] \ No newline at end of file
+* Initial release to rubygems - originally authored by etd, migrated to github by syonbori, gemified by mjtko. [mjtko]
diff --git a/lib/net-dhcp/version.rb b/lib/net-dhcp/version.rb
index 49af37d..32d72b8 100644
--- a/lib/net-dhcp/version.rb
+++ b/lib/net-dhcp/version.rb
@@ -1,5 +1,5 @@
module Net
module Dhcp
- VERSION = "1.1.1"
+ VERSION = "1.2.0"
end
end
diff --git a/lib/net/dhcp/core.rb b/lib/net/dhcp/core.rb
index b0266f9..81cc130 100644
--- a/lib/net/dhcp/core.rb
+++ b/lib/net/dhcp/core.rb
@@ -108,7 +108,7 @@ module DHCP
# message operation and options. We need at least an operation and a
# MessageTypeOption to create a DHCP message!!
if (([:op, :options] & params.keys).size != 2)
- raise ArgumentError('you need to specify at least values for :op and :options')
+ raise ArgumentError, 'you need to specify at least values for :op and :options'
end
self.op = params[:op]
@@ -119,7 +119,7 @@ module DHCP
next unless opt.class == MessageTypeOption
found = true
end
- raise ArgumentError(':options must include a MessageTypeOption') unless found
+ raise ArgumentError, ':options must include a MessageTypeOption' unless found
#hardware type and length of the hardware address
self.htype = params.fetch(:htype, $DHCP_HTYPE_ETHERNET)
@@ -293,7 +293,7 @@ module DHCP
class Request < Message
def initialize(params={})
params[:op] = $DHCP_OP_REQUEST
- params[:options] = params.fetch(:options, [MessageTypeOption.new({:payload=>$DHCP_MSG_REQUEST}), ParameterRequestListOption.new])
+ params[:options] = params.fetch(:options, [MessageTypeOption.new({:payload=>[$DHCP_MSG_REQUEST]}), ParameterRequestListOption.new])
super(params)
end
end
@@ -311,7 +311,7 @@ module DHCP
def initialize(params={})
params[:op] = $DHCP_OP_REPLY
params[:options] = params.fetch(:options, [
- MessageTypeOption.new({:payload=>$DHCP_MSG_ACK}),
+ MessageTypeOption.new({:payload=>[$DHCP_MSG_ACK]}),
ServerIdentifierOption.new,
DomainNameOption.new
])
@@ -331,7 +331,7 @@ module DHCP
def initialize(params={})
params[:op] = $DHCP_OP_REQUEST
params[:options] = params.fetch(:options, [
- MessageTypeOption.new({:payload=>$DHCP_MSG_RELEASE}),
+ MessageTypeOption.new({:payload=>[$DHCP_MSG_RELEASE]}),
ServerIdentifierOption.new
])
super(params)
@@ -343,7 +343,7 @@ module DHCP
class Inform < Message
def initialize(params={})
params[:op] = $DHCP_OP_REQUEST
- params[:options] = params.fetch(:options, [MessageTypeOption.new({:payload=>$DHCP_MSG_INFORM}), ParameterRequestListOption.new])
+ params[:options] = params.fetch(:options, [MessageTypeOption.new({:payload=>[$DHCP_MSG_INFORM]}), ParameterRequestListOption.new])
super(params)
end
end
diff --git a/lib/net/dhcp/options.rb b/lib/net/dhcp/options.rb
index d43481d..de47329 100644
--- a/lib/net/dhcp/options.rb
+++ b/lib/net/dhcp/options.rb
@@ -33,7 +33,7 @@ module DHCP
def initialize(params = {})
# We need a type, and a payload
if (([:type, :payload] & params.keys).size != 2)
- raise ArgumentError('you need to specify values for :type and :payload')
+ raise ArgumentError, 'you need to specify values for :type and :payload'
end
self.type = params[:type]
diff --git a/net-dhcp.gemspec b/net-dhcp.gemspec
index de132e8..afd455c 100644
--- a/net-dhcp.gemspec
+++ b/net-dhcp.gemspec
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.name = 'net-dhcp'
s.version = Net::Dhcp::VERSION
s.platform = Gem::Platform::RUBY
- s.date = "2014-01-01"
+ s.date = "2014-01-02"
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-ruby'
@@ -30,11 +30,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'bundler'
s.add_development_dependency 'bueller'
s.add_development_dependency 'rake'
- s.add_development_dependency 'rcov'
+ s.add_development_dependency 'simplecov'
s.add_development_dependency 'rdoc'
-
- s.add_runtime_dependency 'dhcp'
- s.add_runtime_dependency 'ruby-pcap'
-
end