theine2 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/theine/config.rb +3 -2
- data/lib/theine/server.rb +5 -5
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0569d1e4b9059ba3a9228c19c1eca9003140ae7bf64d55be6bdd7b4bef0ea639'
|
4
|
+
data.tar.gz: b32c8402acd9a6a1d8e21eee4300620b9ec303d01f51bc784a75b20afcc103ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1921874b76a08145aebd2f55df36656ffd41c2a33c094a855ddc4dc87dec0c07bdb1a08b5463687f7387ecf0735df4861483baec46311c6d167547676a6b2476
|
7
|
+
data.tar.gz: d29cd18ea9a00ca0de70de5fdd7f8c96acbbba20916920f1fb25959f5ee5b0ba2c5e45da24bda320175d4046b2e56a59ab0cb843517de922eb6171732bddc28e
|
data/lib/theine/config.rb
CHANGED
@@ -3,13 +3,14 @@ require 'yaml'
|
|
3
3
|
module Theine
|
4
4
|
class ConfigReader
|
5
5
|
attr_reader :rails_root
|
6
|
-
attr_accessor :base_port, :max_port, :min_free_workers, :spawn_parallel
|
6
|
+
attr_accessor :base_port, :max_port, :min_free_workers, :spawn_parallel, :silent
|
7
7
|
def initialize(rails_root)
|
8
8
|
@rails_root = rails_root
|
9
9
|
@base_port = 11000
|
10
10
|
@max_port = 11100
|
11
11
|
@min_free_workers = 2
|
12
12
|
@spawn_parallel = true
|
13
|
+
@silent = false
|
13
14
|
load_config(File.expand_path("~/.theine"))
|
14
15
|
load_config("#{rails_root}/.theine")
|
15
16
|
end
|
@@ -24,4 +25,4 @@ module Theine
|
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
27
|
-
end
|
28
|
+
end
|
data/lib/theine/server.rb
CHANGED
@@ -26,7 +26,7 @@ module Theine
|
|
26
26
|
def add_worker
|
27
27
|
path = File.expand_path('../worker.rb', __FILE__)
|
28
28
|
port = @workers_mutex.synchronize { @available_ports.shift }
|
29
|
-
puts "(spawn #{"#{port} #{debug}".strip})"
|
29
|
+
puts "(spawn #{"#{port} #{debug}".strip})" if !config.silent
|
30
30
|
spawn("screen", "-d", "-m", "-S", worker_session_name(port),
|
31
31
|
"sh", "-c",
|
32
32
|
"jruby #{debug} #{path} #{config.base_port.to_s} #{port.to_s} #{config.rails_root}")
|
@@ -44,7 +44,7 @@ module Theine
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def worker_boot(port)
|
47
|
-
puts "+ worker #{port}"
|
47
|
+
puts "+ worker #{port}" if !config.silent
|
48
48
|
|
49
49
|
@workers_mutex.synchronize do
|
50
50
|
@spawning_workers.delete(port)
|
@@ -53,7 +53,7 @@ module Theine
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def worker_done(port)
|
56
|
-
puts "- worker #{port}"
|
56
|
+
puts "- worker #{port}" if !config.silent
|
57
57
|
@workers_mutex.synchronize do
|
58
58
|
@workers_in_use.delete(port)
|
59
59
|
@available_ports << port
|
@@ -104,13 +104,13 @@ module Theine
|
|
104
104
|
end
|
105
105
|
private
|
106
106
|
def kill_worker(port)
|
107
|
-
print "- worker #{port}"
|
107
|
+
print "- worker #{port}" if !config.silent
|
108
108
|
worker_pid = @worker_pids[port]
|
109
109
|
worker_pid ||= DRbObject.new_with_uri("druby://localhost:#{port}").pid
|
110
110
|
system("kill -9 #{worker_pid} > /dev/null 2>&1")
|
111
111
|
session_name = worker_session_name(port)
|
112
112
|
system("screen -S #{session_name} -X quit > /dev/null 2>&1")
|
113
|
-
puts "."
|
113
|
+
puts "." if !config.silent
|
114
114
|
rescue
|
115
115
|
end
|
116
116
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theine2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Berdajs
|
8
8
|
- Ron Williams
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-11-
|
12
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Rails preloader for JRuby
|
15
15
|
email: ron.a.williams@gmail.com
|
@@ -34,7 +34,7 @@ homepage: https://github.com/rwilliams/theine2
|
|
34
34
|
licenses:
|
35
35
|
- MIT
|
36
36
|
metadata: {}
|
37
|
-
post_install_message:
|
37
|
+
post_install_message:
|
38
38
|
rdoc_options: []
|
39
39
|
require_paths:
|
40
40
|
- lib
|
@@ -49,8 +49,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '0'
|
51
51
|
requirements: []
|
52
|
-
|
53
|
-
|
52
|
+
rubyforge_project:
|
53
|
+
rubygems_version: 2.7.10
|
54
|
+
signing_key:
|
54
55
|
specification_version: 4
|
55
56
|
summary: Theine2
|
56
57
|
test_files: []
|