terminalwire-server 0.3.5.rc1 → 0.3.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.
- checksums.yaml +4 -4
- data/lib/terminalwire/server/context.rb +6 -0
- data/lib/terminalwire/server/thor.rb +29 -0
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41e5252b10fdd31ff77149c898f9afa324de081967c4072be72d211c5630a984
|
|
4
|
+
data.tar.gz: 555477ad2a6ee06b7dc980615643e14814125b55040743277fd099957cca3390
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68ca6ae7f130de4f745ebbdfae0e268163d4a42a21736a78e1c1d515b6f707456878e8e65420de8e3ce39e675ffa000b85750b302f8e6a3066ae24d7f74fd0ef
|
|
7
|
+
data.tar.gz: 5afe8d53ed096c495945e8e2ba92608c706dcae4599f234eca75936f5dfafd5a84bec29d954c29ada23ef1eb0d5126e78a6bb41c034b5a88fba88ccdba1be4f5
|
|
@@ -20,6 +20,12 @@ module Terminalwire::Server
|
|
|
20
20
|
def_delegators :@stdout, :puts, :print
|
|
21
21
|
def_delegators :@stdin, :gets, :getpass
|
|
22
22
|
|
|
23
|
+
# Direct stderr write, matching the v2 context's I/O surface so one Thor adapter
|
|
24
|
+
# (Terminalwire::V2::Server.dualize) can route `context.warn` over either protocol.
|
|
25
|
+
def warn(data = "")
|
|
26
|
+
@stderr.puts(data)
|
|
27
|
+
end
|
|
28
|
+
|
|
23
29
|
def initialize(adapter:, entitlement:)
|
|
24
30
|
@adapter = adapter
|
|
25
31
|
@entitlement = entitlement
|
|
@@ -16,6 +16,35 @@ module Terminalwire
|
|
|
16
16
|
@context = context
|
|
17
17
|
super(*,**,&)
|
|
18
18
|
end
|
|
19
|
+
|
|
20
|
+
protected
|
|
21
|
+
|
|
22
|
+
# Override ask_simply to use the Terminalwire context's stdin/stdout
|
|
23
|
+
# instead of Thor::LineEditor, which hardcodes $stdin/$stdout globals.
|
|
24
|
+
# This fixes ask, yes?, no?, and file_collision.
|
|
25
|
+
def ask_simply(statement, color, options)
|
|
26
|
+
default = options[:default]
|
|
27
|
+
message = [statement, ("(#{default})" if default), nil].uniq.join(" ")
|
|
28
|
+
message = prepare_message(message, *color)
|
|
29
|
+
|
|
30
|
+
stdout.print(message)
|
|
31
|
+
|
|
32
|
+
result = if options.fetch(:echo, true)
|
|
33
|
+
stdin.gets
|
|
34
|
+
else
|
|
35
|
+
stdin.getpass
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
return unless result
|
|
39
|
+
|
|
40
|
+
result = result.strip
|
|
41
|
+
|
|
42
|
+
if default && result == ""
|
|
43
|
+
default
|
|
44
|
+
else
|
|
45
|
+
result
|
|
46
|
+
end
|
|
47
|
+
end
|
|
19
48
|
end
|
|
20
49
|
|
|
21
50
|
def self.included(base)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: terminalwire-server
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.5
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brad Gessler
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-07-10 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: thor
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - '='
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.3.5
|
|
32
|
+
version: 0.3.5
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - '='
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.3.5
|
|
39
|
+
version: 0.3.5
|
|
40
40
|
description: Stream command-line apps from your server without a web API
|
|
41
41
|
email:
|
|
42
42
|
- brad@terminalwire.com
|
|
@@ -52,7 +52,7 @@ files:
|
|
|
52
52
|
- lib/terminalwire/server/web_socket.rb
|
|
53
53
|
homepage: https://terminalwire.com/ruby
|
|
54
54
|
licenses:
|
|
55
|
-
-
|
|
55
|
+
- Apache-2.0
|
|
56
56
|
metadata:
|
|
57
57
|
allowed_push_host: https://rubygems.org/
|
|
58
58
|
homepage_uri: https://terminalwire.com/ruby
|