net-ping 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ == 1.3.1 - 22-Jul-2009
2
+ * Removed class aliases, e.g. use Ping::External, not PingExternal.
3
+ * Minor code change to eliminate a warning that popped up in 1.9.x.
4
+ * The win32-open3 library is removed as a dependency for Ruby 1.9.x.
5
+ * Changed license to Artistic 2.0.
6
+ * Some gemspec and README updates.
7
+
1
8
  == 1.3.0 - 19-May-2009
2
9
  * Added the Ping::WMI class for MS Windows. This class encapsulates the
3
10
  Win32_PingStatus WMI class. Unlike other ping methods, this one returns
data/README CHANGED
@@ -35,6 +35,12 @@
35
35
  not to mention backwards compatible. The latter has the advantage of
36
36
  reducing your memory footprint.
37
37
 
38
+ == Known Issues
39
+ Older versions of Ruby 1.9.x may not work with UDP pings.
40
+
41
+ == License
42
+ Artistic 2.0
43
+
38
44
  == More documentation
39
45
  If you installed this library via Rubygems, you can view the inline
40
46
  documentation via ri or fire up 'gem server', and point your browser at
data/doc/ping.txt CHANGED
@@ -221,6 +221,8 @@ Ping#warning
221
221
  known issues. This may cause the Ping::ICMP class to fail. In fact, I
222
222
  make an effort to skip those tests if I detect the one-click installer.
223
223
 
224
+ UDP pings may not work with older versions of Ruby 1.9.x.
225
+
224
226
  Please report any bugs on the project page at
225
227
  http://www.rubyforge.org/projects/shards.
226
228
 
@@ -233,7 +235,7 @@ Ping#warning
233
235
  Add support for syn pings.
234
236
 
235
237
  = License
236
- Ruby's
238
+ Artistic 2.0
237
239
 
238
240
  = Copyright
239
241
  (C) 2003-2009 Daniel J. Berger, All Rights Reserved
@@ -2,7 +2,9 @@ $LOAD_PATH.unshift File.dirname(__FILE__)
2
2
  require 'ping'
3
3
 
4
4
  if RUBY_PLATFORM.match('mswin')
5
- require 'win32/open3'
5
+ if RUBY_VERSION.to_f < 1.9
6
+ require 'win32/open3'
7
+ end
6
8
  require 'windows/console'
7
9
  include Windows::Console
8
10
  else
@@ -80,9 +82,9 @@ module Net
80
82
  request\ timed\ out|
81
83
  100%\ packet\ loss
82
84
  /ix
83
- lines.each{ |e|
84
- if regexp.match(e)
85
- @exception = e.chomp
85
+ lines.each{ |line|
86
+ if regexp.match(line)
87
+ @exception = line.chomp
86
88
  break
87
89
  end
88
90
  }
@@ -106,7 +108,4 @@ module Net
106
108
  alias ping? ping
107
109
  alias pingecho ping
108
110
  end
109
-
110
- # Class alias for backwards compatibility.
111
- PingExternal = Ping::External
112
111
  end
data/lib/net/ping/http.rb CHANGED
@@ -83,7 +83,4 @@ module Net
83
83
  alias uri host
84
84
  alias uri= host=
85
85
  end
86
-
87
- # Class alias for backwards compatibility
88
- PingHTTP = Ping::HTTP
89
86
  end
data/lib/net/ping/icmp.rb CHANGED
@@ -160,7 +160,4 @@ module Net
160
160
  return (~((check >> 16) + check) & 0xffff)
161
161
  end
162
162
  end
163
-
164
- # Alias for consistency with other ping related classes
165
- PingICMP = Ping::ICMP
166
163
  end
data/lib/net/ping/ping.rb CHANGED
@@ -9,7 +9,7 @@ module Net
9
9
  # types. You should not instantiate this class directly.
10
10
  #
11
11
  class Ping
12
- VERSION = '1.3.0'
12
+ VERSION = '1.3.1'
13
13
 
14
14
  # The host to ping. In the case of Ping::HTTP, this is the URI.
15
15
  attr_accessor :host
data/lib/net/ping/tcp.rb CHANGED
@@ -80,7 +80,4 @@ module Net
80
80
  alias ecr= service_check=
81
81
  end
82
82
  end
83
-
84
- # Class alias for backwards compatibility
85
- PingTCP = Ping::TCP
86
83
  end
data/lib/net/ping/udp.rb CHANGED
@@ -113,7 +113,4 @@ module Net
113
113
  alias ping? ping
114
114
  alias pingecho ping
115
115
  end
116
-
117
- # Class alias for backwards compatibility
118
- PingUDP = Ping::UDP
119
116
  end
data/net-ping.gemspec CHANGED
@@ -2,7 +2,8 @@ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = 'net-ping'
5
- gem.version = '1.3.0'
5
+ gem.version = '1.3.1'
6
+ gem.license = 'Artistic 2.0'
6
7
  gem.author = 'Daniel J. Berger'
7
8
  gem.email = 'djberg96@gmail.com'
8
9
  gem.homepage = 'http://www.rubyforge.org/projects/shards'
@@ -13,23 +14,26 @@ spec = Gem::Specification.new do |gem|
13
14
  gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
14
15
  gem.extra_rdoc_files = ['README', 'CHANGES', 'doc/ping.txt']
15
16
 
16
- gem.add_dependency('test-unit', '>= 2.0.2')
17
+ gem.add_dependency('test-unit', '>= 2.0.3')
17
18
 
18
19
  case RUBY_PLATFORM
19
- when /mswin/i
20
+ when /mswin|dos|win32/i
20
21
  gem.platform = Gem::Platform::CURRENT
21
- gem.add_dependency('windows-pr', '>= 0.9.8') # Net::Ping::External
22
- gem.add_dependency('win32-open3', '>= 0.2.7') # Net::Ping::External
22
+ gem.add_dependency('windows-pr', '>= 1.0.6') # Net::Ping::External
23
+
24
+ if RUBY_VERSION.to_f < 1.9
25
+ gem.add_dependency('win32-open3', '>= 0.3.0') # Net::Ping::External
26
+ end
23
27
  else
24
28
  gem.platform = Gem::Platform::RUBY
25
29
  end
26
30
 
27
- description = 'A ping interface for Ruby. Includes TCP, HTTP, ICMP, UDP, '
28
- description << 'External, and WMI ping interfaces.'
29
- gem.description = description
31
+ gem.description = <<-EOF
32
+ The net-ping library provides a ping interface for Ruby. It includes
33
+ separate TCP, HTTP, ICMP, UDP, WMI (for Windows) and external ping
34
+ classes.
35
+ EOF
30
36
  end
31
37
 
32
- if $PROGRAM_NAME == __FILE__
33
- Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0
34
- Gem::Builder.new(spec).build
35
- end
38
+ Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0
39
+ Gem::Builder.new(spec).build
@@ -20,7 +20,7 @@ class TC_PingExternal < Test::Unit::TestCase
20
20
  end
21
21
 
22
22
  def test_version
23
- assert_equal('1.3.0', PingExternal::VERSION)
23
+ assert_equal('1.3.1', Ping::External::VERSION)
24
24
  end
25
25
 
26
26
  def test_ping
@@ -19,7 +19,7 @@ class TC_PingHTTP < Test::Unit::TestCase
19
19
  end
20
20
 
21
21
  def test_version
22
- assert_equal('1.3.0', Ping::HTTP::VERSION)
22
+ assert_equal('1.3.1', Ping::HTTP::VERSION)
23
23
  end
24
24
 
25
25
  def test_ping
@@ -27,7 +27,7 @@ class TC_PingICMP < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_version
30
- assert_equal('1.3.0', PingICMP::VERSION)
30
+ assert_equal('1.3.1', Ping::ICMP::VERSION)
31
31
  end
32
32
 
33
33
  def test_ping
@@ -19,7 +19,7 @@ class TC_PingTCP < Test::Unit::TestCase
19
19
  end
20
20
 
21
21
  def test_version
22
- assert_equal('1.3.0', PingTCP::VERSION)
22
+ assert_equal('1.3.1', Ping::TCP::VERSION)
23
23
  end
24
24
 
25
25
  def test_ping
@@ -47,25 +47,25 @@ class TC_PingTCP < Test::Unit::TestCase
47
47
 
48
48
  def test_ping_service_check_true
49
49
  msg = "+this test may fail depending on your network environment+"
50
- PingTCP.service_check = true
50
+ Ping::TCP.service_check = true
51
51
  assert_equal(true, @tcp.ping?, msg)
52
52
  end
53
53
 
54
54
  def test_service_check
55
- assert_respond_to(PingTCP, :service_check)
56
- assert_respond_to(PingTCP, :service_check=)
55
+ assert_respond_to(Ping::TCP, :service_check)
56
+ assert_respond_to(Ping::TCP, :service_check=)
57
57
  end
58
58
 
59
59
  # These will be removed eventually
60
60
  def test_service_check_aliases
61
- assert_respond_to(PingTCP, :econnrefused)
62
- assert_respond_to(PingTCP, :econnrefused=)
63
- assert_respond_to(PingTCP, :ecr)
64
- assert_respond_to(PingTCP, :ecr=)
61
+ assert_respond_to(Ping::TCP, :econnrefused)
62
+ assert_respond_to(Ping::TCP, :econnrefused=)
63
+ assert_respond_to(Ping::TCP, :ecr)
64
+ assert_respond_to(Ping::TCP, :ecr=)
65
65
  end
66
66
 
67
67
  def test_service_check_expected_errors
68
- assert_raises(ArgumentError){ PingTCP.service_check = "blah" }
68
+ assert_raises(ArgumentError){ Ping::TCP.service_check = "blah" }
69
69
  end
70
70
 
71
71
  # If the ping failed, the duration will be nil
@@ -22,7 +22,7 @@ class TC_PingUDP < Test::Unit::TestCase
22
22
  end
23
23
 
24
24
  def test_version
25
- assert_equal('1.3.0', Ping::UDP::VERSION)
25
+ assert_equal('1.3.1', Ping::UDP::VERSION)
26
26
  end
27
27
 
28
28
  def test_ping
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-19 00:00:00 -06:00
12
+ date: 2009-07-22 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,9 +20,9 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.2
23
+ version: 2.0.3
24
24
  version:
25
- description: A ping interface for Ruby. Includes TCP, HTTP, ICMP, UDP, External, and WMI ping interfaces.
25
+ description: " The net-ping library provides a ping interface for Ruby. It includes\n separate TCP, HTTP, ICMP, UDP, WMI (for Windows) and external ping\n classes.\n"
26
26
  email: djberg96@gmail.com
27
27
  executables: []
28
28
 
@@ -60,8 +60,8 @@ files:
60
60
  - test/test_net_ping_wmi.rb
61
61
  has_rdoc: true
62
62
  homepage: http://www.rubyforge.org/projects/shards
63
- licenses: []
64
-
63
+ licenses:
64
+ - Artistic 2.0
65
65
  post_install_message:
66
66
  rdoc_options: []
67
67
 
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements: []
83
83
 
84
84
  rubyforge_project: shards
85
- rubygems_version: 1.3.3
85
+ rubygems_version: 1.3.4
86
86
  signing_key:
87
87
  specification_version: 3
88
88
  summary: A ping interface for Ruby.