copy_tuner_client 0.13.5 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/assets/javascripts/copytuner.js +1 -1
- data/lib/copy_tuner_client/process_guard.rb +20 -18
- data/lib/copy_tuner_client/version.rb +1 -1
- data/spec/copy_tuner_client/process_guard_spec.rb +0 -24
- data/src/main.ts +1 -1
- metadata +2 -4
- data/spec/support/fake_resque_job.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c3aa96213cfb378917e854a87a2d123811e5b680ac1d0cad51d0a7c5cd63ac0
|
4
|
+
data.tar.gz: 690b11ad48005c79a59c50132b0f3f603160353cd45a29dc72f63f02f480ee08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba67841e0fe4bd9472bb6ff773cd1c91b3a50dbe899d6bd44f1aebba03601dbc42be664dcbb08de920c11a9c6b33acedbf00e342f0db22e3c3894fad0270d066
|
7
|
+
data.tar.gz: a6f481140fcce7273249f76b00a28a5e935419c965bf5efa57f100de13d4b9de11ac0310c706e65557763cb3372dbb951d040c23f5acc2ffb5026f1aa77be105
|
data/CHANGELOG.md
CHANGED
@@ -373,7 +373,7 @@ const start = () => {
|
|
373
373
|
copyray2.hide();
|
374
374
|
return;
|
375
375
|
}
|
376
|
-
if ((isMac && event.metaKey || !isMac && event.ctrlKey) && event.shiftKey && event.key === "k") {
|
376
|
+
if ((isMac && event.metaKey || !isMac && event.ctrlKey) && event.shiftKey && event.key.toLowerCase() === "k") {
|
377
377
|
copyray2.toggle();
|
378
378
|
}
|
379
379
|
});
|
@@ -18,7 +18,6 @@ module CopyTunerClient
|
|
18
18
|
register_spawn_hooks
|
19
19
|
else
|
20
20
|
register_exit_hooks
|
21
|
-
register_job_hooks
|
22
21
|
start_polling
|
23
22
|
end
|
24
23
|
end
|
@@ -30,7 +29,7 @@ module CopyTunerClient
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def spawner?
|
33
|
-
passenger_spawner? || unicorn_spawner? || delayed_job_spawner? || puma_spawner?
|
32
|
+
passenger_spawner? || unicorn_spawner? || delayed_job_spawner? || puma_spawner? || good_job_spawner?
|
34
33
|
end
|
35
34
|
|
36
35
|
def passenger_spawner?
|
@@ -53,6 +52,10 @@ module CopyTunerClient
|
|
53
52
|
defined?(Delayed::Worker) && $0.include?('delayed_job')
|
54
53
|
end
|
55
54
|
|
55
|
+
def good_job_spawner?
|
56
|
+
$0.include?('good_job') && defined?(GoodJob) && ARGV.include?('--daemonize')
|
57
|
+
end
|
58
|
+
|
56
59
|
def register_spawn_hooks
|
57
60
|
if passenger_spawner?
|
58
61
|
register_passenger_hook
|
@@ -62,6 +65,8 @@ module CopyTunerClient
|
|
62
65
|
register_puma_hook
|
63
66
|
elsif delayed_job_spawner?
|
64
67
|
register_delayed_hook
|
68
|
+
elsif good_job_spawner?
|
69
|
+
register_good_job_hook
|
65
70
|
end
|
66
71
|
end
|
67
72
|
|
@@ -96,6 +101,18 @@ module CopyTunerClient
|
|
96
101
|
end
|
97
102
|
end
|
98
103
|
|
104
|
+
def register_good_job_hook
|
105
|
+
@logger.info("Registered good_job start hook")
|
106
|
+
poller = @poller
|
107
|
+
hook_module = Module.new do
|
108
|
+
define_method :daemon do
|
109
|
+
super
|
110
|
+
poller.start
|
111
|
+
end
|
112
|
+
end
|
113
|
+
::Process.singleton_class.prepend hook_module
|
114
|
+
end
|
115
|
+
|
99
116
|
def register_puma_hook
|
100
117
|
# If Puma is clustered mode without preload_app, this method is called on worker process.
|
101
118
|
# Just start poller and return.
|
@@ -112,7 +129,7 @@ module CopyTunerClient
|
|
112
129
|
hook_module = Module.new do
|
113
130
|
define_method :start_server do
|
114
131
|
poller.start
|
115
|
-
super
|
132
|
+
super
|
116
133
|
end
|
117
134
|
end
|
118
135
|
Puma::Runner.prepend hook_module
|
@@ -123,20 +140,5 @@ module CopyTunerClient
|
|
123
140
|
@cache.flush
|
124
141
|
end
|
125
142
|
end
|
126
|
-
|
127
|
-
def register_job_hooks
|
128
|
-
if defined?(Resque::Job)
|
129
|
-
@logger.info("Registered Resque after_perform hook")
|
130
|
-
cache = @cache
|
131
|
-
Resque::Job.class_eval do
|
132
|
-
alias_method :perform_without_copy_tuner, :perform
|
133
|
-
define_method :perform do
|
134
|
-
job_was_performed = perform_without_copy_tuner
|
135
|
-
cache.flush
|
136
|
-
job_was_performed
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
143
|
end
|
142
144
|
end
|
@@ -91,28 +91,4 @@ describe CopyTunerClient::ProcessGuard do
|
|
91
91
|
|
92
92
|
expect(cache).to be_written
|
93
93
|
end
|
94
|
-
|
95
|
-
it "flushes after running a resque job" do
|
96
|
-
logger = FakeLogger.new
|
97
|
-
cache = WritingCache.new
|
98
|
-
define_constant('Resque', Module.new)
|
99
|
-
job_class = define_constant('Resque::Job', FakeResqueJob)
|
100
|
-
job = job_class.new
|
101
|
-
process_guard = build_process_guard(:cache => cache, :logger => logger)
|
102
|
-
|
103
|
-
process_guard.start
|
104
|
-
job.fork_and_perform
|
105
|
-
|
106
|
-
expect(cache).to be_written
|
107
|
-
expect(logger).to have_entry(:info, "Registered Resque after_perform hook")
|
108
|
-
end
|
109
|
-
|
110
|
-
it "doesn't fail if only Resque is defined and not Resque::Job" do
|
111
|
-
logger = FakeLogger.new
|
112
|
-
cache = WritingCache.new
|
113
|
-
define_constant('Resque', Module.new)
|
114
|
-
process_guard = build_process_guard(:cache => cache, :logger => logger)
|
115
|
-
|
116
|
-
process_guard.start
|
117
|
-
end
|
118
94
|
end
|
data/src/main.ts
CHANGED
@@ -41,7 +41,7 @@ const start = () => {
|
|
41
41
|
return
|
42
42
|
}
|
43
43
|
|
44
|
-
if (((isMac && event.metaKey) || (!isMac && event.ctrlKey)) && event.shiftKey && event.key === 'k') {
|
44
|
+
if (((isMac && event.metaKey) || (!isMac && event.ctrlKey)) && event.shiftKey && event.key.toLowerCase() === 'k') {
|
45
45
|
copyray.toggle()
|
46
46
|
}
|
47
47
|
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copy_tuner_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SonicGarden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -248,7 +248,6 @@ files:
|
|
248
248
|
- spec/support/fake_html_safe_string.rb
|
249
249
|
- spec/support/fake_logger.rb
|
250
250
|
- spec/support/fake_passenger.rb
|
251
|
-
- spec/support/fake_resque_job.rb
|
252
251
|
- spec/support/fake_unicorn.rb
|
253
252
|
- spec/support/middleware_stack.rb
|
254
253
|
- spec/support/writing_cache.rb
|
@@ -307,7 +306,6 @@ test_files:
|
|
307
306
|
- spec/support/fake_html_safe_string.rb
|
308
307
|
- spec/support/fake_logger.rb
|
309
308
|
- spec/support/fake_passenger.rb
|
310
|
-
- spec/support/fake_resque_job.rb
|
311
309
|
- spec/support/fake_unicorn.rb
|
312
310
|
- spec/support/middleware_stack.rb
|
313
311
|
- spec/support/writing_cache.rb
|