net-dhcp 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4382e9e7f0e8b0ea9a3f2ecd7a6e91486034bbd
4
- data.tar.gz: d9c1dbdf7cc2d61250c5ae09e56d3adaa4f20cd6
3
+ metadata.gz: 64f8deb103a85550e0bf82aa217005305de27abe
4
+ data.tar.gz: cea06d0530a06b9cdea510da7695e7c84b6c89b1
5
5
  SHA512:
6
- metadata.gz: bc028daee63ea5752ba22fe70a02039116e039ebcdc15a793e2c9cf5270d3affaf5bf836b2c85f6648b0638d142b07b9a57146ce8bf77503828cbac9f4fa1299
7
- data.tar.gz: 1e94409daef8bab1d7015829e91c372e220a4db10129e2f7841a12d771add72a55d7d1859b2b44cd6e14ac358704f056f06e48429d7aec16a8f89aef042cddc3
6
+ metadata.gz: 229cd888daf3283b85be09956c07d74e4d5e123c0b6c5ea146a9f6d14d0c4fe3f0e81ab717a6dfe8d8d1c5b71b43619a88013a0f148392aab009e351f9ddebae
7
+ data.tar.gz: c3057834f982dd6ef1308a46948f24ab1ff81454783a98d1c2334dd1577dfde20e82f2cef0aa520b4dafc7f2f44b53bdd2b7b7479b87364f54b79567a60bc105
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *1.3.0
2
+
3
+ * Add Windows support to DHCP requests (https://github.com/mjtko/net-dhcp-ruby/pull/10) [rightscale]
4
+
1
5
  *1.2.1
2
6
 
3
7
  * Fix net-dhcp example to allow use of the socket if already in use (mikerodrigues)
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  module Dhcp
3
- VERSION = "1.2.1"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
data/lib/net/dhcp/core.rb CHANGED
@@ -22,6 +22,8 @@
22
22
  **
23
23
  =end
24
24
 
25
+ require 'rubygems'
26
+
25
27
  module DHCP
26
28
  # -------------------------------------------------------------- dhcp messages
27
29
  class Message
@@ -145,7 +147,14 @@ module DHCP
145
147
  self.chaddr = params[:chaddr]
146
148
  raise 'chaddr field should be of 16 bytes' unless self.chaddr.size == 16
147
149
  else
148
- mac = `/sbin/ifconfig | grep HWaddr | cut -c39- | head -1`.chomp.strip.gsub(/:/,'')
150
+ if Gem.respond_to?(:win_platform?) && Gem.win_platform?
151
+ mac_line = `getmac /fo list`.split("\n").grep(/Physical Address/).first
152
+ if mac_line
153
+ mac = mac_line.strip.split(":")[1].gsub("-","").strip
154
+ end
155
+ else
156
+ mac = `/sbin/ifconfig | grep HWaddr | cut -c39- | head -1`.chomp.strip.gsub(/:/,'')
157
+ end
149
158
  mac = '000000000000' if mac.empty?
150
159
  self.chaddr = [mac].pack('H*').unpack('CCCCCC')
151
160
  self.chaddr += [0x00]*(16-self.chaddr.size)
data/net-dhcp.gemspec CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.name = 'net-dhcp'
6
6
  s.version = Net::Dhcp::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
- s.date = "2014-01-02"
8
+ s.date = "2014-10-22"
9
9
  s.authors = ['daniel martin gomez (etd)', 'syonbori', 'Mark J. Titorenko']
10
10
  s.email = 'mark.titorenko@alces-software.com'
11
11
  s.homepage = 'http://github.com/mjtko/net-dhcp-ruby'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-dhcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - daniel martin gomez (etd)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-02 00:00:00.000000000 Z
13
+ date: 2014-10-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: 1.3.7
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.2.0.rc.1
150
+ rubygems_version: 2.2.2
151
151
  signing_key:
152
152
  specification_version: 3
153
153
  summary: set of classes to low level handle the DHCP protocol