mpx 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mpx/cli.rb +7 -8
- data/lib/mpx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d4024df892bfb9cab3f22078316bd47253298d8e25e77aba69cdaabb547883f
|
4
|
+
data.tar.gz: 70072040b9f2b7e30999272159fcfc97c32ecda72f9eb7b5ca863945e347eea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1957de8c9f898a9eef2a7b37d63030a2b8d21429a5846552bb7c719ed80296ba884b84e64d2c70a672ab5d5267e9726bccc68602551fd1a24cba4b23f59b373
|
7
|
+
data.tar.gz: bec609739e6f7b9c78d59350f42f7340480c5eadb06a9329cff523d12dc91821a6794b04b7b4f8b4065c59b36eb2c039e0df0155cb8495bcd038dc1a39b7fbe2
|
data/Gemfile.lock
CHANGED
data/lib/mpx/cli.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'thread'
|
1
2
|
require 'mpx/request'
|
2
3
|
require 'mpx/loader'
|
3
4
|
require 'mpx/version'
|
@@ -112,18 +113,16 @@ EOF
|
|
112
113
|
commands = loader.load(request.name).sort
|
113
114
|
history = loader.history
|
114
115
|
|
115
|
-
|
116
|
+
mut = Mutex.new
|
117
|
+
commands.map do |command|
|
116
118
|
Thread.new do
|
117
119
|
result = command.run(request.args)
|
118
120
|
history.write(command.name, *request.args)
|
119
|
-
|
121
|
+
mut.synchronize {
|
122
|
+
puts result
|
123
|
+
}
|
120
124
|
end
|
121
|
-
end
|
122
|
-
|
123
|
-
threads.each do |t|
|
124
|
-
puts t.value
|
125
|
-
puts
|
126
|
-
end
|
125
|
+
end.map(&:value)
|
127
126
|
end
|
128
127
|
|
129
128
|
def self.get_root
|
data/lib/mpx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Chan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi
|