em-simple_telnet 0.0.8 → 0.0.9
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 +4 -4
- data/lib/em-simple_telnet.rb +0 -27
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c4aab9248d4b5ccdcf26df97d65c76538547400
|
4
|
+
data.tar.gz: c0f70fd5b4944e728c69efb73e0670c7b652b094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0826dd91834c7a2c0de84af593b8c3b5adfbbb5027e02e2474116f405613a550a855c47af9b92bdd0cd291e2f38aea2cb036640ac37b6ba205bed5c755cdcdd9
|
7
|
+
data.tar.gz: aeb3ce7d37acff62fd09dad0956517ac4069478426d429a1d5cc5c5b6c87ea77ee215163a7045bd8a81efbf3dc886250883002d4793373c250a376990fcbe0f3
|
data/lib/em-simple_telnet.rb
CHANGED
@@ -3,33 +3,6 @@ require 'timeout' # for Timeout::Error
|
|
3
3
|
require "socket" # for SocketError
|
4
4
|
require "eventmachine"
|
5
5
|
|
6
|
-
##
|
7
|
-
# This defines EventMachine::defers_finished? which is used by StopWhenEMDone
|
8
|
-
# to stop EventMachine safely when everything is done. The method returns
|
9
|
-
# +true+ if the @threadqueue and @resultqueue are undefined/nil/empty *and*
|
10
|
-
# none of the threads in the threadpool isn't working anymore.
|
11
|
-
#
|
12
|
-
# To do this, the method ::spawn_threadpool is redefined to start threads that
|
13
|
-
# provide a thread-local variable :working (like
|
14
|
-
# <tt>thread_obj[:working]</tt>). This variable tells whether the thread is
|
15
|
-
# still working on a deferred action or not.
|
16
|
-
#
|
17
|
-
module EventMachine # :nodoc:
|
18
|
-
# ensure they're always defined
|
19
|
-
@threadpool = @threadqueue = @resultqueue = nil
|
20
|
-
|
21
|
-
##
|
22
|
-
# Returns +true+ if all deferred actions are done executing and their
|
23
|
-
# callbacks have been fired.
|
24
|
-
#
|
25
|
-
def self.defers_finished?
|
26
|
-
return false if @threadqueue and not @threadqueue.empty?
|
27
|
-
return false if @resultqueue and not @resultqueue.empty?
|
28
|
-
return false if @threadpool and @threadqueue.num_waiting != @threadpool.size
|
29
|
-
return true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
6
|
##
|
34
7
|
# Provides the facility to connect to telnet servers using EventMachine. The
|
35
8
|
# asynchronity is hidden so you can use this library just like Net::Telnet in
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-simple_telnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Wenger
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0
|
19
|
+
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0
|
26
|
+
version: 1.0.0
|
27
27
|
description: This library provides a very simple way to connect to telnet servers
|
28
28
|
using EventMachine in a seemingly synchronous manner.
|
29
29
|
email:
|
@@ -59,3 +59,4 @@ signing_key:
|
|
59
59
|
specification_version: 4
|
60
60
|
summary: Simple telnet client on EventMachine
|
61
61
|
test_files: []
|
62
|
+
has_rdoc: true
|