overmind 0.1.0-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/bin/overmind +13 -0
- data/lib/overmind/cli.rb +93 -0
- data/lib/overmind/version.rb +5 -0
- data/lib/overmind.rb +3 -0
- data/libexec/overmind +0 -0
- data/libexec/prebuilt-tmux/bin/event_rpcgen.py +1925 -0
- data/libexec/prebuilt-tmux/bin/tmux +0 -0
- data/libexec/prebuilt-tmux/include/evdns.h +45 -0
- data/libexec/prebuilt-tmux/include/event.h +83 -0
- data/libexec/prebuilt-tmux/include/event2/buffer.h +1077 -0
- data/libexec/prebuilt-tmux/include/event2/buffer_compat.h +116 -0
- data/libexec/prebuilt-tmux/include/event2/bufferevent.h +1024 -0
- data/libexec/prebuilt-tmux/include/event2/bufferevent_compat.h +104 -0
- data/libexec/prebuilt-tmux/include/event2/bufferevent_ssl.h +134 -0
- data/libexec/prebuilt-tmux/include/event2/bufferevent_struct.h +116 -0
- data/libexec/prebuilt-tmux/include/event2/dns.h +751 -0
- data/libexec/prebuilt-tmux/include/event2/dns_compat.h +358 -0
- data/libexec/prebuilt-tmux/include/event2/dns_struct.h +80 -0
- data/libexec/prebuilt-tmux/include/event2/event-config.h +570 -0
- data/libexec/prebuilt-tmux/include/event2/event.h +1672 -0
- data/libexec/prebuilt-tmux/include/event2/event_compat.h +230 -0
- data/libexec/prebuilt-tmux/include/event2/event_struct.h +180 -0
- data/libexec/prebuilt-tmux/include/event2/http.h +1192 -0
- data/libexec/prebuilt-tmux/include/event2/http_compat.h +94 -0
- data/libexec/prebuilt-tmux/include/event2/http_struct.h +152 -0
- data/libexec/prebuilt-tmux/include/event2/keyvalq_struct.h +80 -0
- data/libexec/prebuilt-tmux/include/event2/listener.h +192 -0
- data/libexec/prebuilt-tmux/include/event2/rpc.h +626 -0
- data/libexec/prebuilt-tmux/include/event2/rpc_compat.h +61 -0
- data/libexec/prebuilt-tmux/include/event2/rpc_struct.h +114 -0
- data/libexec/prebuilt-tmux/include/event2/tag.h +146 -0
- data/libexec/prebuilt-tmux/include/event2/tag_compat.h +49 -0
- data/libexec/prebuilt-tmux/include/event2/thread.h +253 -0
- data/libexec/prebuilt-tmux/include/event2/util.h +888 -0
- data/libexec/prebuilt-tmux/include/event2/visibility.h +67 -0
- data/libexec/prebuilt-tmux/include/evhttp.h +45 -0
- data/libexec/prebuilt-tmux/include/evrpc.h +45 -0
- data/libexec/prebuilt-tmux/include/evutil.h +39 -0
- data/libexec/prebuilt-tmux/include/utf8proc.h +743 -0
- data/libexec/prebuilt-tmux/lib/libevent-2.1.7.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libevent.a +0 -0
- data/libexec/prebuilt-tmux/lib/libevent.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/libevent.la +41 -0
- data/libexec/prebuilt-tmux/lib/libevent_core-2.1.7.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_core.a +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_core.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/libevent_core.la +41 -0
- data/libexec/prebuilt-tmux/lib/libevent_extra-2.1.7.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_extra.a +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_extra.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/libevent_extra.la +41 -0
- data/libexec/prebuilt-tmux/lib/libevent_openssl-2.1.7.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_openssl.a +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_openssl.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/libevent_openssl.la +41 -0
- data/libexec/prebuilt-tmux/lib/libevent_pthreads-2.1.7.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_pthreads.a +0 -0
- data/libexec/prebuilt-tmux/lib/libevent_pthreads.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/libevent_pthreads.la +41 -0
- data/libexec/prebuilt-tmux/lib/libutf8proc.3.dylib +0 -0
- data/libexec/prebuilt-tmux/lib/libutf8proc.a +0 -0
- data/libexec/prebuilt-tmux/lib/libutf8proc.dylib +1 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libevent.pc +16 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libevent_core.pc +16 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libevent_extra.pc +16 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libevent_openssl.pc +16 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libevent_pthreads.pc +16 -0
- data/libexec/prebuilt-tmux/lib/pkgconfig/libutf8proc.pc +10 -0
- data/libexec/prebuilt-tmux/share/man/man1/tmux.1 +7242 -0
- data/overmind.gemspec +29 -0
- metadata +160 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc79e52ad822635f24def4f8a98c93ef0027ad5e715616d20b2b805266a01207
|
4
|
+
data.tar.gz: 460314d06c489ffaf4521fb0ba63e2fbed5c8661bee8e2330dfdc74bda4a9df6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 51717b26313b8a43b017403ccfe5b2dafad7480ce403804257c888d75319b05ab2aabf02be43c2f42adb8ccf8b600525b1f1bb91b9049c63add32e3f6ce06062
|
7
|
+
data.tar.gz: a341a5a19efa917b46eb351577f4d22907e792f5a716135dd3de42da37db26ff82432bc590a37cc1ab1b2698d4fe3e1fe28b4b8fe30e3c4a19a4baea187a2775
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 prog-supdex
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/bin/overmind
ADDED
data/lib/overmind/cli.rb
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overmind
|
4
|
+
# Command-line interface for running golang library Overmind
|
5
|
+
# It ensures that the necessary dependencies, such as tmux, are present
|
6
|
+
# and runs Overmind with any provided arguments.
|
7
|
+
class CLI
|
8
|
+
SUPPORTED_OS_REGEX = /darwin|linux|bsd/i
|
9
|
+
# Path to the library's executable files
|
10
|
+
LIBRARY_PATH = File.expand_path("#{File.dirname(__FILE__)}/../../libexec")
|
11
|
+
OVERMIND_PATH = "#{LIBRARY_PATH}/overmind"
|
12
|
+
TMUX_FOLDER_PATH = "#{LIBRARY_PATH}/prebuilt-tmux/bin"
|
13
|
+
TMUX_PATH = "#{TMUX_FOLDER_PATH}/tmux"
|
14
|
+
|
15
|
+
def run(args = [])
|
16
|
+
os_validate!
|
17
|
+
validate_tmux_present!
|
18
|
+
validate_overmind_present!
|
19
|
+
|
20
|
+
# Ensures arguments are properly quoted if they contain spaces
|
21
|
+
args = args.map { |x| x.include?(" ") ? "'#{x}'" : x }
|
22
|
+
|
23
|
+
# Use prebuild tmux if found
|
24
|
+
path_with_tmux = File.exist?(TMUX_PATH) ? "#{ENV["PATH"]}:#{TMUX_FOLDER_PATH}" : ENV["PATH"]
|
25
|
+
|
26
|
+
# Spawns the Overmind process with modified PATH if necessary
|
27
|
+
pid = spawn({"PATH" => path_with_tmux}, "#{OVERMIND_PATH} #{args.join(" ")}")
|
28
|
+
|
29
|
+
Process.wait(pid)
|
30
|
+
|
31
|
+
$?.exitstatus
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
# Checks if the current OS is supported based on a regex match
|
37
|
+
def os_supported?
|
38
|
+
RUBY_PLATFORM.match?(SUPPORTED_OS_REGEX)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Checks if tmux is installed either globally or as a prebuilt binary
|
42
|
+
def tmux_installed?
|
43
|
+
system("which tmux") || File.exist?(TMUX_PATH)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Checks if the Overmind executable is present
|
47
|
+
def overmind_installed?
|
48
|
+
File.exist?(OVERMIND_PATH)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Validates the operating system and aborts with an error message if unsupported
|
52
|
+
def os_validate!
|
53
|
+
return if os_supported?
|
54
|
+
|
55
|
+
abort_with_message("Error: This gem supports Linux, *BSD, and macOS only.")
|
56
|
+
end
|
57
|
+
|
58
|
+
# Validates the presence of tmux and aborts with an error message if not found
|
59
|
+
def validate_tmux_present!
|
60
|
+
return if tmux_installed?
|
61
|
+
|
62
|
+
abort_with_message(<<~MSG)
|
63
|
+
Error: tmux not found. Please ensure tmux is installed and available in PATH.
|
64
|
+
If tmux is not installed, you can usually install it using your package manager. For example:
|
65
|
+
|
66
|
+
# For Ubuntu/Debian
|
67
|
+
sudo apt-get install tmux
|
68
|
+
#{" "}
|
69
|
+
# For macOS
|
70
|
+
brew install tmux
|
71
|
+
#{" "}
|
72
|
+
# For FreeBSD
|
73
|
+
sudo pkg install tmux
|
74
|
+
|
75
|
+
Installation commands might vary based on your operating system and its version.#{" "}
|
76
|
+
Please consult your system's package management documentation for the most accurate instructions.
|
77
|
+
MSG
|
78
|
+
end
|
79
|
+
|
80
|
+
# Validates the presence of Overmind and aborts with an error message if not found
|
81
|
+
def validate_overmind_present!
|
82
|
+
return if overmind_installed?
|
83
|
+
|
84
|
+
abort_with_message("Error: Invalid platform. Overmind wasn't built for #{RUBY_PLATFORM}")
|
85
|
+
end
|
86
|
+
|
87
|
+
# Aborts execution with a given error message
|
88
|
+
def abort_with_message(message)
|
89
|
+
warn "\e[31m#{message}\e[0m"
|
90
|
+
exit 1
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/lib/overmind.rb
ADDED
data/libexec/overmind
ADDED
Binary file
|