mpx 0.3.0 → 0.4.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
  SHA256:
3
- metadata.gz: 3d3b92cae99091cb285b663712094db342f5f7f48c1bd06013c0247c51e66efd
4
- data.tar.gz: 9cf6939064ebf6c9c50a17358d72ca9d91940107ace578f4944d4e5fed1d3162
3
+ metadata.gz: 5d4024df892bfb9cab3f22078316bd47253298d8e25e77aba69cdaabb547883f
4
+ data.tar.gz: 70072040b9f2b7e30999272159fcfc97c32ecda72f9eb7b5ca863945e347eea6
5
5
  SHA512:
6
- metadata.gz: cd5091fe7d3361e2b80aeb6062cac7dcc5525e80206aadafe2adf3b9168fa3e4629415d4c81e9012d61d6b4661667fffc5d452e07c0ff17843d02a78b4520678
7
- data.tar.gz: 27deb6a363547f71e6c94ef08178fc3a91c04ca31427e11e58b4cd8fdb54e246120b3376ebf5919bcc728582d817ba55ba31b99cc8133c8cb42c29e5dcd3b73e
6
+ metadata.gz: b1957de8c9f898a9eef2a7b37d63030a2b8d21429a5846552bb7c719ed80296ba884b84e64d2c70a672ab5d5267e9726bccc68602551fd1a24cba4b23f59b373
7
+ data.tar.gz: bec609739e6f7b9c78d59350f42f7340480c5eadb06a9329cff523d12dc91821a6794b04b7b4f8b4065c59b36eb2c039e0df0155cb8495bcd038dc1a39b7fbe2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mpx (0.2.0)
4
+ mpx (0.3.0)
5
5
  ansi (~> 1.5)
6
6
 
7
7
  GEM
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
- threads = commands.map do |command|
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
- result
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
@@ -1,3 +1,3 @@
1
1
  module Mpx
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.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-04 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi