mind_control 0.1.3 → 0.3.0
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/README.md +1 -1
- data/lib/mind_control/client.rb +6 -3
- data/lib/mind_control/repl.rb +1 -1
- data/lib/mind_control/server.rb +1 -1
- data/lib/mind_control/version.rb +1 -1
- data/mind_control.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3387bd0d4264b1f56556f6325a477dbc3a3a647a
|
4
|
+
data.tar.gz: fc405c6695559bd21de347f980ea6aec51155fff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d554f97d2573faeb5e10b37e9c0807df76e22c8c1b63faf2b8badef12435ceede9ed67cec3f956f124ac9128fbe52c16e3c3dea415a0f70668c0857b73980b
|
7
|
+
data.tar.gz: e597799462a43cce744b68399452f545d93f19c2a5c58fbb1e3cc6d83f36907ea31a7e7374e5edf5f2088a45126ef5f63f0fa12f08fbe3c2a73fe40138e160df
|
data/README.md
CHANGED
data/lib/mind_control/client.rb
CHANGED
@@ -19,10 +19,13 @@ module MindControl
|
|
19
19
|
# @return [Array<MindControl::Client::Process>]
|
20
20
|
#
|
21
21
|
def get_running_processes( sockets_dir )
|
22
|
-
Dir.glob( File.join( sockets_dir, "*.sock" )).map do |file|
|
22
|
+
processes = Dir.glob( File.join( sockets_dir, "*.sock" )).map do |file|
|
23
23
|
name, pid = File.basename( file, ".sock" ).split( "." )
|
24
|
-
Process.new( name, pid, file )
|
24
|
+
Process.new( name, pid.to_i, file )
|
25
25
|
end
|
26
|
+
|
27
|
+
# Ignore not existent processes
|
28
|
+
processes.select { |process| ::Process.kill( 0, process.pid ) rescue false }
|
26
29
|
end
|
27
30
|
|
28
31
|
##
|
@@ -35,7 +38,7 @@ module MindControl
|
|
35
38
|
socket.send_io STDOUT
|
36
39
|
|
37
40
|
# Wait for disconnect
|
38
|
-
socket.recv(
|
41
|
+
socket.recv( 1 )
|
39
42
|
end
|
40
43
|
end
|
41
44
|
end
|
data/lib/mind_control/repl.rb
CHANGED
@@ -68,7 +68,7 @@ module MindControl
|
|
68
68
|
# By default Coolline will kill host program on Ctrl+c. Override it.
|
69
69
|
ctrl_c_handler = cool.handlers.find { |handler| handler.char == ?\C-c }
|
70
70
|
ctrl_c_handler.block = lambda { |instance|
|
71
|
-
# Just close Pry
|
71
|
+
# XXX: Just close Pry
|
72
72
|
instance.instance_variable_set "@should_exit", true
|
73
73
|
}
|
74
74
|
end
|
data/lib/mind_control/server.rb
CHANGED
data/lib/mind_control/version.rb
CHANGED
data/mind_control.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = [ "lib" ]
|
19
19
|
|
20
20
|
spec.add_dependency "highline", "~> 1.6"
|
21
|
-
spec.add_dependency "pry", "
|
21
|
+
spec.add_dependency "pry", ">= 0.9.11"
|
22
22
|
spec.add_dependency "coolline", "~> 0.4"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mind_control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Diachkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.9.11
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.9.11
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coolline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|