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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dd0b3e4b1d7a17eff34595ed3f57d2aec1ded54
4
- data.tar.gz: cd24a3916671b8cdd118faa374e3206e1a0f26d4
3
+ metadata.gz: 3387bd0d4264b1f56556f6325a477dbc3a3a647a
4
+ data.tar.gz: fc405c6695559bd21de347f980ea6aec51155fff
5
5
  SHA512:
6
- metadata.gz: 6d9f931c672d9bb26a96db82f52ef1a7f419adad366f3a34cdbaef73ec7ad23bf8bb9c3ae143496a8600cb34ccc498ba9144803b45e8ccca65a68a4d47ad80a4
7
- data.tar.gz: cc5892b58c3271cf427a1e2286cc5cb504fc76b08fa3fde4b28f7bf1118ab66b2b91831927f5962d9adc0ab3805064389f0b7de25539b8a2a21e640e7eaf3773
6
+ metadata.gz: f1d554f97d2573faeb5e10b37e9c0807df76e22c8c1b63faf2b8badef12435ceede9ed67cec3f956f124ac9128fbe52c16e3c3dea415a0f70668c0857b73980b
7
+ data.tar.gz: e597799462a43cce744b68399452f545d93f19c2a5c58fbb1e3cc6d83f36907ea31a7e7374e5edf5f2088a45126ef5f63f0fa12f08fbe3c2a73fe40138e160df
data/README.md CHANGED
@@ -21,7 +21,7 @@ gem "mind_control"
21
21
  ## Requirements
22
22
 
23
23
  - Ruby 1.9+;
24
- - *NIX operating system (uses UNIX sockets);
24
+ - *NIX operating system (UNIX sockets is required);
25
25
 
26
26
  ## Usage
27
27
 
@@ -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( 0 )
41
+ socket.recv( 1 )
39
42
  end
40
43
  end
41
44
  end
@@ -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
@@ -55,7 +55,7 @@ module MindControl
55
55
  end
56
56
  end
57
57
 
58
- # We should known if our server failed
58
+ # We should known if our server has failed
59
59
  @server_thread.abort_on_exception = true
60
60
  end
61
61
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module MindControl
3
- VERSION = "0.1.3"
3
+ VERSION = "0.3.0"
4
4
  end
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", "~> 0.9"
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.1.3
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-06-07 00:00:00.000000000 Z
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: '0.9'
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: '0.9'
40
+ version: 0.9.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coolline
43
43
  requirement: !ruby/object:Gem::Requirement