rumblinthebronx-system-getifaddrs 0.2.1-x86-mingw32 → 0.2.2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +21 -21
- data/Rakefile +7 -4
- data/ext/rb_getifaddrs/extconf.rb +1 -1
- data/ext/rb_getifaddrs/rb_getifaddrs.c +1 -1
- data/lib/system/getifaddrs.rb +41 -6
- data/lib/system/getifaddrs/version.rb +1 -1
- data/system-getifaddrs.gemspec +10 -4
- metadata +10 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b2ec33d5dec26816020ae9c9137d6bc468ed32a2
|
4
|
+
data.tar.gz: 9ad7442a847942871711adcd723d55d6b656d718
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: de387bc5be4f907c3e9a84a49fbb06e627831733d5cecf59e64b5dda4726180b2ba7f4b76a03128a3ee39a88a5d3d25d539b38b63a1fbfbde59e0f5bcb929a47
|
7
|
+
data.tar.gz: 4d05d5ac0a2054e3d58de2d57d731ad523fd642ed1677ebd28993491d87ab3e0ae2695d6530c79745e8b8fec672d6fa52704a8104efbd46e28c5eaf13ac1ee4e
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
system-getifaddrs (0.1
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
rake (
|
10
|
-
rake-compiler (0.
|
11
|
-
rake
|
12
|
-
rspec (1.3.2)
|
13
|
-
|
14
|
-
PLATFORMS
|
15
|
-
|
16
|
-
|
17
|
-
DEPENDENCIES
|
18
|
-
rake
|
19
|
-
rake-compiler
|
20
|
-
rspec (~> 1.3)
|
21
|
-
system-getifaddrs!
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rumblinthebronx-system-getifaddrs (0.2.1-x86-mingw32)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
rake (10.1.0)
|
10
|
+
rake-compiler (0.9.1)
|
11
|
+
rake
|
12
|
+
rspec (1.3.2)
|
13
|
+
|
14
|
+
PLATFORMS
|
15
|
+
x86-mingw32
|
16
|
+
|
17
|
+
DEPENDENCIES
|
18
|
+
rake
|
19
|
+
rake-compiler
|
20
|
+
rspec (~> 1.3)
|
21
|
+
rumblinthebronx-system-getifaddrs!
|
data/Rakefile
CHANGED
@@ -4,7 +4,10 @@ Bundler::GemHelper.install_tasks
|
|
4
4
|
require 'spec/rake/spectask'
|
5
5
|
Spec::Rake::SpecTask.new
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if RUBY_PLATFORM == "java"
|
8
|
+
task :default => [:spec]
|
9
|
+
else
|
10
|
+
require 'rake/extensiontask'
|
11
|
+
Rake::ExtensionTask.new('rb_getifaddrs')
|
12
|
+
task :default => [:compile, :spec]
|
13
|
+
end
|
data/lib/system/getifaddrs.rb
CHANGED
@@ -1,7 +1,42 @@
|
|
1
|
-
|
1
|
+
if RUBY_ENGINE == "jruby"
|
2
|
+
module System
|
3
|
+
require 'netaddr'
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
# Jruby version of the system-getifaddrs gem. Gives info on all network
|
6
|
+
# interfaces.
|
7
|
+
#
|
8
|
+
# @return [Hash] Network interfaces and their addresses/netmasks.
|
9
|
+
def self.get_ifaddrs
|
10
|
+
ifaddrs = {}
|
11
|
+
interfaces = java.net.NetworkInterface.network_interfaces
|
12
|
+
|
13
|
+
interfaces.each do |interface|
|
14
|
+
name = interface.display_name.to_sym
|
15
|
+
ifaddrs[name] = {}
|
16
|
+
|
17
|
+
interface.interface_addresses.each do |interface_address|
|
18
|
+
ip_address, index = interface_address.address.host_address.split('%')
|
19
|
+
prefix = interface_address.network_prefix_length
|
20
|
+
netmask = NetAddr::CIDR.create("#{ip_address}/#{prefix}").wildcard_mask
|
21
|
+
|
22
|
+
if interface_address.address.is_a? Java::JavaNet::Inet4Address
|
23
|
+
ifaddrs[name][:inet_addr_v4] = ip_address
|
24
|
+
netmask = '255.0.0.0' if interface_address.address.is_loopback_address?
|
25
|
+
ifaddrs[name][:netmask_v4] = netmask
|
26
|
+
else
|
27
|
+
ifaddrs[name][:inet_addr_v6] = "#{ip_address}%#{index}"
|
28
|
+
ifaddrs[name][:netmask_v6] = NetAddr.shorten(netmask)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
ifaddrs
|
34
|
+
end
|
35
|
+
end
|
36
|
+
else
|
37
|
+
begin
|
38
|
+
require File.join(File.dirname(__FILE__), 'rb_getifaddrs')
|
39
|
+
rescue LoadError
|
40
|
+
require File.join(File.dirname(__FILE__), '..', 'rb_getifaddrs')
|
41
|
+
end
|
42
|
+
end
|
data/system-getifaddrs.gemspec
CHANGED
@@ -1,21 +1,27 @@
|
|
1
1
|
# -*- encodign: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require "system/getifaddrs/version"
|
4
|
+
RUBY_PLATFORM = "x64-mingw32"
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
7
|
s.name = "rumblinthebronx-system-getifaddrs"
|
7
8
|
s.version = System::Getifaddrs::VERSION
|
8
9
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.platform =
|
10
|
+
s.platform = Gem::Platform.new(['x86', 'mingw32']) if RUBY_PLATFORM.include?("mingw32")
|
11
|
+
s.platform = Gem::Platform.new(['x64', 'mingw32']) if RUBY_PLATFORM.include?("x64-mingw32")
|
10
12
|
s.authors = ["Sujin Philip", "Bruno Coimbra"]
|
11
13
|
s.email = %q{sujin.phil@gmail.com}
|
12
14
|
s.homepage = %q{http://github.com/rumblinthebronx/system-getifaddrs}
|
13
|
-
s.summary = %q{This
|
15
|
+
s.summary = %q{This library provides the information about the inet interfaces. }
|
14
16
|
s.description = %q{This lib is a wrapper for get_ifaddrs C routine. The original routine returns a linked list that contains avaliable inet interfaces. This lib walks on list and return an hash that contains the interface names and sub-hashes with respectives ip addresses and netmasks.}
|
15
17
|
s.add_development_dependency(%q<rspec>, "~> 1.3")
|
16
18
|
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
17
|
-
s.add_runtime_dependency(%q<
|
18
|
-
|
19
|
+
s.add_runtime_dependency(%q<netaddr>, "~> 1.5.0") if RUBY_PLATFORM == "java"
|
20
|
+
|
21
|
+
unless RUBY_PLATFORM.include?("mingw") || RUBY_PLATFORM == "java"
|
22
|
+
s.extensions = `git ls-files -- ext/*`.split("\n").select{|f| f =~ /extconf/}
|
23
|
+
end
|
24
|
+
|
19
25
|
s.files = `git ls-files`.split("\n")
|
20
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
27
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumblinthebronx-system-getifaddrs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.2
|
6
5
|
platform: x86-mingw32
|
7
6
|
authors:
|
8
7
|
- Sujin Philip
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,33 +28,15 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake-compiler
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: os
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ! '>='
|
39
|
+
- - '>='
|
61
40
|
- !ruby/object:Gem::Version
|
62
41
|
version: '0'
|
63
42
|
description: This lib is a wrapper for get_ifaddrs C routine. The original routine
|
@@ -87,26 +66,25 @@ files:
|
|
87
66
|
- system-getifaddrs.gemspec
|
88
67
|
homepage: http://github.com/rumblinthebronx/system-getifaddrs
|
89
68
|
licenses: []
|
69
|
+
metadata: {}
|
90
70
|
post_install_message:
|
91
71
|
rdoc_options: []
|
92
72
|
require_paths:
|
93
73
|
- lib
|
94
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
75
|
requirements:
|
97
|
-
- -
|
76
|
+
- - '>='
|
98
77
|
- !ruby/object:Gem::Version
|
99
78
|
version: '0'
|
100
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
80
|
requirements:
|
103
|
-
- -
|
81
|
+
- - '>='
|
104
82
|
- !ruby/object:Gem::Version
|
105
83
|
version: '0'
|
106
84
|
requirements: []
|
107
85
|
rubyforge_project:
|
108
|
-
rubygems_version:
|
86
|
+
rubygems_version: 2.0.3
|
109
87
|
signing_key:
|
110
|
-
specification_version:
|
111
|
-
summary: This
|
88
|
+
specification_version: 4
|
89
|
+
summary: This library provides the information about the inet interfaces.
|
112
90
|
test_files: []
|