The Gem doesn't support:
- Compiling on Windows 64 - the
RUBY_PLATFORM is x64-mingw32
- Doesn't support retrieving IPV6 addresses, the library should be using
GetAdaptersAddresses to retrieve this information
Debugging steps to replicate/have rake compile working
diff --git a/ext/network_interface_ext/extconf.rb b/ext/network_interface_ext/extconf.rb
index 7e2ee42..1968382 100644
--- a/ext/network_interface_ext/extconf.rb
+++ b/ext/network_interface_ext/extconf.rb
@@ -7,13 +7,14 @@ extension_name = 'network_interface_ext'
puts "\n[*] Running checks for netifaces code..."
#uncoment to force ioctl on non windows systems
#@force_ioctl = true
-@supported_archs = [ "i386-mingw32", "i486-linux", "x86_64-linux",
+@supported_archs = [ "i386-mingw32", "x64-mingw32", "i486-linux", "x86_64-linux",
"universal-darwin10.0", "i386-openbsd4.8", "i386-freebsd8",
"arm-linux-eabi", "x86_64-darwin12.3.0" ]
#arm-linux-eabi tested on maemo5 / N900
puts "[*] Warning : this platform as not been tested" unless @supported_archs.include? RUBY_PLATFORM
-if RUBY_PLATFORM =~ /i386-mingw32/
+require 'pry-byebug'; binding.pry
+if RUBY_PLATFORM =~ /i386-mingw32|x64-mingw32/
unless have_library("ws2_32" ) and
have_library("iphlpapi") and
have_header("windows.h") and
@@ -92,4 +93,4 @@ $defs = $defs.map do |a|
end
end
-create_makefile(extension_name)
\ No newline at end of file
+create_makefile(extension_name)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b247187..7f313da 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -24,25 +24,27 @@ def friendly_interface_names
interface_names
end
-if RUBY_PLATFORM =~ /i386-mingw32/
+if RUBY_PLATFORM =~ /i386-mingw32|x64-mingw32/
def system_interfaces
ipconfig = `ipconfig`
ipconfig_array = ipconfig.split("\n").reject {|s| s.empty?}
-
+
getmac = `getmac -nh`
getmac_array = getmac.split("\n").reject {|s| s.empty?}
getmac_array.map!{|element| element.split(" ")}
getmac_hash = getmac_array.inject({}) do |hash, array|
hash.merge!({array[1][/\{(.*)\}/,1] => array[0].gsub("-",":").downcase})
end
-
+
interfaces = {}
@key = nil
ipconfig_array.each do |element|
if element.start_with? " "
case element
when /IPv6 Address.*: (.*)/
- # interfaces[@key][:ipv6] = $1
+ # require 'pry-byebug'; binding.pry
+ # puts '123'
+ interfaces[@key][:ipv6] = $1
when /IPv4 Address.*: (.*)/
interfaces[@key][:ipv4] = $1
interfaces[@key][:mac] = getmac_hash[@key[/\{(.*)\}/,1]]
@@ -56,11 +58,11 @@ if RUBY_PLATFORM =~ /i386-mingw32/
interfaces[@key] = {}
end
end
-
+
interfaces
end
-else
+else
def system_interfaces
ifconfig = `/sbin/ifconfig`
ifconfig_array = ifconfig.split("\n")
Note - when compiling on windows we needed to add ridk in the current prompt for the ruby developer kit to be on the path
The Gem doesn't support:
RUBY_PLATFORMisx64-mingw32GetAdaptersAddressesto retrieve this informationDebugging steps to replicate/have
rake compileworkingNote - when compiling on windows we needed to add
ridkin the current prompt for the ruby developer kit to be on the path