terminalwire 0.2.2 → 0.2.3

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: 89f9aee85ea5da79613c84fe3c5ecabb199d973c0b313050bb4d857b1ae493e2
4
- data.tar.gz: 4f7a3f2ef2454cb3a630ffbb8b1d92f7c72a17e905e3059a376e20a5e058681d
3
+ metadata.gz: 39232fa4bba65cc98bf87a3625e80a8c01ccee009277adeb53bd57efe28fd73c
4
+ data.tar.gz: 94ceb432cdd3f10fb3492cdfb5025eb3e71edbe352bdf0e2cd2a8438aef6f22d
5
5
  SHA512:
6
- metadata.gz: f29cb799b97b678e163a0685e0a7be9de49fb6464eb4916b8412ed6eb30400f0ff29b9ba5bc02ab208a50bbfb7a7e027f507cd14bd827ebf1ae5b01be29d992d
7
- data.tar.gz: 615e9dea3dc7fc01f04bce0f0a2c4f82c4dd7670853f43741e99f82b8159067ab92d292a0230a6ea73439ac7c023815259fe1d6d7694c8b991f7e524d0bd4ef8
6
+ metadata.gz: a05475187aa41b8bb7b3e21ae13975a48f739ee95e00a2f099e7d13817a5192b9298a79236e008668416d8f385c31b02d716c404255e96148c385ff6268d4f10
7
+ data.tar.gz: 36fff6322f43fd783906e9e8a1878dd192b0b44695134cc6df12085da305f8cd34a758415ebb8d14a7d21ec4860172eb250c94508da27f5728149bf7cf76cbd8
@@ -52,6 +52,19 @@ module Terminalwire::Client::Entitlement
52
52
  class Root < Base
53
53
  AUTHORITY = "terminalwire.com".freeze
54
54
 
55
+ # Terminalwire checks these to install the binary stubs path.
56
+ SHELL_INITIALIZATION_FILE_PATHS = %w[
57
+ ~/.bash_profile
58
+ ~/.bashrc
59
+ ~/.zprofile
60
+ ~/.zshrc
61
+ ~/.profile
62
+ ~/.config/fish/config.fish
63
+ ~/.bash_login
64
+ ~/.cshrc
65
+ ~/.tcshrc
66
+ ].freeze
67
+
55
68
  # Ensure the binary stubs are executable. This increases the
56
69
  # file mode entitlement so that stubs created in ./bin are executable.
57
70
  BINARY_PATH_FILE_MODE = 0o755
@@ -63,6 +76,10 @@ module Terminalwire::Client::Entitlement
63
76
  # Now setup special permitted paths.
64
77
  @paths.permit root_path
65
78
  @paths.permit root_pattern
79
+ # Permit the dotfiles so terminalwire can install the binary stubs.
80
+ SHELL_INITIALIZATION_FILE_PATHS.each do |path|
81
+ @paths.permit path
82
+ end
66
83
 
67
84
  # Permit terminalwire to grant execute permissions to the binary stubs.
68
85
  @paths.permit binary_pattern, mode: BINARY_PATH_FILE_MODE
@@ -53,6 +53,22 @@ module Terminalwire::Server
53
53
  end
54
54
  end
55
55
 
56
+ # Wraps the environment variables in a hash-like object that can be accessed
57
+ # from client#ENV. This makes it look and feel just like the ENV object in Ruby.
58
+ class Env
59
+ def initialize(context:)
60
+ @context = context
61
+ end
62
+
63
+ def [](name)
64
+ @context.environment_variable.read(name)
65
+ end
66
+ end
67
+
68
+ def ENV
69
+ @ENV ||= Env.new(context: self)
70
+ end
71
+
56
72
  def exit(status = 0)
57
73
  @adapter.write(event: "exit", status: status)
58
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Terminalwire
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler