libtmux-async 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: 0fc488892362e6465beab45e218ac90c0422c9b3573a9c3591e56edd0804675c
4
- data.tar.gz: 712551a6b815aaefddd56f1154d4f437aea07139ba39e7b5cf7383e53af1e0ed
3
+ metadata.gz: 1ea540b90e8bd302c36602c0d1b3db74136a60773deb92bb5358b3c7bc48e3f0
4
+ data.tar.gz: cf67c1667785062c2c29a6c27732e3bf6012d4edd17ff62a4679e55429aeda91
5
5
  SHA512:
6
- metadata.gz: eea8060f4f05d4ee8adb9a0c70657d83b0ffc7616675d497fa81a59729b7cb9e3fb452c514978b251c1b0d88cd1716a2aec29ea4f13be9184b8d23be1ede8018
7
- data.tar.gz: a721e50b34a2352c42e1cafdf2a88cd25f188789855ab7fef38f90bf788ef4205b8ea9775a0768b363c5e4244950f87db0bd4c2f4af6ee6debe54c113d5b3e56
6
+ metadata.gz: e99804e99791d37c02fb54b374f9a29fcad90b5296da46bc5f333e5d20fedd3796a9796e2103a52c690b76981b806826ea18c0c2da7916b4fa72100e8496c541
7
+ data.tar.gz: 93ddf5982950f17a2afd0199186fde93ecf590006dc4fbaf84e76458405cb0092d28b4378914e481ac710b55012d056867a03b9b436e99e74f2e4f88444f1172
data/README.md CHANGED
@@ -1,9 +1,25 @@
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">
6
+ </picture>
7
+ </div>
8
+ <!-- /libtmux-logo -->
9
+
10
+ <div align="center">
11
+
1
12
  # libtmux-async
2
13
 
3
14
  Run libtmux operations inside an application-owned Async task. This
4
15
  gem provides a subprocess facade, ordered mapping, control replies and event
5
16
  subscriptions. Imports start no scheduler, tmux server or background task.
6
17
 
18
+ </div>
19
+
20
+ Requires tmux 3.3a or newer. The Async facade dispatches through a
21
+ version-checked core server and carries the same daemon release check.
22
+
7
23
  Install the alpha with `gem install libtmux-async --pre`.
8
24
 
9
25
  The [complete program](../../examples/async_cancel.rb) owns an isolated server
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" class="libtmux-logo" data-language="ruby" data-variant="library" focusable="false"><title>libtmux for Ruby</title><g transform="translate(-210.28959,-409.98108)" data-part="artwork"><g transform="matrix(1.024,0,0,1.0240011,-5.0469507,-9.8399997)" 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.0240011,-5.0469507,-9.8399997)" 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.88585 v 4.23589 c 9e-5,4.04619 3.2803,7.32617 7.32649,7.32598 h 28.63105 l 81.26967,-1.0223 14.5495,-10.53906 v 0 z" fill="#231F20" data-part="base"></path><g transform="matrix(1.024,0,0,1.0240011,-5.0469507,-9.8399997)" 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 V 129.83008 l 6.17579,13.24609 L 500,112.43359 V 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 transform="matrix(1.024,0,0,1.0240011,-5.0469507,-9.8399997)" data-part="gear-group"><path d="m 298.35661,419.37889 c -3.307,0 -6.01087,2.63649 -6.0946,5.94228 l -0.33026,13.04677 c -0.0503,1.98883 -1.3048,3.74588 -3.16843,4.44175 -1.63527,0.6105 -3.23561,1.29298 -4.79768,2.04293 -1.82786,0.87796 -4.00547,0.54134 -5.47527,-0.85609 l -9.17457,-8.72115 c -2.39692,-2.27863 -6.17361,-2.23122 -8.512,0.10759 l -14.3945,14.39447 c -1.27625,1.27604 -1.86544,2.98029 -1.77147,4.65491 -0.0118,0.22021 -0.0123,0.44029 0,0.66053 -0.0118,0.22023 -0.0123,0.44029 0,0.66053 -0.0118,0.22021 -0.0123,0.44029 0,0.66053 -0.0118,0.22024 -0.0123,0.44029 0,0.66053 -0.0118,0.22024 -0.0123,0.44029 0,0.66053 -0.0118,0.22024 -0.0123,0.44029 0,0.66053 -0.0118,0.22024 -0.0123,0.44029 0,0.66053 -0.0838,1.61437 0.46467,3.25669 1.6634,4.51768 l 8.99461,9.46208 c 0.23074,0.24278 0.42181,0.51038 0.59418,0.78721 -0.60023,1.35769 -1.15279,2.74067 -1.64984,4.15071 -0.6727,1.90958 -2.45019,3.20822 -4.47443,3.25942 l -12.65165,0.31971 c -3.30618,0.0837 -5.94279,2.7886 -5.94279,6.0956 v 0.66053 0.66053 0.66053 0.66056 2.64112 15.07361 0.66053 0.66053 0.66053 0.66053 0.66053 0.66053 0.66053 0.66053 c 0,3.30703 2.63661,6.01136 5.94279,6.09511 l 13.04677,0.32975 c 1.98885,0.0503 3.74539,1.30529 4.44124,3.16895 0.53531,1.43379 1.12957,2.83886 1.7725,4.21655 -0.17026,0.27145 -0.35881,0.53398 -0.58564,0.77264 l -8.72163,9.17405 c -1.19922,1.26148 -1.74723,2.90475 -1.66291,4.51969 -0.0124,0.22024 -0.0118,0.44029 0,0.66053 v 0.0457 h 0.0875 l 10.03868,-9.51839 29.63949,8.95286 h 43.47603 l 13.935,-16.69426 v -0.0216 c -8.04912,9.72841 -20.24315,15.90068 -33.88319,15.7844 -22.83086,-0.19494 -41.62302,-18.24181 -43.0251,-40.7806 1.34121,-22.94291 20.4588,-41.11551 43.78415,-40.91631 13.2902,0.11325 25.20451,6.28323 33.12414,15.86034 v -3.90741 -20.27843 -11.02398 l -3.97024,3.7742 c -1.44419,1.37264 -3.57681,1.72648 -5.38882,0.89729 -1.57465,-0.72024 -3.18724,-1.3729 -4.83384,-1.95295 -1.90955,-0.67268 -3.2077,-2.45012 -3.25892,-4.47392 l -0.32023,-12.65265 c -0.0836,-3.30579 -2.78757,-5.94228 -6.09457,-5.94228 z" fill="#999999" data-part="gear-edge"></path><path d="m 298.35715,419.3789 c -3.30703,0 -6.01139,2.63697 -6.09511,5.94277 l -0.33075,13.04677 c -0.0504,1.98885 -1.30431,3.74539 -3.16795,4.44126 -1.63521,0.6105 -3.23553,1.29298 -4.79716,2.04293 -1.8283,0.87755 -4.0065,0.54134 -5.47627,-0.85609 l -9.17408,-8.72115 c -2.39692,-2.27863 -6.17372,-2.23122 -8.51252,0.10759 l -14.39447,14.39498 c -2.33842,2.33839 -2.38624,6.1146 -0.10759,8.51152 l 8.9951,9.46211 c 1.37305,1.44416 1.72558,3.57678 0.89681,5.38881 -0.72068,1.57466 -1.37293,3.18676 -1.95295,4.83335 -0.67271,1.90958 -2.45022,3.20823 -4.47444,3.25942 l -12.65164,0.32023 c -3.30621,0.0837 -5.9428,2.78759 -5.9428,6.09459 v 20.35786 c 0,3.30703 2.63659,6.01087 5.9428,6.09459 l 13.04677,0.33027 c 1.98843,0.0504 3.74578,1.30479 4.44123,3.16846 0.61094,1.63521 1.29301,3.2356 2.04295,4.79765 0.87797,1.82789 0.54145,4.00591 -0.85559,5.47527 l -8.72164,9.17457 c -1.37514,1.44653 -1.88755,3.39384 -1.57592,5.22595 h 0.7465 24.32055 61.26465 3.60327 c 3.95126,0 7.15424,-3.20297 7.15424,-7.15427 v -2.056 -8.04952 c -8.05257,9.71866 -20.25002,15.87899 -33.88271,15.76278 -23.61284,-0.2016 -42.90943,-19.4986 -43.11104,-43.11106 -0.20729,-24.31847 19.55063,-44.07731 43.86912,-43.8696 13.28515,0.11319 25.2041,6.27146 33.12463,15.84172 v -18.88347 -11.02398 l -3.97073,3.77469 c -1.44417,1.37264 -3.57578,1.72599 -5.38782,0.8968 -1.57506,-0.72024 -3.18776,-1.37292 -4.83435,-1.95295 -1.90958,-0.67309 -3.20729,-2.45063 -3.25892,-4.47441 l -0.32023,-12.65167 c -0.0833,-3.3058 -2.78767,-5.94277 -6.09509,-5.94277 z" fill="#E6E6E6" data-part="gear"></path></g></g></svg>
@@ -8,7 +8,7 @@ module LibTmux
8
8
 
9
9
  @scope, @source = scope, source
10
10
  @mutex = Mutex.new
11
- source.__send__(:with_bound_endpoint) { |endpoint, pin| @endpoint, @pin = endpoint, pin }
11
+ source.__send__(:with_bound_endpoint) { |endpoint, pin, release| @endpoint, @pin, @release = endpoint, pin, release }
12
12
  end
13
13
 
14
14
  def run(argv, input: "".b, timeout: 5.0, cancel: nil)
@@ -17,7 +17,9 @@ module LibTmux
17
17
  validate_argv(argv)
18
18
  raise ArgumentError, "raw commands cannot override endpoint flags" if argv.first.start_with?("-")
19
19
 
20
- @scope.__send__(:execute, @pin.command_prefix + argv, input: input, timeout: timeout, cancel: cancel)
20
+ fence, marker = Internal::TmuxVersion.fence(@release)
21
+ result = @scope.__send__(:execute, @pin.command_prefix + fence + argv, input: input, timeout: timeout, cancel: cancel)
22
+ Internal::TmuxVersion.check_fence(result, marker, @release)
21
23
  end
22
24
 
23
25
  def close
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LibTmux
4
4
  module Async
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-async
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: async
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -45,6 +45,8 @@ extra_rdoc_files: []
45
45
  files:
46
46
  - LICENSE
47
47
  - README.md
48
+ - assets/logo.png
49
+ - assets/logo.svg
48
50
  - lib/libtmux/async.rb
49
51
  - lib/libtmux/async/control.rb
50
52
  - lib/libtmux/async/process.rb
@@ -57,6 +59,7 @@ licenses:
57
59
  - MIT
58
60
  metadata:
59
61
  source_code_uri: https://github.com/libtmux/libtmux-ruby
62
+ documentation_uri: https://libtmux.org/en/ruby/v0.1.0.alpha.2/reference/
60
63
  rdoc_options: []
61
64
  require_paths:
62
65
  - lib