terminalwire 0.2.4 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8a974238ae54d86b1c98334295187af746fede63382fe22d3cb527c4216f728
4
- data.tar.gz: c99cdc090e070a11eb5a05ad2e2e0aebbb1d0c919899b5b0ed891c6ef693a9e8
3
+ metadata.gz: 309645ee703cb95d71b6157e1e315c050617f88559ddfd4c8085fed535996b87
4
+ data.tar.gz: db83793b2917d729086286e3aed97fd254d7b0191f7fc2359bf1f4674e09cb0e
5
5
  SHA512:
6
- metadata.gz: 0df6c3219578c496eb45b8050164d9427207feb57012071abcf9d683ab6953ea95a92bf9c8eee0ab32c13f5335161777f4d4b1e06e53fdeb524f1d8f4d8987b7
7
- data.tar.gz: 988d13343b1b408d7c70c3e3252ccd43385081c7438263f8add6c21c6320ac93a9e0a8795764dc250a1db601daccd86253fd3c09c2b487dcdec377350ccb6f4e
6
+ metadata.gz: 4bf0d6aff7c74689343d33f91ef8cbbd3f65277b0882c821159aab58979c5bfad22400c4159179e8b659851b276abda353943d853a289a720bb8c92a901bbc52
7
+ data.tar.gz: caac5ae325c02b144da767aacf7d54d6e112dfee712664e6bffff5822c3e02f536e589cd7113d273ec3be7c6ddfe5fcde5688e0b9875ed48de51b4447dd51bd1
@@ -19,7 +19,7 @@ class MainTerminal < ApplicationTerminal
19
19
  self.current_user = user
20
20
  puts "Successfully logged in as #{current_user.email}."
21
21
  else
22
- puts "Could not find a user with that email and password."
22
+ fail "Could not find a user with that email and password."
23
23
  end
24
24
  end
25
25
 
@@ -28,7 +28,7 @@ class MainTerminal < ApplicationTerminal
28
28
  if self.current_user
29
29
  puts "Logged in as #{current_user.email}."
30
30
  else
31
- puts "Not logged in. Run `#{self.class.basename} login` to login."
31
+ fail "Not logged in. Run `#{self.class.basename} login` to login."
32
32
  end
33
33
  end
34
34
 
@@ -37,6 +37,18 @@ module Terminalwire
37
37
  def_delegators :stdin,
38
38
  :gets, :getpass
39
39
 
40
+ # Prints text to the standard error stream.
41
+ def warn(...)
42
+ stderr.puts(...)
43
+ end
44
+
45
+ # Prints text to the standard error stream and exits the program.
46
+ def fail(...)
47
+ stderr.puts(...)
48
+ context.exit 1
49
+ ensure
50
+ super
51
+ end
40
52
  # Feels more naturual to call `client.files` etc. from
41
53
  # the serve since it's more apparent that it's a client.
42
54
  alias :client :context
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Terminalwire
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
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.2.4
4
+ version: 0.2.5
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-11-08 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket