ruby-cli-daemon 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_cli_daemon/version.rb +1 -1
- data/lib/ruby_cli_daemon.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01a6d3c7d2c60a46410e956b907597e743cd1358cf6ea479bb472b3fe150f52f
|
4
|
+
data.tar.gz: a65afda0b9ba23674c2a575126241be29dea66026a6fcfdaa3c3593666718a8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 116a867d73b9bae3d739cfc89383bf3507ab77c22ca77e6c64f9695075c79ce079c0a45edf4a0668a3469a8efc5cf897f7466cc8b9bc9e06a114b2331427ee9c
|
7
|
+
data.tar.gz: 1a49ca90bc902b26b9abb39e230e612091e78037c1339cb65ac3c3c035e778def57ada09f7cccedc26aa845f96abac5e86af67491fa7750140fc8a9122b22a08
|
data/lib/ruby_cli_daemon.rb
CHANGED
@@ -10,7 +10,6 @@ module RubyCliDaemon
|
|
10
10
|
def install(path)
|
11
11
|
File.unlink(path) if File.exist?(path)
|
12
12
|
File.symlink(File.expand_path("../bin/ruby-sli-daemon.sh", __dir__), path)
|
13
|
-
FileUtils.chmod("+x", path)
|
14
13
|
end
|
15
14
|
|
16
15
|
def start(socket, executable)
|
@@ -24,8 +23,8 @@ module RubyCliDaemon
|
|
24
23
|
capture :STDOUT, "#{socket}.out" do
|
25
24
|
capture :STDERR, "#{socket}.err" do
|
26
25
|
_, status = Process.wait2(fork do
|
27
|
-
ARGV.replace(command)
|
28
|
-
load path
|
26
|
+
ARGV.replace(command) # uncovered
|
27
|
+
load path # uncovered
|
29
28
|
end)
|
30
29
|
|
31
30
|
# send back response
|
@@ -42,8 +41,9 @@ module RubyCliDaemon
|
|
42
41
|
|
43
42
|
# preload the libraries we'll need to speed up execution
|
44
43
|
def preload_gem(executable)
|
45
|
-
|
46
|
-
path =
|
44
|
+
spec = Gem.loaded_specs.each_value.detect { |s| s.executables.include?(executable) }
|
45
|
+
path = spec.bin_file executable
|
46
|
+
require spec.name
|
47
47
|
GC.start # https://bugs.ruby-lang.org/issues/15878
|
48
48
|
path
|
49
49
|
end
|
@@ -57,7 +57,6 @@ module RubyCliDaemon
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def create_socket(socket)
|
60
|
-
File.unlink socket if File.exist?(socket)
|
61
60
|
FileUtils.mkdir_p(File.dirname(socket))
|
62
61
|
UNIXServer.new(socket)
|
63
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-cli-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|