libtmux-workspace 0.1.0.alpha.1 → 0.1.0.alpha.2

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: 9514613d11f2325d349731f229675510da8a0e11a1c053fae88f198464e38d84
4
- data.tar.gz: a367212c8b49b482cfe9bca60323f8360d38814af096f0f306ac49f642727450
3
+ metadata.gz: 785d3eeae8b1f863bc93aaa0746d465897605808307737e488825ca514b77158
4
+ data.tar.gz: 48066c5f88b57d2952e6147c5fff564a089619a001bf2f037580ada8b4152f41
5
5
  SHA512:
6
- metadata.gz: cbce1a3ca65ec06fd22647ee9e2ff4af2bd85c488e1a9466c88d5dfe091cdacf7585ae9ad8310d995e1c87a033bca7869d1cf1face0f8041fd812a9531fd62e2
7
- data.tar.gz: a972900033105a2cc722f20811a72cd065d124e026eee5f55ed65ae7fb5d9dcde6a64e9b2730932542eded315946f31cada5dd557835ab662c22aafc4a639239
6
+ metadata.gz: 766e79e8ef3b1d422ca6c2a1050d8fca3e5226329138f4289e6e1f5b8459fbf40b21b02f5e41ca7ef45cc22f978d0f6a56dd6ce24c5a3d9adab6623ff4517bcb
7
+ data.tar.gz: da26f7efab1ce82f61fcddf3529fa5449feaff486f77a595f103bdb47833be6232e5ea60dfc256288b176bbf51a9a4ad4a9604571c69bbe6299b99812e13cac0
data/README.md CHANGED
@@ -1,3 +1,14 @@
1
+ <!-- libtmux-logo -->
2
+ <div align="center">
3
+ <picture>
4
+ <source srcset="assets/logo.svg" type="image/svg+xml">
5
+ <img src="assets/logo.png" width="128" height="128" alt="libtmux for Ruby workspace">
6
+ </picture>
7
+ </div>
8
+ <!-- /libtmux-logo -->
9
+
10
+ <div align="center">
11
+
1
12
  # libtmux-workspace
2
13
 
3
14
  Load bounded YAML or JSON, inspect an immutable creation plan, then explicitly
@@ -6,6 +17,14 @@ and installed command-line executable share the core
6
17
  [compatibility matrix](https://github.com/libtmux/libtmux-ruby/actions/workflows/compatibility.yml);
7
18
  consult its exact per-revision results.
8
19
 
20
+ </div>
21
+
22
+ Requires tmux 3.3a or newer to load or apply a plan. Validation and offline
23
+ planning need no running daemon. When the daemon is older, `load` creates
24
+ nothing and prints the refusal with the floor and the remedy, as text or in the
25
+ `error.message` of the `--json` result, whose `error.kind` is
26
+ `tmux_unsupported`.
27
+
9
28
  The gem declares Ruby 3.3 or newer and depends on the same-version `libtmux`
10
29
  gem, JSON 3.0 and Psych 5.5. See the repository's
11
30
  [contribution guide](../../.github/CONTRIBUTING.md) for local builds and checks.
@@ -129,7 +148,7 @@ option overrides disable renumbering and pane synchronization during setup;
129
148
  the plan then restores declared values or inheritance.
130
149
 
131
150
  Session options apply before subsequent windows and split panes are created.
132
- On tmux 3.2a–3.6, the reused initial pane retains the global `history-limit`
151
+ On tmux 3.3a–3.6, the reused initial pane retains the global `history-limit`
133
152
  inherited at session creation. Later panes use the configured session value.
134
153
  For uniform history on these versions, configure the server's global value
135
154
  before applying the workspace. Apply does not change global options or replace
data/assets/logo.png ADDED
Binary file
data/assets/logo.svg ADDED
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 135.46667 135.46666" role="img" aria-label="libtmux for Ruby — workspace CLI" class="libtmux-logo" data-language="ruby" data-variant="workspace" focusable="false"><title>libtmux for Ruby — workspace CLI</title><g transform="translate(-210.28959,-409.98108)" data-part="artwork"><path d="m 334.66493,533.88598 v 11.56176 h 3.76501 c 4.04619,2.1e-4 7.32623,-3.28012 7.32632,-7.32631 v -4.23545 z" fill="#333333" data-part="base-edge"></path><g transform="matrix(1.024,0,0,1.024,-5.0469422,-9.8395302)" data-part="primary-tile"><path d="M 227.78906,0 213.98242,3.6992188 V 460.62109 H 241.4082 V 15.564453 Z" transform="matrix(0.26458333,0,0,0.26458333,210.28959,409.98108)" fill="#2D0002" data-part="primary-edge"></path><path d="m 210.28981,417.13553 v 113.86425 l 60.26885,2.60089 V 409.98109 h -53.11441 c -3.95129,0 -7.15444,3.20315 -7.15444,7.15444 z" fill="#701516" data-part="primary"></path></g><g transform="matrix(1.024,0,0,1.024,-5.0469422,-9.8395302)" data-part="lower-tile"><path d="m 486.38086,246.03906 -5.24805,4.99805 v 207.2207 l 5.24805,-0.93164 L 500,465.18945 V 261.60352 Z" transform="matrix(0.26458333,0,0,0.26458333,210.28959,409.98108)" fill="#67221F" data-part="lower-edge"></path><path d="m 278.70874,475.07917 v 64.8875 l 60.26883,-8.98455 v -55.90295 z" fill="#984640" data-part="lower"></path></g><path d="m 210.28959,533.88598 v 4.23545 c 9e-5,4.04619 3.28012,7.32651 7.32631,7.32631 h 117.12417 c 4.04619,2e-4 7.32621,-3.28012 7.32631,-7.32631 v -4.23545 z" fill="#231F20" data-part="base"></path><g transform="matrix(1.024,0,0,1.024,-5.0469422,-9.8395302)" data-part="upper-tile"><path d="m 459.33984,0 -25.33593,2.1074219 h 21.38281 c 14.93397,0 27.04101,12.1070061 27.04101,27.0410161 l 1.51727,183.649512 2.43542,2.38046 -1.84468,1.91057 15.46424,13.65284 L 500,42.603516 C 499.99913,8.8176763 474.27408,-6.8031496e-4 459.33984,0 Z" transform="matrix(0.26458333,0,0,0.26458333,210.28959,409.98108)" fill="#854A46" data-part="upper-side"></path><path d="m 331.82331,409.98109 h -53.11442 v 56.93261 h 60.26885 v -49.77817 c 0,-3.95129 -3.20315,-7.15444 -7.15443,-7.15444 z" fill="#B6706A" data-part="upper"></path><path d="m 278.7089,466.9137 h 60.26885 l 3.6035,4.11782 h -60.26932 z" fill="#733A36" data-part="upper-bottom"></path></g></g></svg>
@@ -76,7 +76,7 @@ module LibTmux
76
76
  rescue Interrupt, LibTmux::Cancelled => error
77
77
  report(error, kind: "interrupted", status: 130)
78
78
  rescue LibTmux::Error, SystemCallError, IOError => error
79
- report(error, kind: "execution", status: @result ? 3 : 1)
79
+ report(error, kind: version_refusal?(error) ? "tmux_unsupported" : "execution", status: @result ? 3 : 1)
80
80
  end
81
81
 
82
82
  private
@@ -157,10 +157,21 @@ module LibTmux
157
157
  @out.puts(@json ? JSON.generate(value) : human)
158
158
  end
159
159
 
160
+ # A refusal before dispatch sent nothing, and its message says what to
161
+ # change, so it replaces the generic failure line.
162
+ def pre_dispatch_refusal?(error)
163
+ error.is_a?(LibTmux::UnsupportedFeatureError) && error.phase == :admission && error.delivery == :not_sent
164
+ end
165
+
166
+ # Only a refusal that names the tmux floor carries the machine code.
167
+ def version_refusal?(error)
168
+ LibTmux::Internal::TmuxVersion.refusal?(error)
169
+ end
170
+
160
171
  def report(error, kind:, status:)
161
172
  message = if kind == "arguments"
162
173
  @argument_message || "Invalid arguments; use --help for supported options."
163
- elsif error.is_a?(Workspace::ConfigError) || error.is_a?(Workspace::ApplyError)
174
+ elsif error.is_a?(Workspace::ConfigError) || error.is_a?(Workspace::ApplyError) || pre_dispatch_refusal?(error)
164
175
  error.message
165
176
  else
166
177
  "Workspace #{kind} failed#{error ? " (#{error.class})" : ''}."
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LibTmux
4
4
  class Workspace
5
- VERSION = "0.1.0.alpha.1"
5
+ VERSION = "0.1.0.alpha.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libtmux-workspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.1
4
+ version: 0.1.0.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - libtmux contributors
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.1.0.alpha.1
18
+ version: 0.1.0.alpha.2
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.1.0.alpha.1
25
+ version: 0.1.0.alpha.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: json
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +60,8 @@ extra_rdoc_files: []
60
60
  files:
61
61
  - LICENSE
62
62
  - README.md
63
+ - assets/logo.png
64
+ - assets/logo.svg
63
65
  - exe/libtmux-workspace
64
66
  - lib/libtmux/workspace.rb
65
67
  - lib/libtmux/workspace/apply.rb
@@ -74,6 +76,7 @@ licenses:
74
76
  - MIT
75
77
  metadata:
76
78
  source_code_uri: https://github.com/libtmux/libtmux-ruby
79
+ documentation_uri: https://libtmux.org/en/ruby/v0.1.0.alpha.2/workspace/
77
80
  rdoc_options: []
78
81
  require_paths:
79
82
  - lib