net-ping 1.7.5-universal-mingw32 → 1.7.6-universal-mingw32

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: 76094b959b0147e022534d183b4589dea46af3e3
4
- data.tar.gz: b15a4a418e5c43b7d14b92b5bdee5015c697a807
3
+ metadata.gz: 7df0afd38d955fcbb3ef3cf956b6ec18cb2110cd
4
+ data.tar.gz: 697dc0c6610691001c4803e370c0e34ef485b9af
5
5
  SHA512:
6
- metadata.gz: 7bed079dbbeeab53dd88f1efc8d876629a4ae8d4f80b003ce36320bf180510ee24af29ca38c9c3aa14d8364dc3fdd5532a20abbcfbf1a956889be0708acbbd87
7
- data.tar.gz: 8822d0928c89bca134bf1ec39c9373c04cef29044a0ef2b9aeca3b907e4c326eaddb69ca63356cb0522d52b7d611136beb4ad9fe8fe5c2354c498ebd6eff9847
6
+ metadata.gz: 5d2da808ee32c4d7cfa9126b1403c2d5756c1d20eaa21a9076599af5d4297d28b3045c17f3997c71bb859f794ee2cb410b6cc82d621d918acaa195a42fc9399f
7
+ data.tar.gz: 476833a09b47a9b182bfe719d5ec5623231cd16825b3ea91e66b78f6c522fe010cc391dac4182cb4c0bde99f0829c548968faeac4c20bf695c849912198c6f9e
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 1.7.6 - 13-Dec-2014
2
+ * Changed TCP handling yet again, as it was returning false positives. Thanks
3
+ go to Marcos Piccinini for the spot.
4
+ * Now uses relative_require internally.
5
+ * Minor tweaks to the gemspec and Rakefile for JRuby.
6
+
1
7
  == 1.7.5 - 2-Nov-2014
2
8
  * Added packet count and intervals for external pings. Thanks go to Jack Hayter
3
9
  for the patch.
data/Rakefile CHANGED
@@ -20,7 +20,11 @@ namespace 'gem' do
20
20
  desc 'Install the net-ping gem'
21
21
  task :install => [:create] do
22
22
  gem_file = Dir["*.gem"].first
23
- sh "gem install -l #{gem_file}"
23
+ if RUBY_PLATFORM == 'java'
24
+ sh "jruby -S gem install -l #{gem_file}"
25
+ else
26
+ sh "gem install -l #{gem_file}"
27
+ end
24
28
  end
25
29
  end
26
30
 
data/lib/net/ping.rb CHANGED
@@ -4,14 +4,14 @@
4
4
  #
5
5
  require 'rbconfig'
6
6
 
7
- require File.join(File.dirname(__FILE__), 'ping/tcp')
8
- require File.join(File.dirname(__FILE__), 'ping/udp')
9
- require File.join(File.dirname(__FILE__), 'ping/icmp')
10
- require File.join(File.dirname(__FILE__), 'ping/external')
11
- require File.join(File.dirname(__FILE__), 'ping/http')
7
+ require_relative 'ping/tcp'
8
+ require_relative 'ping/udp'
9
+ require_relative 'ping/icmp'
10
+ require_relative 'ping/external'
11
+ require_relative 'ping/http'
12
12
 
13
13
  RbConfig = Config unless Object.const_defined?(:RbConfig)
14
14
 
15
15
  if File::ALT_SEPARATOR
16
- require File.join(File.dirname(__FILE__), 'ping/wmi')
16
+ require_relative 'ping/wmi'
17
17
  end
data/lib/net/ping/ping.rb CHANGED
@@ -10,7 +10,7 @@ module Net
10
10
  #
11
11
  class Ping
12
12
  # The version of the net-ping library.
13
- VERSION = '1.7.5'
13
+ VERSION = '1.7.6'
14
14
 
15
15
  # The host to ping. In the case of Ping::HTTP, this is the URI.
16
16
  attr_accessor :host
data/lib/net/ping/tcp.rb CHANGED
@@ -68,17 +68,23 @@ module Net
68
68
 
69
69
  resp = IO.select(nil, [sock], nil, timeout)
70
70
 
71
- if @@service_check
72
- bool = true
73
- elsif resp.nil?
74
- # Assume ECONNREFUSED at this point
75
- @exception = Errno::ECONNREFUSED
71
+ if resp.nil? # Assume ECONNREFUSED if nil
72
+ if @@service_check
73
+ bool = true
74
+ else
75
+ bool = false
76
+ @exception = Errno::ECONNREFUSED
77
+ end
76
78
  else
77
79
  sockopt = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
78
80
 
79
- # Check to see if ECONNREFUSED actually occurred.
80
- if sockopt.int == Errno::ECONNREFUSED::Errno
81
- @exception = Errno::ECONNREFUSED
81
+ if sockopt.int != 0
82
+ if @@service_check && sockopt.int == Errno::ECONNREFUSED::Errno
83
+ bool = true
84
+ else
85
+ bool = false
86
+ @exception = SystemCallError.new(sockopt.int)
87
+ end
82
88
  else
83
89
  bool = true
84
90
  end
data/net-ping.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'net-ping'
6
- spec.version = '1.7.5'
6
+ spec.version = '1.7.6'
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.author = 'Daniel J. Berger'
9
9
  spec.email = 'djberg96@gmail.com'
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  if File::ALT_SEPARATOR
25
25
  require 'rbconfig'
26
- arch = RbConfig::CONFIG['build_os']
26
+ arch = RbConfig::CONFIG['build_os'] || 'mingw32' # JRuby
27
27
  spec.platform = Gem::Platform.new(['universal', arch])
28
28
  spec.platform.version = nil
29
29
 
@@ -28,7 +28,7 @@ end
28
28
 
29
29
  class TC_Net_Ping < Test::Unit::TestCase
30
30
  def test_net_ping_version
31
- assert_equal('1.7.5', Net::Ping::VERSION)
31
+ assert_equal('1.7.6', Net::Ping::VERSION)
32
32
  end
33
33
  end
34
34
 
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.7.6
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-02 00:00:00.000000000 Z
11
+ date: 2014-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fakeweb
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: win32-security
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.2.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.2.0
69
69
  description: |2
@@ -114,17 +114,17 @@ require_paths:
114
114
  - lib
115
115
  required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: 1.9.3
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.4.2
127
+ rubygems_version: 2.4.5
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: A ping interface for Ruby.