terminalwire 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/terminalwire/authority.rb +1 -6
- data/lib/terminalwire/client/entitlement.rb +16 -7
- data/lib/terminalwire/client.rb +9 -0
- data/lib/terminalwire/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d25d091ee29d5953cfc70935227461ed75ec3d52c5b4cbff96db9e4b30ea7a
|
4
|
+
data.tar.gz: 80325aea9d946a9050ab4d9a97003186aba8a826e04ccefa23783a6fcfeea4dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc79939e4328e469df0a13f5ec34ed0e99c5f7206712a8480916b55005b95fcf544de98884d33f306fcb16a02fa4868aa09f302087e3015c02c80d42c8429a75
|
7
|
+
data.tar.gz: 0e00b629b2ae76adddef05725f2f3fb8b1550e55b513fdd77317a978f2a416a0876af450ac47da4c0ee011fb8239623e37f7887bc0bd627ac2cb258b0779077a
|
@@ -19,15 +19,10 @@ class Terminalwire::Authority
|
|
19
19
|
if @url.port == @url.default_port
|
20
20
|
@url.host
|
21
21
|
else
|
22
|
-
"#{
|
22
|
+
"#{url.host}:#{url.port}"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
# Useful for identifying the authority in UI without the protocol.
|
27
|
-
def name
|
28
|
-
[domain, path].join
|
29
|
-
end
|
30
|
-
|
31
26
|
# Make sure there's always a / at the end of the path.
|
32
27
|
def path
|
33
28
|
path_keys.join(PATH_SEPERATOR).prepend(PATH_SEPERATOR)
|
@@ -145,8 +145,7 @@ module Terminalwire::Client
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def authority_path
|
148
|
-
|
149
|
-
root_path.join("authorities/#{authority.domain}")
|
148
|
+
root_path.join("authorities/#{authority}")
|
150
149
|
end
|
151
150
|
|
152
151
|
def storage_path
|
@@ -159,7 +158,7 @@ module Terminalwire::Client
|
|
159
158
|
|
160
159
|
def serialize
|
161
160
|
{
|
162
|
-
authority: @authority
|
161
|
+
authority: @authority,
|
163
162
|
schemes: @schemes.serialize,
|
164
163
|
paths: @paths.serialize,
|
165
164
|
storage_path: storage_path.to_s,
|
@@ -204,13 +203,23 @@ module Terminalwire::Client
|
|
204
203
|
end
|
205
204
|
|
206
205
|
def self.from_url(url)
|
207
|
-
|
206
|
+
url = URI(url)
|
208
207
|
|
209
|
-
case
|
208
|
+
case url.host
|
210
209
|
when RootPolicy::HOST
|
211
|
-
RootPolicy.new
|
210
|
+
RootPolicy.new
|
212
211
|
else
|
213
|
-
Policy.new authority:
|
212
|
+
Policy.new authority: url_authority(url)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def self.url_authority(url)
|
217
|
+
# I had to lift this from URI::HTTP because `ws://` doesn't
|
218
|
+
# have an authority method.
|
219
|
+
if url.port == url.default_port
|
220
|
+
url.host
|
221
|
+
else
|
222
|
+
"#{url.host}:#{url.port}"
|
214
223
|
end
|
215
224
|
end
|
216
225
|
end
|
data/lib/terminalwire/client.rb
CHANGED
@@ -53,6 +53,15 @@ module Terminalwire
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
# Extracted from HTTP. This is so we can
|
57
|
+
def self.authority(url)
|
58
|
+
if url.port == url.default_port
|
59
|
+
url.host
|
60
|
+
else
|
61
|
+
"#{url.host}:#{url.port}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
56
65
|
def self.websocket(url:, arguments: ARGV, entitlement: nil)
|
57
66
|
url = URI(url)
|
58
67
|
|
data/lib/terminalwire/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminalwire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.5.
|
202
|
+
rubygems_version: 3.5.16
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Ship a CLI for your web app. No API required.
|