fly.io-rails 0.3.0 → 0.3.1

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: bf047fddfe38280f888b4c2f8e2215172d89bdaaeb3c9e0d082c00014047e110
4
- data.tar.gz: 5428fb05b28780d0640baf068ba1c3d326fef353771c1cbf8fcd0ccba32b100c
3
+ metadata.gz: b0946f350aad927042c4071c450d4b496604d5875cf897da8922d0a371340ec1
4
+ data.tar.gz: 01150ca673153921b0e45c7bbb3c2a8f92af54690246540de7013ebb1152d4aa
5
5
  SHA512:
6
- metadata.gz: efbdb4918b945916191ba8bb0452788d73c5066411fef2318eb45b1e6d6d2a6f0218b353bbc835856ab6d405dc3e9b5d8b77fdb3b575d7bd2bc00ebc71bf7c93
7
- data.tar.gz: 034d4cf87622aa1988c33e33b3b48f5872b5863c7f12f36f3364dcca58ae16f2b347df25cf6f18e1ea19f1e13b1618606e386ec69ed10d4429f5957a147ae1fa
6
+ metadata.gz: f2ded02fe306b754519a92436c847e7827025dc210324d45af17d0d0e8426cf07ef2d2547014aaee90a67dc040a70c4bfe59127ea498ee0f293044e8339d373e
7
+ data.tar.gz: f06701cee20630b08805f36a9959d78e83904a804fea6957c9d0cfcb04919121a8efc6e07da77e31af474dec62d19227bb880c79332f6cd54f675c850bcc39b1
@@ -1,4 +1,8 @@
1
- require 'pty'
1
+ begin
2
+ require 'pty'
3
+ rescue LoadError
4
+ # Presumably Windows
5
+ end
2
6
 
3
7
  module FlyIoRails
4
8
  module Utils
@@ -11,18 +15,28 @@ module FlyIoRails
11
15
  def self.tee cmd
12
16
  data = []
13
17
 
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
18
+ if defined? PTY
19
+ begin
20
+ # PTY supports ANSI cursor control and colors
21
+ PTY.spawn(cmd) do |read, write, pid|
22
+ begin
23
+ read.each do |line|
24
+ print line
25
+ data << line
26
+ end
27
+ rescue Errno::EIO
28
+ end
29
+ end
30
+ rescue PTY::ChildExited
31
+ end
32
+ else
33
+ # no support for ANSI cursor control and colors
34
+ Open3.popen2e(cmd) do |stdin, out, thread|
35
+ out.each do |line|
36
+ print line
37
+ data << line
23
38
  end
24
39
  end
25
- rescue PTY::ChildExited
26
40
  end
27
41
 
28
42
  data.join
@@ -1,3 +1,3 @@
1
1
  module Fly_io
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-21 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fly-ruby
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description:
55
+ description:
56
56
  email: rubys@intertwingly.net
57
57
  executables: []
58
58
  extensions: []
@@ -93,7 +93,7 @@ licenses:
93
93
  - Apache-2.0
94
94
  metadata:
95
95
  homepage_uri: https://github.com/rubys/fly.io-rails
96
- post_install_message:
96
+ post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
99
99
  - lib
@@ -108,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.3.5
112
- signing_key:
111
+ rubygems_version: 3.3.11
112
+ signing_key:
113
113
  specification_version: 4
114
114
  summary: Rails support for Fly-io
115
115
  test_files: []