fly.io-rails 0.0.3-arm64-darwin → 0.0.4-arm64-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: 10e727052bd41ea67d1e11cfa2a5bbc17471b9cdf9683d706d58f66e36792179
4
- data.tar.gz: 395c4d0ff49ec2cdfdce17ca6bfebf7f24417f35ccc51b05d7edda36eb6d6d76
3
+ metadata.gz: 6cd13a0c22240dd05793b760407c5a8532d773ed0bdcec16a09cf76b3b6b94e0
4
+ data.tar.gz: 757e2c5f7153115d1cf4d54067086251d7f820b5d099e69e33d8f12ec7099d45
5
5
  SHA512:
6
- metadata.gz: ebf763915628208e68d7e5bead7b1ff19fcea398f5d245bbeefa2a49245f0a246d3850942297959ce3d2498e2bc0f6bb3edf93be2de474c9cd6ace98d5d96efe
7
- data.tar.gz: 6c9ce9ba198cfe92408959ed507ce14a83f58767c2bf56bffca70446ee7fe69398d2e1e7c510043a9594caa1e656e980e54b7ad655ebced970a8b6a9d6e10d0d
6
+ metadata.gz: 6e5921e3ef4d111623abcf585e3421d7399177fe078fcbb2b552722ff73a2af7c071622d61b9f6c53c783f0b7adbb384e2aaba9b2f0a7b8f2676a38cf58a58de
7
+ data.tar.gz: ac24a1b07efbf09eaf4025935a08a4e74e3e6b155ee814b6dc66e9c54b114375d64404ebe8ab2e8584a55dd6507e427e20a4f43ce9a13e7f90e106f07971c663
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: arm64-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