terminalwire 0.1.8 → 0.1.9

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: 021c12812432f96320c0ba322f4aa71e1b1cfb60c52b77bc6cd78013da78c517
4
- data.tar.gz: b5f13d773a7c7bc4d7f5e358c2fb0d498a9061fb6cb191f9ab55bc6fe3131767
3
+ metadata.gz: a0eeaa4d2a6f23524e964bbd0fa0e507eca1415f591e71a565a47553411cf916
4
+ data.tar.gz: 30d9f26ce42e8e5a4f301bd4d99ca5ead398554f737b0ffe693aa921fd8e8bb2
5
5
  SHA512:
6
- metadata.gz: f3206e529d8628243061e87cf4b1782e4d61a368333627e2526f5e251e25daefec1f8a4e24fb71e85c5aa3f1114138eb99100877c029668913fc93230d626eaa
7
- data.tar.gz: c5ae063fc7eb0f17fe6a6da9b18d79cf5f5c039262849bbb24bc33add9276294f78335a262247c86cab2a8667494de9411532f4bcd983425cdeecc3e5d51d83e
6
+ metadata.gz: fb69226b00de7e49c73bcc1383aa5d31645cddd49d40c945131cb2e5b7c8c962a206c97127812278642c08371641e01a9a5d223f01c75551689d50a76257f691
7
+ data.tar.gz: 62412bf6431e84e49895887ca879045038bc046470b32863056db319f4e69e0f8ecfdfac2e9141543d3ecf0dcbc5d3ba9821046828bd05a40653ab60512db0a5
@@ -1,3 +1,5 @@
1
+ require "fileutils"
2
+
1
3
  module Terminalwire::Client::Resource
2
4
  # Dispatches messages from the Client::Handler to the appropriate resource.
3
5
  class Handler
@@ -136,11 +138,11 @@ module Terminalwire::Client::Resource
136
138
  File = ::File
137
139
 
138
140
  def list(path:)
139
- Dir.glob(File.expand_path(path))
141
+ Dir.glob File.expand_path(path)
140
142
  end
141
143
 
142
144
  def create(path:)
143
- Dir.mkdir(File.expand_path(path))
145
+ FileUtils.mkdir_p File.expand_path(path)
144
146
  rescue Errno::EEXIST
145
147
  # Do nothing
146
148
  end
@@ -17,6 +17,8 @@ module Terminalwire
17
17
  @program_arguments = arguments
18
18
  @program_name = program_name
19
19
 
20
+ FileUtils.mkdir_p entitlement.storage_path
21
+
20
22
  @resources = Resource::Handler.new do |it|
21
23
  it << Resource::STDOUT.new("stdout", @adapter, entitlement:)
22
24
  it << Resource::STDIN.new("stdin", @adapter, entitlement:)
@@ -18,7 +18,7 @@ module Terminalwire::Rails
18
18
 
19
19
  def initialize(context:, path: nil, secret_key: self.class.secret_key)
20
20
  @context = context
21
- @path = path || context.storage_path
21
+ @path = Pathname.new(path || context.storage_path)
22
22
  @config_file_path = @path.join(FILENAME)
23
23
  @secret_key = secret_key
24
24
 
@@ -57,7 +57,7 @@ module Terminalwire::Rails
57
57
  def ensure_file
58
58
  return true if @context.file.exist? @config_file_path
59
59
  # Create the path if it doesn't exist on the client.
60
- @context.file.mkdir(@path) unless @context.file.exist?(@path)
60
+ @context.directory.create @path
61
61
  # Write an empty configuration on initialization
62
62
  write(EMPTY_SESSION)
63
63
  end
@@ -11,7 +11,14 @@ module Terminalwire::Server
11
11
  command: command,
12
12
  parameters: parameters
13
13
  )
14
- @adapter.recv&.fetch(:response)
14
+
15
+ response = @adapter.recv
16
+ case response.fetch(:status)
17
+ when "success"
18
+ response.fetch(:response)
19
+ when "failure"
20
+ raise Terminalwire::Error, response.inspect
21
+ end
15
22
  end
16
23
  end
17
24
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Terminalwire
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminalwire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
11
+ date: 2024-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.5.3
199
+ rubygems_version: 3.5.9
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Ship a CLI for your web app. No API required.