pipa 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pipa.rb +20 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 694998b5a4309d4faacf4183ecf7cb8541a40c86
4
- data.tar.gz: b3285ca9af59c771d9a676540dd3a2c09003d058
3
+ metadata.gz: b9984a1186d0dcef2d457a4ed11d2ba94dc362a2
4
+ data.tar.gz: a1c63d6b8d8bed3bcc1e873819a42d2340228860
5
5
  SHA512:
6
- metadata.gz: 074fae7374f8ac5c280b103bb91e1c3de53de15c8791f3aa405a1edc55d32343f269dc45fb1a8fc8328b5ce5e85a180332ad392b968ea5b1f03cb3a773a25624
7
- data.tar.gz: c397d29ab6c7ae786478fa2e0c2bc589c8403556e5fc0a08b026dd12020b987cc8667619ffcc15f7a4ed99d1892f905808023cdd3bbb909a0177da2d4d8a0109
6
+ metadata.gz: 195419e18c8fda04a154fead718a36658c3c0e216f7e0512f933efb548c38a9776fa3de10c10da9a59a4ed1428e7a69a146f7fd6ce8a16fbffe5b62764bab7ca
7
+ data.tar.gz: 565f18551e74782db149084f3c17e10c51a2527e1679bce62c2aa618c545232d8cfe67b2890097d6c9064ca816690b8e3958f2930233ddcd483150716c5ce2da
data/lib/pipa.rb CHANGED
@@ -70,7 +70,26 @@ class Pipa
70
70
 
71
71
  cmd = case mode
72
72
  when "bash"
73
- ["bash", "-e", "-c", "bash -e -c '#{@stages[stage][mode]}' | ruby -e \"require 'json'; print ARGF.read.to_json\" | tee >(cat >&3)"]
73
+ ["ruby", "-e", %Q(
74
+ require 'json'
75
+ require 'open3'
76
+
77
+ Open3.popen2e("bash", "-e", "-c", #{@stages[stage][mode].dump}) do |stdin, stdout_err, wait_thr|
78
+ ret = ""
79
+ while line = stdout_err.gets
80
+ print line
81
+ ret += line
82
+ end
83
+
84
+ exit_status = wait_thr.value
85
+ if exit_status.success?
86
+ ret_fd = IO.open(3, 'w')
87
+ ret_fd.write(ret.to_json);
88
+ ret_fd.close
89
+ end
90
+ exit(exit_status.exitstatus)
91
+ end
92
+ )]
74
93
  when "ruby"
75
94
  ["ruby", "-e", %Q(
76
95
  require 'json'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Cantón Cortés