terminalwire 0.1.11 → 0.1.12

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: 55ab6e5d0132726c5041fce03026f14963c2de4b60a2bc92cd2560b7f14890cf
4
- data.tar.gz: b2f1d360f6135fddf2ab90ca5ad992f1e313ccd4de09cd8bca9314b6af0dbaac
3
+ metadata.gz: 0ffa1e8b55e7c09d41b9a57fc645e950e65f6658767022cf67cac994823fb760
4
+ data.tar.gz: 32fb995746b753eeed71543b954aa2376c2af4b1e61721b14eac8704c9f555f6
5
5
  SHA512:
6
- metadata.gz: 5f003df286a23cff8e92c92d5372f81dc7cc0a915b1d32a6ba8c0bd5005a54395286b9a72aad2d6cc9856d0e6ba2c1622757a6bfbf8aba343885e55b42980227
7
- data.tar.gz: eb480c644c568de7b6391a4e3310219fbf64869972eaeac7f0d4a7a6365b8fb644edd0193ae3920df604b3044b14fdfc09f05aa39a491be5d634ab084d8058d3
6
+ metadata.gz: cb3ca0210a84eb64c924522d4eeb04f75a59bf8d785581a232216c8c417ecc837a66001947449e4da91127ebe942c12bce6ea07f8de1be2fe1fc69e5dcfdc332
7
+ data.tar.gz: e9e0ea45f77040fc503acf2c09f22671d2a09f26315cad69ce1de8e62d4d0578b96663db13414446b7e99ce4abd3dd792ccb6b9191462ae6f67ff8789750856a
data/LICENSE.txt CHANGED
@@ -1 +1,9 @@
1
- Copyright (c) 2024 Brad Gessler. Email brad@terminalwire.com to discuss licensing.
1
+ Copyright (c) 2024 Brad Gessler.
2
+
3
+ License is propietary. Here's the deal:
4
+
5
+ * You need to pay for Terminalwire if your business has more than $1m in assets or makes more than $100k/year in revenue.
6
+ * Terminalwire is free for personal use, hobbyists, or businesses that are just starting out, but server licenses still need to be registered at https://terminalwire.com/developers/licenses.
7
+ * You can only use the Terminalwire client with licensed Terminalwire servers.
8
+
9
+ This list is not exhaustive, please read the full license text at https://terminalwire.com/license.
@@ -7,6 +7,7 @@ class Terminalwire::InstallGenerator < Rails::Generators::Base
7
7
 
8
8
  def create_terminal_files
9
9
  template "application_terminal.rb.tt", Rails.root.join("app/terminal/application_terminal.rb")
10
+ template "main_terminal.rb", Rails.root.join("app/terminal/main_terminal.rb")
10
11
  end
11
12
 
12
13
  def create_binary_files
@@ -17,7 +18,7 @@ class Terminalwire::InstallGenerator < Rails::Generators::Base
17
18
  def add_route
18
19
  route <<~ROUTE
19
20
  match "/terminal",
20
- to: Terminalwire::Server::Thor.new(ApplicationTerminal),
21
+ to: Terminalwire::Server::Thor.new(MainTerminal),
21
22
  via: [:get, :connect]
22
23
  ROUTE
23
24
  end
@@ -1,44 +1,11 @@
1
1
  # Learn how to use Thor at http://whatisthor.com.
2
2
  class ApplicationTerminal < Thor
3
+ # Enables IO Streaming.
3
4
  include Terminalwire::Thor
4
5
 
6
+ # The name of your binary. Thor uses this for its help output.
5
7
  def self.basename = "<%= binary_name %>"
6
8
 
7
- desc "hello NAME", "say hello to NAME"
8
- def hello(name)
9
- puts "Hello #{name}"
10
- end
11
-
12
- desc "login", "Login to your account"
13
- def login
14
- print "Email: "
15
- email = gets.chomp
16
-
17
- print "Password: "
18
- password = getpass
19
-
20
- if self.current_user = User.authenticate(email, password)
21
- puts "Successfully logged in as #{current_user.email}."
22
- else
23
- puts "Could not find a user with that email and password."
24
- end
25
- end
26
-
27
- desc "whoami", "Displays current user information."
28
- def whoami
29
- if self.current_user
30
- puts "Logged in as #{current_user.email}."
31
- else
32
- puts "Not logged in. Run `#{self.class.basename} login` to login."
33
- end
34
- end
35
-
36
- desc "logout", "Logout of your account"
37
- def logout
38
- session.reset
39
- puts "Successfully logged out."
40
- end
41
-
42
9
  private
43
10
 
44
11
  def current_user=(user)
@@ -0,0 +1,40 @@
1
+ class MainTerminal < ApplicationTerminal
2
+ desc "hello NAME", "say hello to NAME"
3
+ def hello(name)
4
+ puts "Hello #{name}"
5
+ end
6
+
7
+ desc "login", "Login to your account"
8
+ def login
9
+ print "Email: "
10
+ email = gets.chomp
11
+
12
+ print "Password: "
13
+ password = getpass
14
+
15
+ # Replace this with your own authentication logic; this is an example
16
+ # of how you might do this with Devise.
17
+ user = User.find_for_authentication(email: email)
18
+ if user && user.valid_password?(password)
19
+ self.current_user = user
20
+ puts "Successfully logged in as #{current_user.email}."
21
+ else
22
+ puts "Could not find a user with that email and password."
23
+ end
24
+ end
25
+
26
+ desc "whoami", "Displays current user information."
27
+ def whoami
28
+ if self.current_user
29
+ puts "Logged in as #{current_user.email}."
30
+ else
31
+ puts "Not logged in. Run `#{self.class.basename} login` to login."
32
+ end
33
+ end
34
+
35
+ desc "logout", "Logout of your account"
36
+ def logout
37
+ session.reset
38
+ puts "Successfully logged out."
39
+ end
40
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Terminalwire
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.12"
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.11
4
+ version: 0.1.12
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-10-02 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket
@@ -158,6 +158,7 @@ files:
158
158
  - lib/generators/terminalwire/install/install_generator.rb
159
159
  - lib/generators/terminalwire/install/templates/application_terminal.rb.tt
160
160
  - lib/generators/terminalwire/install/templates/bin/terminalwire
161
+ - lib/generators/terminalwire/install/templates/main_terminal.rb
161
162
  - lib/terminalwire.rb
162
163
  - lib/terminalwire/adapter.rb
163
164
  - lib/terminalwire/client.rb
@@ -175,7 +176,7 @@ files:
175
176
  - sig/terminalwire.rbs
176
177
  homepage: https://terminalwire.com/ruby
177
178
  licenses:
178
- - Proprietary
179
+ - Proprietary (https://terminalwire.com/license)
179
180
  metadata:
180
181
  allowed_push_host: https://rubygems.org/
181
182
  homepage_uri: https://terminalwire.com/ruby