net-ping 1.6.2-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDdiZmQ1OWMyOGEzZWQwYWFiOWM1ZDc3OTNiNGZkM2RjZTYxMzc0Zg==
5
+ data.tar.gz: !binary |-
6
+ ZGUyOTBlYmQ5ZGEyYjJmOGUwMjA0M2U2ZWI0MWQ4YmQzMTdjOWNhMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ODZiZDg3YjdhYzZhNDUxMzkxZjY2MjliODk2MGFiMzNiOWU2ZTAzNTM1NTM4
10
+ MjEzYzkyMzE3YmM5OTU4ZWRmOGE3OTViMzQyNTYzN2U2ZjI1MzllMTBjYTgy
11
+ ZGU2YTliYzFlOGUxMzAzMDg3NDQ1YjJjZDE1MmFlNTU2NWMyMjU=
12
+ data.tar.gz: !binary |-
13
+ ZDI4MjZhMmY3NDYxMTIyMjFlZjZmNmQyNWYzNDE0ODliYzRhMjRmZjVmNWI2
14
+ NTJiM2VhNWUzZDNkNjhmMDVhNjZiOGVhMDBjMTdiOWQ4YzY3MjRiYmRmM2Q4
15
+ NDdkZGU1ZTNjZWY3ZWEwMDNjOTNhOTIxNDJiYzhkYmYwM2E4MjU=
data/CHANGES ADDED
@@ -0,0 +1,287 @@
1
+ == 1.6.2 - 8-Aug-2013
2
+ * Fixed a bug in the ICMP ping helper module. Thanks go to Yuichi
3
+ Tsunematsu for the spot.
4
+ * The win32-security library is not just a development dependency. Thanks
5
+ again go to Yuichi Tsunematsu for the spot.
6
+ * Updated the icmp ping tests.
7
+ * Updated the gemspec for MS Windows.
8
+
9
+ == 1.6.1 - 17-Jul-2013
10
+ * Automatically set the scheme to "http" if not present when performing
11
+ HTTP pings. See https://bugs.ruby-lang.org/issues/8645 for an issue
12
+ with the uri library that led to this change. Thanks go to Preston Lee
13
+ for the spot.
14
+ * Removed the windows/system_info dependency, since it added other
15
+ dependencies just to check the Windows version. Instead, I added a
16
+ helper file that adds some needed Windows functions using FFI.
17
+ * Added Rake as a development dependency and updated the Gemfile
18
+ source because Bundler. Thanks to Jean-Philippe Doyle for the patches.
19
+ * Added some warning text to the Net::Ping::External tests for users
20
+ who are using OpenDNS. In short, you will probably get test failures
21
+ and surprising true results for bad hosts.
22
+
23
+ == 1.6.0 - 19-Mar-2013
24
+ * Split out the ldap portion of the code into its own branch.
25
+ * Don't require resolv-replace on Ruby 1.9.3 or later.
26
+ * Now gets proxy information from the http_proxy, https_proxy, and
27
+ no_proxy environment variables and uses that when making requests.
28
+ Thanks go to Kevin Olbrich for the patch.
29
+
30
+ == 1.5.3 - 29-Feb-2012
31
+ * Removed the Windows::Console dependency and replaced it with FFI since there
32
+ were only two functions needed. This had the nice side effect of making it
33
+ work with JRuby, too.
34
+ * Minor cleanup on some multi-variable assignment.
35
+ * Fixed require statements and one test for 1.9.
36
+
37
+ == 1.5.2 - 4-Nov-2011
38
+ * The Net::Ping::HTTP class now defaults to using HEAD instead of GET
39
+ for its ping test. You can alter this via the get_request accessor.
40
+ Thanks got to Balazs Kutil for the patch.
41
+ * Added the ssl_verify_mode accessor to the Net::Ping::HTTP class, which
42
+ defaults to VERIFY_NONE. This fixes possible warnings resulting from
43
+ missing SSL certificates when using https. Thanks go to Balazs Kutil
44
+ for the patch.
45
+
46
+ == 1.5.1 - 15-Sep-2011
47
+ * Use RbConfig on Ruby 1.9 and later. Thanks go to Torsten Schönebaum
48
+ for the patch.
49
+
50
+ == 1.5.0 - 3-May-2011
51
+ * Added the Net::Ping::LDAP class which allows you to perform LDAP pings.
52
+ Thanks go to Paul Gallagher for adding this.
53
+ * The duration instance variable is now reset to nil on a failed ping. Again,
54
+ thanks go to Paul Gallagher.
55
+
56
+ == 1.4.1 - 17-Mar-2011
57
+ * Incorporated changes from Lukas Zapletal that alters the icmp tests to use
58
+ your localhost instead of going outside the network.
59
+ * The http tests were similarly modified courtesy of fakeweb, which is now a
60
+ development dependency. Again, change from Lukas Zapletal.
61
+ * The icmp tests were reworked for Windows Vista and later. This required the
62
+ addition of the win32-security library as a development dependency.
63
+ * The Net::Ping::WMI class is no longer skipped on require or in tests since
64
+ JRuby now supports win32ole.
65
+
66
+ == 1.4.0 - 14-Feb-2011
67
+ * Added the redirect_limit accessor for the Net::Ping::HTTP class. This caps
68
+ the number of redirects that are allowed before a ping is considered a
69
+ failure. The default is 5.
70
+ * Changed the way in which redirects are detected. Previously I was checking
71
+ against the response class, but decided this was unreliable. I now check the
72
+ response code itself. Any code in the 300 range is considered a redirect.
73
+ * The default port for the Net::Ping::HTTP class is no longer explicitly set
74
+ to 80, but instead uses the result of the URI.parse(uri).port method by
75
+ default. Note that you can still override the port if you explicitly provide
76
+ one in the constructor.
77
+ * The Net::Ping::HTTP class now handles https URI's properly. Note that you may
78
+ get a warning about peer certificates.
79
+
80
+ == 1.3.7 - 14-Oct-2010
81
+ * Wrapped the ICMP ping in a while loop that breaks on success to prevent
82
+ the ping from failing too early. Thanks go to Benny Holmgren for the
83
+ spot and the patch.
84
+
85
+ == 1.3.6 - 4-Sep-2010
86
+ * Fixed variable naming issue in Net::Ping::External. Thanks go to taw
87
+ for the spot.
88
+ * Added a default Rake task.
89
+ * Refactored the tests for Net::Ping::External to take advantage of the
90
+ features of test-unit 2.x.
91
+
92
+ == 1.3.5 - 3-Sep-2010
93
+ * Allow for custom user agent in Net::Ping::HTTP. Thanks go to Michael
94
+ Reinsch for the patch.
95
+
96
+ == 1.3.4 - 25-Jun-2010
97
+ * Fixed a dumb platform bug. Thanks go to Jason Frey for the spot.
98
+
99
+ == 1.3.3 - 21-Jun-2010
100
+ * Bug fixes for JRuby on MS Windows. The code now explicitly checks for JRuby
101
+ in a few places to ensure it doesn't try to load unsupported libraries
102
+ on MS Windows. Thanks go to Rob Schultz for the spot and some patches.
103
+ * The Net::Ping::HTTP class will no longer fail because a root URI
104
+ is missing a trailing slash. If the URI#path is empty, it now defaults
105
+ to the root path.
106
+ * The Rakefile tasks and naming were refactored.
107
+ * Some tests were refactored to take advantage of test-unit 2.x features,
108
+ as well as make them better and more descriptive in general.
109
+
110
+ == 1.3.2 - 21-Sep-2009
111
+ * Doing a 'require "net/ping"' was not automatically loading the
112
+ Net::Ping::WMI class on MS Windows. This has been fixed. Thanks go to
113
+ Joseph M. for the spot.
114
+ * Removed all $LOAD_PATH mangling for both the library and tests.
115
+ * Fixed a bug in the Net::Ping::HTTP class where a failed redirect did
116
+ not set the @exception and @warning instance variables properly.
117
+ * The PingStatus struct returned by Net::Ping::WMI is now frozen.
118
+ * The test-unit library was switched from a runtime dependency to a
119
+ development dependency.
120
+ * Added the :gem Rake task that builds a gem.
121
+ * Updated the :gem_install task to use the :gem task as a prerequisite.
122
+ * Updated the dependencies for MS Windows.
123
+ * The Rake test tasks are now more Rakish, e.g. test:tcp instead of test_tcp.
124
+ * Renamed example file names to avoid any potential confusion with actual
125
+ test files.
126
+
127
+ == 1.3.1 - 22-Jul-2009
128
+ * Removed class aliases, e.g. use Ping::External, not PingExternal.
129
+ * Minor code change to eliminate a warning that popped up in 1.9.x.
130
+ * The win32-open3 library is removed as a dependency for Ruby 1.9.x.
131
+ * Changed license to Artistic 2.0.
132
+ * Some gemspec and README updates.
133
+
134
+ == 1.3.0 - 19-May-2009
135
+ * Added the Ping::WMI class for MS Windows. This class encapsulates the
136
+ Win32_PingStatus WMI class. Unlike other ping methods, this one returns
137
+ a struct that contains various bits of information.
138
+ * The Net::Ping::External class now ensures that handles opened by the open3
139
+ call are closed. Thanks go to Nick S. Kanakakorn for the spot and a
140
+ preliminary patch.
141
+ * The Net::Ping::ICMP class now explicitly closes the socket if the call to
142
+ the Socket.pack_sockaddr_in method fails.
143
+ * Some documentation updates.
144
+
145
+ == 1.2.3 - 13-Jan-2008
146
+ * Fixed a bug in the checksum private method where it would die on odd data
147
+ sizes. Thanks go to Jake Douglas for the spot.
148
+ * A Socket.get_sockaddr_in call in the Ping::ICMP class is no longer included
149
+ as part of the overall ping time. Thanks go again to Jake Douglas for
150
+ the spot.
151
+ * Added data_size tests to the Ping::ICMP test suite.
152
+ * Renamed and updated the test files. The test-unit 2.x gem is now a
153
+ prerequisite as a result.
154
+
155
+ == 1.2.2 - 22-Jan-2008
156
+ * Bug fix for Ping::External where it was not honoring the timeout value.
157
+ Thanks go to Chris Morris for the spot and the patch.
158
+ * Bug fix for Ping::External where non-English output could cause false
159
+ positives on MS Windows Vista or later. This library now requires the
160
+ windows-pr library on MS Windows systems as a result.
161
+ * Added the Ping::UDP.service_check and Ping::UDP.service_check= class
162
+ methods. This method controls whether or not Errno::ECONNREFUSED or
163
+ Errno::ECONNRESET are considered successful pings or not.
164
+ * The Ping::HTTP class no longer uses the resolv-replace library on MS Windows
165
+ because it was (ironically) causing timeouts.
166
+ * Changed the Ping::TCP.econnrefused method to Ping::TCP.service_check. I
167
+ changed it because I now use a similar method in Ping::UDP, but that handles
168
+ more than Errno::ECONNREFUSED. An alias is provided to provide backwards
169
+ compatibility, but it is considered deprecated and will be removed in the
170
+ 1.3.0 release.
171
+ * Removed the install.rb file. The Rakefile now handles installation.
172
+
173
+ == 1.2.1 - 6-Apr-2007
174
+ * For the Ping::External class, if a ping attempt results in 100% packet loss
175
+ it is now considered a failed ping, regardless of whether or not an error
176
+ was sent to stdout.
177
+ * Fixed the Ping::External class for OS X.
178
+ * Added a Rakefile. Installation and testing should now be run via Rake tasks.
179
+ * Minor fix for the Ping::ICMP class where I had accidentally dup'd some
180
+ aliases. This was harmless, but did cause warnings with -w.
181
+
182
+ == 1.2.0 - 5-Dec-2006
183
+ * Internal reorganization - each class now lives in its own file.
184
+ * Added the Ping::ICMP class. Thanks go to Jos Backus for contributing a
185
+ large part of the code.
186
+ * The host argument is now optional in the constructor. You can now specify
187
+ it in the ping method instead. Note that it must be specified in one place
188
+ or the other.
189
+ * Each PingXXX class is now Ping::XXX instead. However, class name aliases
190
+ have been setup for backwards compatibility for now.
191
+ * The constructor for each Ping types now yields self.
192
+ * Added the pingecho alias for the ping method for each Ping type.
193
+ * Added the Ping::HTTP#follow_redirect accessor.
194
+ * The Ping::HTTP#ping method now honors the timeout value.
195
+ * The Ping::HTTP class now follows redirects automatically, though this is
196
+ configurable with the follow_redirect accessor.
197
+ * The Ping::TCP.ecr and Ping::TCP.ecr= methods are now true class method
198
+ aliases (they were just wrappers previously).
199
+ * The Ping::UDP class now enforces a 64 character limit on data that can be
200
+ sent on a udp ping.
201
+ * Updated the gemspec. Specifically, MS Windows now has a dependency on
202
+ the win32-open3 package.
203
+ * Added inline rdoc.
204
+
205
+ == 1.1.1 - 15-Jun-2006
206
+ * Fixed a bug in PingTCP (bad variable name). Thanks go to Anoop Chandran
207
+ for the spot.
208
+ * Minor variable name refactoring.
209
+ * Minor test updates.
210
+
211
+ == 1.1.0 - 17-Jul-2005
212
+ * Fixed a bug in the PingHTTP#ping method where I was accidentally passing
213
+ the timeout value instead of the port number as the third argument to
214
+ Net::HTTP.get_response.
215
+ * The PingHTTP.new method now has a default port of 80.
216
+ * Minor doc update for PingHTTP.new.
217
+
218
+ == 1.0.1 - 22-Jun-2005
219
+ * Bug fix for the install.rb file. The gem is unaffected.
220
+
221
+ == 1.0.0 - 14-Jun-2005
222
+ * Renamed project from net-pingsimple to just net-ping.
223
+ * Added a PingHTTP subclass.
224
+ * Moved project to RubyForge.
225
+ * Added a gemspec.
226
+
227
+ == 0.3.1 - 9-Apr-2005
228
+ * Updated PingExternal to use win32/open3 on Win32 platforms.
229
+ * Minor error handling change for the PingSimple.econnrefused= method. It now
230
+ raises an ArgumentError if any values other than true or false are passed.
231
+ * PingSimple#warning and PingSimple#exception are now read-only methods.
232
+ * The warning and exception attributes are now reset to nil between each call
233
+ to ping.
234
+ * The data and data= methods are now unique to the PingUDP class.
235
+ * The time and time= methods have been changed to timeout and timeout=,
236
+ respectively.
237
+ * Removed the pingsimple.rd and pingsimple.html files. The pingsimple.txt file
238
+ has been reorganized and is now rdoc friendly.
239
+ * Added a few sample programs under the 'examples' directory.
240
+ * Some minor test updates and changes.
241
+ * Removed the INSTALL file. That information is now in the README file.
242
+ * Now requires Ruby 1.8.0 or later.
243
+
244
+ == 0.3.0 - 12-Feb-2004
245
+ * Fixed ping string for PingExternal class based on platform. The old
246
+ string was really only good for Linux and *BSD.
247
+ * Added Win32 support (requires win32_popen package).
248
+ * Added warranty info.
249
+
250
+ == 0.2.3 - 12-Aug-2003
251
+ * Fixed a bug in PingExternal that could consume file descriptors if used in a loop
252
+ * Added some initialization to avoid -w warnings
253
+ * Removed VERSION() class method. Use the constant instead
254
+ * Modified test suite slightly
255
+ * Moved rd2 docs to doc directory
256
+
257
+ == 0.2.2 - 3-Apr-2003
258
+ * Fixed handling of stdout in PingExternal
259
+
260
+ == 0.2.1 - 27-Mar-2003
261
+ * Fixed major bug with PingExternal class with regards to down hosts
262
+ * Exceptions and warnings from PingExternal are now chomp'd
263
+ * Modified test suite
264
+ * Doc updates
265
+
266
+ == 0.2.0 - 14-Feb-2003
267
+ * The default behavior of PingTCP with regards to ECONNREFUSED is now
268
+ configurable
269
+ * Added a VERSION constant and method (to the base class)
270
+ * Added a test suite (for those with testunit installed)
271
+ * Doc changes, rearrangement and general cleanup
272
+ * Manifest is now MANIFEST
273
+ * Added an INSTALL file
274
+
275
+ == 0.1.0 - 9-Dec-2002
276
+ * Added ping? alias for ping method
277
+ * Warnings now handled separately
278
+ * Corrected a mis-named variable in Ping::External
279
+ * Fixed the install.rb file
280
+ * Updated and added docs
281
+ * Renamed tarball to net-pingsimple to reflect RAA naming convention
282
+
283
+ == 0.0.1a
284
+ * Did this release ever happen?
285
+
286
+ == 0.0.1
287
+ * Initial release.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'http://rubygems.org'
2
+ gemspec
data/MANIFEST ADDED
@@ -0,0 +1,25 @@
1
+ * MANIFEST
2
+ * CHANGES
3
+ * Rakefile
4
+ * README
5
+ * net-ping.gemspec
6
+ * examples/example_pingexternal.rb
7
+ * examples/example_pinghttp.rb
8
+ * examples/example_pingtcp.rb
9
+ * examples/example_pingudp.rb
10
+ * lib/net/ping.rb
11
+ * lib/net/ping/icmp.rb
12
+ * lib/net/ping/ldap.rb
13
+ * lib/net/ping/tcp.rb
14
+ * lib/net/ping/udp.rb
15
+ * lib/net/ping/wmi.rb
16
+ * lib/net/ping/http.rb
17
+ * lib/net/ping/external.rb
18
+ * test/test_net_ping_external.rb
19
+ * test/test_net_ping_http.rb
20
+ * test/test_net_ping_icmp.rb
21
+ * test/test_net_ping_ldap.rb
22
+ * test/test_net_ping_tcp.rb
23
+ * test/test_net_ping_udp.rb
24
+ * test/test_net_ping_wmi.rb
25
+ * test/test_net_ping.rb
data/README ADDED
@@ -0,0 +1,54 @@
1
+ == Description
2
+ A collection of classes that provide different ways to ping computers.
3
+
4
+ == Prerequisites
5
+ * ffi
6
+ * win32-security (MS Windows only)
7
+ * win32-open3 (Ruby 1.8.x on MS Windows only. Not required for JRuby)
8
+ * fakeweb (test only)
9
+ * test-unit (test only)
10
+
11
+ JRuby users should use JRuby 1.6.7 or later.
12
+
13
+ == Installation
14
+ gem install net-ping
15
+
16
+ == Notes
17
+ Please read the documentation under the 'doc' directory. Especially pay
18
+ attention to the documentation pertaining to ECONNREFUSED and TCP pings.
19
+
20
+ Also note the documentation regarding down hosts.
21
+
22
+ You do not need win32-open3 with Ruby 1.9.x. The open3 library that ships
23
+ as part of the Ruby standard library should work.
24
+
25
+ == How to require net-ping
26
+ You can do either this:
27
+
28
+ require 'net/ping'
29
+
30
+ In which case you will get Net::Ping and all of its subclasses. Or,
31
+ you can load individual subclasses like this:
32
+
33
+ require 'net/ping/tcp'
34
+
35
+ The former has the advantage of being easier to remember and all inclusive,
36
+ not to mention backwards compatible. The latter has the advantage of
37
+ reducing your memory footprint.
38
+
39
+ == Known Issues
40
+ Older versions of Ruby 1.9.x may not work with UDP pings.
41
+
42
+ Older versions of JRuby will return false positives in UDP pings
43
+ because of an incorrect error class being raised. See JRuby-4896.
44
+
45
+ JRuby 1.6.7 or later is required for external pings because of a bug
46
+ in earlier versions with open3 and stream handling.
47
+
48
+ == License
49
+ Artistic 2.0
50
+
51
+ == More documentation
52
+ If you installed this library via Rubygems, you can view the inline
53
+ documentation via ri or fire up 'gem server', and point your browser at
54
+ http://localhost:8808.
data/Rakefile ADDED
@@ -0,0 +1,94 @@
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+ include Object.const_defined?(:RbConfig) ? RbConfig : Config
5
+
6
+ CLEAN.include("**/*.gem", "**/*.rbc")
7
+
8
+ namespace 'gem' do
9
+ desc 'Create the net-ping gem'
10
+ task :create => [:clean] do
11
+ spec = eval(IO.read('net-ping.gemspec'))
12
+ if Gem::VERSION.to_f < 2.0
13
+ Gem::Builder.new(spec).build
14
+ else
15
+ require 'rubygems/package'
16
+ Gem::Package.build(spec)
17
+ end
18
+ end
19
+
20
+ desc 'Install the net-ping gem'
21
+ task :install => [:create] do
22
+ gem_file = Dir["*.gem"].first
23
+ sh "gem install #{gem_file}"
24
+ end
25
+ end
26
+
27
+ namespace 'example' do
28
+ desc 'Run the external ping example program'
29
+ task :external do
30
+ ruby '-Ilib examples/example_pingexternal.rb'
31
+ end
32
+
33
+ desc 'Run the http ping example program'
34
+ task :http do
35
+ ruby '-Ilib examples/example_pinghttp.rb'
36
+ end
37
+
38
+ desc 'Run the tcp ping example program'
39
+ task :tcp do
40
+ ruby '-Ilib examples/example_pingtcp.rb'
41
+ end
42
+
43
+ desc 'Run the udp ping example program'
44
+ task :udp do
45
+ ruby '-Ilib examples/example_pingudp.rb'
46
+ end
47
+ end
48
+
49
+ Rake::TestTask.new do |t|
50
+ t.libs << 'test'
51
+ t.warning = true
52
+ t.verbose = true
53
+ t.test_files = FileList['test/test_net_ping.rb']
54
+ end
55
+
56
+ namespace 'test' do
57
+ Rake::TestTask.new('external') do |t|
58
+ t.warning = true
59
+ t.verbose = true
60
+ t.test_files = FileList['test/test_net_ping_external.rb']
61
+ end
62
+
63
+ Rake::TestTask.new('http') do |t|
64
+ t.warning = true
65
+ t.verbose = true
66
+ t.test_files = FileList['test/test_net_ping_http.rb']
67
+ end
68
+
69
+ Rake::TestTask.new('icmp') do |t|
70
+ t.warning = true
71
+ t.verbose = true
72
+ t.test_files = FileList['test/test_net_ping_icmp.rb']
73
+ end
74
+
75
+ Rake::TestTask.new('tcp') do |t|
76
+ t.warning = true
77
+ t.verbose = true
78
+ t.test_files = FileList['test/test_net_ping_tcp.rb']
79
+ end
80
+
81
+ Rake::TestTask.new('udp') do |t|
82
+ t.warning = true
83
+ t.verbose = true
84
+ t.test_files = FileList['test/test_net_ping_udp.rb']
85
+ end
86
+
87
+ Rake::TestTask.new('wmi') do |t|
88
+ t.warning = true
89
+ t.verbose = true
90
+ t.test_files = FileList['test/test_net_ping_wmi.rb']
91
+ end
92
+ end
93
+
94
+ task :default => :test