terminalwire 0.1.8 → 0.1.10

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: 9cd319cc4f277520d44209f8317dabcb9113f1cb925f1ee6090e842ec007770b
4
+ data.tar.gz: 1a7f2c111dfd9ac6576ae63d52b8342ebaff87e64c7a41202a8baf96cd786434
5
5
  SHA512:
6
- metadata.gz: f3206e529d8628243061e87cf4b1782e4d61a368333627e2526f5e251e25daefec1f8a4e24fb71e85c5aa3f1114138eb99100877c029668913fc93230d626eaa
7
- data.tar.gz: c5ae063fc7eb0f17fe6a6da9b18d79cf5f5c039262849bbb24bc33add9276294f78335a262247c86cab2a8667494de9411532f4bcd983425cdeecc3e5d51d83e
6
+ metadata.gz: baf4b6ba33de5b317ce0fb52322b5b77c3bdc9cb7804245abf0b4969458024c24d58b08a45df88890d1bd902efdc61fbb7b78aef9a14be8ccde633eb10a7b2c8
7
+ data.tar.gz: 3b553a00a66b9b6f26fbca86efa973058e6fca4ae3a13a5182772e3f2cfe83db8467ef49d0400e448fb55d70604f3207804aafcb550231fb0bd0decb06d494bd
@@ -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
@@ -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.10"
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.10
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.