fidoci 0.1.4 → 0.1.5

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/fidoci/env.rb +15 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 543cde1011ef2c3f6749ed894edbc673ae334c30
4
- data.tar.gz: dfef4c56ec29b5fd4167a23ef0ea9b4e0797d79c
3
+ metadata.gz: 80f0134e171cd9eee7e9c360fd7cb01eb010aeed
4
+ data.tar.gz: 5ab4322d0b6105ba143edf3021eccc0037e950d9
5
5
  SHA512:
6
- metadata.gz: 9ca334c1d3b25052d0a92daacfded2c2f518c7952003d758e17bf05f20c9aa703fe932d3d1ac06b9ca3154ec065cd271eb601e586ed1b31e61fe11514188910d
7
- data.tar.gz: 176c8238e6f2bc3a171fc08d30ad1114e76ab3da7ad43dd6c5dba90bdfcdb3d9a85108921e48286d559d2d2881a8063915de572bc92ce7ccb759287a767e8b66
6
+ metadata.gz: 56cc4658a5f9a2502b4a2e38fc7e65b03464893922a339ac613b8ad4f9908a6798989372d104acde34c5b96de6d862d18b8d4c24edba2e76d910417f7aa98113
7
+ data.tar.gz: 3b01864360eabf3c9d95004f56a77ba01dfae83c30ca7792c8f289e9d39f598be2c45511abc9b2ec5fff6d1615292055cc66525193a4dc74e59d076e63c69609
data/lib/fidoci/env.rb CHANGED
@@ -208,8 +208,12 @@ module Fidoci
208
208
  params["Cmd"] = args
209
209
 
210
210
  docker_exec = Docker::Exec.create(params)
211
- result = docker_exec.start!(tty: true, stdin: $stdin) do |msg|
212
- $stdout << msg
211
+ result = nil
212
+
213
+ $stdin.raw do
214
+ result = docker_exec.start!(tty: true, stdin: $stdin) do |msg|
215
+ $stdout << msg
216
+ end
213
217
  end
214
218
 
215
219
  debug "Exited with status #{result[2]}"
@@ -241,8 +245,16 @@ module Fidoci
241
245
 
242
246
  container = Docker::Container.create(params)
243
247
 
244
- container.start!.attach(stdin: $stdin, tty: true) do |msg|
248
+ receiver = ->(msg) {
245
249
  $stdout << msg
250
+ }
251
+
252
+ if $stdin && $stdin.tty?
253
+ $stdin.raw do
254
+ container.start!.attach(tty: true, stdin: $stdin, &receiver)
255
+ end
256
+ else
257
+ container.start!.attach(tty: true, &receiver)
246
258
  end
247
259
 
248
260
  status = container.json['State']['ExitCode']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fidoci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Dolezal