net-ping 1.5.0 → 1.5.1

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.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.5.1 - 15-Sep-2011
2
+ * Use RbConfig on Ruby 1.9 and later. Thanks go to Torsten Schönebaum
3
+ for the patch.
4
+
1
5
  == 1.5.0 - 3-May-2011
2
6
  * Added the Net::Ping::LDAP class which allows you to perform LDAP pings.
3
7
  Thanks go to Paul Gallagher for adding this.
data/README CHANGED
@@ -2,9 +2,9 @@
2
2
  A collection of classes that provide different ways to ping computers.
3
3
 
4
4
  == Prerequisites
5
- * The win32-open3 (1.8.x) and windows-pr libraries are required on
6
- MS Windows when using the Net::Ping::External class unless you're
7
- using JRuby.
5
+ The win32-open3 (1.8.x) and windows-pr libraries are required on
6
+ MS Windows when using the Net::Ping::External class unless you're
7
+ using JRuby.
8
8
 
9
9
  == Installation
10
10
  gem install net-ping
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
3
  require 'rake/testtask'
4
- include Config
4
+ include Object.const_defined?(:RbConfig) ? RbConfig : Config
5
5
 
6
6
  CLEAN.include("**/*.gem", "**/*.rbc")
7
7
 
data/lib/net/ping.rb CHANGED
@@ -11,6 +11,8 @@ require File.join(File.dirname(__FILE__), 'ping/external')
11
11
  require File.join(File.dirname(__FILE__), 'ping/http')
12
12
  require File.join(File.dirname(__FILE__), 'ping/ldap')
13
13
 
14
- if Config::CONFIG['host_os'] =~ /msdos|mswin|cygwin|mingw|win32|windows/i
14
+ RbConfig = Config unless Object.const_defined?(:RbConfig)
15
+
16
+ if RbConfig::CONFIG['host_os'] =~ /msdos|mswin|cygwin|mingw|win32|windows/i
15
17
  require File.join(File.dirname(__FILE__), 'ping/wmi')
16
18
  end
@@ -1,7 +1,9 @@
1
1
  require 'rbconfig'
2
2
  require File.join(File.dirname(__FILE__), 'ping')
3
3
 
4
- if Config::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
4
+ RbConfig = Config unless Object.const_defined?(:RbConfig)
5
+
6
+ if RbConfig::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
5
7
  RUBY_PLATFORM != 'java'
6
8
  then
7
9
  if RUBY_VERSION.to_f < 1.9
@@ -18,7 +20,7 @@ module Net
18
20
  # The Ping::External class encapsulates methods for external (system) pings.
19
21
  class Ping::External < Ping
20
22
 
21
- CWINDOWS = Config::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
23
+ CWINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw|windows/i &&
22
24
  RUBY_PLATFORM != 'java'
23
25
 
24
26
  if CWINDOWS
@@ -40,7 +42,7 @@ module Net
40
42
  bool = false
41
43
  orig_cp = nil
42
44
 
43
- case Config::CONFIG['host_os']
45
+ case RbConfig::CONFIG['host_os']
44
46
  when /linux|bsd|osx|mach|darwin/i
45
47
  pstring += "-c 1 #{host}"
46
48
  when /solaris|sunos/i
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.5.0'
13
+ VERSION = '1.5.1'
14
14
 
15
15
  # The host to ping. In the case of Ping::HTTP, this is the URI.
16
16
  attr_accessor :host
data/net-ping.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'net-ping'
6
- gem.version = '1.5.0'
6
+ gem.version = '1.5.1'
7
7
  gem.license = 'Artistic 2.0'
8
8
  gem.author = 'Daniel J. Berger'
9
9
  gem.email = 'djberg96@gmail.com'
@@ -30,7 +30,7 @@ end
30
30
 
31
31
  class TC_Net_Ping < Test::Unit::TestCase
32
32
  def test_net_ping_version
33
- assert_equal('1.5.0', Net::Ping::VERSION)
33
+ assert_equal('1.5.1', Net::Ping::VERSION)
34
34
  end
35
35
  end
36
36
 
@@ -12,7 +12,7 @@ require 'net/ping/external'
12
12
 
13
13
  class TC_Net_Ping_External < Test::Unit::TestCase
14
14
  def setup
15
- @host = 'www.ruby-lang.org'
15
+ @host = 'localhost'
16
16
  @bogus = 'foo.bar.baz'
17
17
  @pe = Net::Ping::External.new(@host)
18
18
  @bad = Net::Ping::External.new(@bogus)
@@ -68,7 +68,7 @@ class TC_Net_Ping_External < Test::Unit::TestCase
68
68
 
69
69
  test "host getter basic functionality" do
70
70
  assert_respond_to(@pe, :host)
71
- assert_equal('www.ruby-lang.org', @pe.host)
71
+ assert_equal('localhost', @pe.host)
72
72
  end
73
73
 
74
74
  test "host setter basic functionality" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ping
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel J. Berger
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-04 00:00:00 -06:00
19
- default_executable:
18
+ date: 2011-09-15 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: net-ldap
@@ -93,35 +92,34 @@ extra_rdoc_files:
93
92
  - CHANGES
94
93
  - doc/ping.txt
95
94
  files:
96
- - Rakefile
97
- - README
95
+ - CHANGES
98
96
  - doc/ping.txt
99
- - lib/net/ping.rb
97
+ - examples/example_pingexternal.rb
98
+ - examples/example_pinghttp.rb
99
+ - examples/example_pingldap.rb
100
+ - examples/example_pingtcp.rb
101
+ - examples/example_pingudp.rb
100
102
  - lib/net/ping/external.rb
103
+ - lib/net/ping/http.rb
101
104
  - lib/net/ping/icmp.rb
102
- - lib/net/ping/wmi.rb
103
- - lib/net/ping/udp.rb
104
- - lib/net/ping/ping.rb
105
105
  - lib/net/ping/ldap.rb
106
- - lib/net/ping/http.rb
106
+ - lib/net/ping/ping.rb
107
107
  - lib/net/ping/tcp.rb
108
+ - lib/net/ping/udp.rb
109
+ - lib/net/ping/wmi.rb
110
+ - lib/net/ping.rb
111
+ - MANIFEST
108
112
  - net-ping.gemspec
109
- - CHANGES
110
- - examples/example_pinghttp.rb
111
- - examples/example_pingldap.rb
112
- - examples/example_pingexternal.rb
113
- - examples/example_pingtcp.rb
114
- - examples/example_pingudp.rb
115
- - test/test_net_ping_ldap.rb
113
+ - Rakefile
114
+ - README
115
+ - test/test_net_ping.rb
116
+ - test/test_net_ping_external.rb
116
117
  - test/test_net_ping_http.rb
117
118
  - test/test_net_ping_icmp.rb
119
+ - test/test_net_ping_ldap.rb
120
+ - test/test_net_ping_tcp.rb
118
121
  - test/test_net_ping_udp.rb
119
122
  - test/test_net_ping_wmi.rb
120
- - test/test_net_ping_external.rb
121
- - test/test_net_ping_tcp.rb
122
- - test/test_net_ping.rb
123
- - MANIFEST
124
- has_rdoc: true
125
123
  homepage: http://www.rubyforge.org/projects/shards
126
124
  licenses:
127
125
  - Artistic 2.0
@@ -151,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
149
  requirements: []
152
150
 
153
151
  rubyforge_project: shards
154
- rubygems_version: 1.6.2
152
+ rubygems_version: 1.8.10
155
153
  signing_key:
156
154
  specification_version: 3
157
155
  summary: A ping interface for Ruby.