process_bot 0.1.24 → 0.1.26
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 +4 -4
- data/CHANGELOG.md +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/Rakefile +36 -2
- data/lib/process_bot/process/handlers/custom.rb +1 -1
- data/lib/process_bot/process.rb +11 -0
- data/lib/process_bot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e46c5f20791400dfc63138936340fc46e514d52947d2d2ba78cb208c521f442
|
|
4
|
+
data.tar.gz: 0f3ec322eb916178092eb5e7b19cab1a92421a23767fea310bf4c69319e72ca9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd08e3680f9c436c00fed3c5ed760542cbbb4fba517021493f6d17de799ed4e781c86d652baa230f0433794a36f61861de8f52c846ff64dfda651b73ba42c3bc
|
|
7
|
+
data.tar.gz: 1b91173a14173732de83e7e00f47e95a10a0272768f5810f9ca789f12cb181fd3282bd4c0feab33a3c3f6b0074bcfac6bbb55ca753bb2e8df9c70f4cd7121464
|
data/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
- Guard stop-related process scanning when subprocess PID/PGID is unavailable and fail stop loudly.
|
|
10
10
|
- Wait briefly for subprocess PID assignment during stop; raise if PID is still missing so stop cannot silently succeed.
|
|
11
11
|
|
|
12
|
+
- Require an active runner for custom stop commands to avoid constructing a fresh runner with no PID.
|
|
13
|
+
|
|
12
14
|
## [0.1.0] - 2022-04-03
|
|
13
15
|
|
|
14
16
|
- Initial release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -113,7 +113,9 @@ bundle exec process_bot --command start --log-file-path /var/log/process_bot.log
|
|
|
113
113
|
|
|
114
114
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
115
115
|
|
|
116
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
116
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
117
|
+
|
|
118
|
+
To bump the patch version, run bundle, commit the version bump, build, and push the gem, run `bundle exec rake release:patch`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
117
119
|
|
|
118
120
|
## Contributing
|
|
119
121
|
|
data/Rakefile
CHANGED
|
@@ -2,11 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
require "bundler/gem_tasks"
|
|
4
4
|
require "rspec/core/rake_task"
|
|
5
|
+
require "rubocop/rake_task"
|
|
5
6
|
|
|
6
7
|
RSpec::Core::RakeTask.new(:spec)
|
|
8
|
+
RuboCop::RakeTask.new
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
def bump_patch_version(version_path)
|
|
11
|
+
version_content = File.read(version_path)
|
|
12
|
+
version_match = version_content.match(/VERSION = "(\d+)\.(\d+)\.(\d+)"\.freeze/)
|
|
13
|
+
raise "Could not find current version in #{version_path}" unless version_match
|
|
9
14
|
|
|
10
|
-
|
|
15
|
+
major = version_match[1].to_i
|
|
16
|
+
minor = version_match[2].to_i
|
|
17
|
+
patch = version_match[3].to_i + 1
|
|
18
|
+
|
|
19
|
+
new_version = "#{major}.#{minor}.#{patch}"
|
|
20
|
+
new_content = version_content.sub(version_match[0], "VERSION = \"#{new_version}\".freeze")
|
|
21
|
+
File.write(version_path, new_content)
|
|
22
|
+
|
|
23
|
+
new_version
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
namespace :release do
|
|
27
|
+
desc "Bump patch version, run bundle, commit version bump, build gem, and push gem"
|
|
28
|
+
task :patch do
|
|
29
|
+
version_path = "lib/process_bot/version.rb"
|
|
30
|
+
new_version = bump_patch_version(version_path)
|
|
31
|
+
|
|
32
|
+
puts "Bumped version to #{new_version}"
|
|
33
|
+
|
|
34
|
+
sh "bundle install"
|
|
35
|
+
sh "git add #{version_path}"
|
|
36
|
+
sh "git commit -m \"Bump version to #{new_version}\""
|
|
37
|
+
sh "bundle exec rake build"
|
|
38
|
+
|
|
39
|
+
gem_path = "pkg/process_bot-#{new_version}.gem"
|
|
40
|
+
raise "Expected gem file was not built: #{gem_path}" unless File.exist?(gem_path)
|
|
41
|
+
|
|
42
|
+
sh "gem push #{gem_path}"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
11
45
|
|
|
12
46
|
task default: %i[spec rubocop]
|
data/lib/process_bot/process.rb
CHANGED
|
@@ -140,6 +140,17 @@ class ProcessBot::Process
|
|
|
140
140
|
current_runner_instance&.runner || @runner ||= build_runner
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
+
def active_runner
|
|
144
|
+
current_runner_instance&.runner
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def active_runner!
|
|
148
|
+
runner_instance = active_runner
|
|
149
|
+
return runner_instance if runner_instance
|
|
150
|
+
|
|
151
|
+
raise "Unable to stop custom process because no active runner is available. Ensure the custom command runs in foreground."
|
|
152
|
+
end
|
|
153
|
+
|
|
143
154
|
def update_process_title
|
|
144
155
|
process_args = {application: options[:application], handler: handler_name, id: options[:id], pid: current_pid, port: port}
|
|
145
156
|
@current_process_title = "ProcessBot #{JSON.generate(process_args)}"
|
data/lib/process_bot/version.rb
CHANGED