fly.io-rails 0.0.3-x86_64-darwin → 0.0.4-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f76f7f8f758e7f3df3c22ed93a6ac83e543515844e6f7fce91d3902ac45f53a
4
- data.tar.gz: 23741fd32ddcd05f7bd6b7aaec10143f2c3c1c03b7a92a37f8561d7685468609
3
+ metadata.gz: d761c2159031bb548a02c3a3d014530970cecf70e064211ea5de62648ebe0a98
4
+ data.tar.gz: 4776fc2127f179a975bfbada9db38924a57ac5eac84df74518076b0a214c8e89
5
5
  SHA512:
6
- metadata.gz: f80a247c806c267b4ed8c8f9daff5b5669fc38c8a3377345b151ab29612a7e6e25b46905c66520f73c1f05fe6afaba17fabd50a0e0f59542e7c1482f213200ca
7
- data.tar.gz: 5da664fc355d08af2b5bfb1dbd761262d743c6d387ddbe4e1bdbaf457847705d24eec78c56e45757cd89809fee3dac034ae2b91983f2d4c04425f77c5eeec11a
6
+ metadata.gz: 8c3ac89e880120c9122fd628f2b08fec1bac1741f46a082a356d1d8f867ca231d65285e89eb3b9345af64060f0f0081a7a5d6194042c4ec9f20e91668825efa1
7
+ data.tar.gz: c90c79e99f143d57b7c36706f9db27de14bb472a55367ed67605ceedcf393f5e84115e2994749eac6d04fd005d461f1859a4c725a62414762115dc84ba549ced
Binary file
@@ -1,4 +1,4 @@
1
- require 'open3'
1
+ require 'pty'
2
2
 
3
3
  module FlyIoRails
4
4
  module Utils
@@ -9,27 +9,23 @@ module FlyIoRails
9
9
  end
10
10
 
11
11
  def self.tee cmd
12
- data = {:out => [], :err => []}
12
+ data = []
13
13
 
14
- Open3.popen3(cmd) do |stdin, stdout, stderr, thread|
15
- { out: stdout, err: stderr }.each do |key, stream|
16
- Thread.new do
17
- until (raw_line = stream.gets).nil? do
18
- data[key].push raw_line
19
-
20
- if key == :out
21
- STDOUT.print raw_line
22
- else
23
- STDERR.print raw_line
24
- end
25
- end
14
+ begin
15
+ PTY.spawn( cmd ) do |stdin, stdout, pid|
16
+ begin
17
+ # Do stuff with the output here. Just printing to show it works
18
+ stdin.each do |line|
19
+ print line
20
+ data << line
21
+ end
22
+ rescue Errno::EIO
26
23
  end
27
24
  end
28
-
29
- thread.join
25
+ rescue PTY::ChildExited
30
26
  end
31
27
 
32
- [data[:out].join, data[:err].join]
28
+ data.join
33
29
  end
34
30
 
35
31
  end
@@ -1,3 +1,3 @@
1
1
  module Fly_io
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -14,7 +14,7 @@ class TerraformGenerator < Rails::Generators::Base
14
14
  "flyctl apps create --generate-name --org #{options[:org].inspect}"
15
15
  end
16
16
 
17
- output, error = tee cmd
17
+ output = tee cmd
18
18
  exit 1 unless output =~ /^New app created: /
19
19
 
20
20
  @app = output.split.last
data/lib/tasks/fly.rake CHANGED
@@ -1,8 +1,8 @@
1
1
  namespace :fly do
2
2
  desc 'Deploy fly application'
3
3
  task :deploy do
4
- out, err = FlyIoRails::Utils.tee 'fly deploy --build-only --push'
5
- image = err[/image:\s+(.*)/, 1]
4
+ out = FlyIoRails::Utils.tee 'fly deploy --build-only --push'
5
+ image = out[/image:\s+(.*)/, 1]
6
6
 
7
7
  if image
8
8
  tf = IO.read('main.tf')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fly.io-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-16 00:00:00.000000000 Z
11
+ date: 2022-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fly-ruby