ruby-cli-daemon 0.1.0 → 0.2.0

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: f0a57291fb717787ecf32c800114d81c9935386917e3e49c7515df597e83296f
4
- data.tar.gz: b9495d51c4ad1311dc183efde2d78ef3b7c9156c4f57fb49e191539fa3defb80
3
+ metadata.gz: 01a6d3c7d2c60a46410e956b907597e743cd1358cf6ea479bb472b3fe150f52f
4
+ data.tar.gz: a65afda0b9ba23674c2a575126241be29dea66026a6fcfdaa3c3593666718a8c
5
5
  SHA512:
6
- metadata.gz: b4246d548789712085fa31fc1ec2452776fd36aa02d9b9b458e294db1677c9cae662f575b1b0b4620622c3ca0fbccb2b02c163087da186da1cd5b18d34f8a310
7
- data.tar.gz: 1f55ac0797a42592da5e3b92b2dc98e8a6ebb70d5dbc5f47ec007581361b6c218715862ea4a3d7a6f4f5b660218f1f87c146a254392d13255bc04fabc1e2b9d8
6
+ metadata.gz: 116a867d73b9bae3d739cfc89383bf3507ab77c22ca77e6c64f9695075c79ce079c0a45edf4a0668a3469a8efc5cf897f7466cc8b9bc9e06a114b2331427ee9c
7
+ data.tar.gz: 1a49ca90bc902b26b9abb39e230e612091e78037c1339cb65ac3c3c035e778def57ada09f7cccedc26aa845f96abac5e86af67491fa7750140fc8a9122b22a08
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RubyCliDaemon
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
@@ -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
- require executable
46
- path = Gem.bin_path(executable, executable)
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.1.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-28 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it