delayed_job_status 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +32 -0
- data/app/controllers/delayed_job_status/application_controller.rb +4 -0
- data/app/controllers/delayed_job_status/status_controller.rb +14 -0
- data/app/models/delayed_job_status/application_record.rb +26 -0
- data/config/routes.rb +4 -0
- data/lib/delayed_job_status.rb +4 -17
- data/lib/delayed_job_status/engine.rb +5 -0
- metadata +25 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebfa74cb645f69c196e6d96680aaec49845a2360f00672fd432bf4837c79d671
|
4
|
+
data.tar.gz: 681bbe37229d75994be62bbbb8aca674ee294e900c8b773baedabe144f553456
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476f6c899fe1992f94949a7aa249111144a109e788cf4d41dd2ffd55f3a63c98b9bdd11422400721d99eda4768aa22d0434ba175c229946230fde1c72b46a7d3
|
7
|
+
data.tar.gz: 247035a59400ffa486ae9b13f8fa7a53ac583c62c99487b3c3045a80b5371ef6c51942acffc07bbd43deec97bc8c5e08c4ad75c4ad36370eb5fdaf6fb2a56761
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2019 Joey Haalboom
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# DelayedJobStatus
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'delayed_job_status'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install delayed_job_status
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'DelayedJobStatus'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'test'
|
28
|
+
t.pattern = 'test/**/*_test.rb'
|
29
|
+
t.verbose = false
|
30
|
+
end
|
31
|
+
|
32
|
+
task default: :test
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_dependency 'delayed_job_status/application_controller'
|
2
|
+
|
3
|
+
module DelayedJobStatus
|
4
|
+
class StatusController < ApplicationController
|
5
|
+
|
6
|
+
def index
|
7
|
+
respond_to do |format|
|
8
|
+
format.json do
|
9
|
+
render json: ApplicationRecord.getJson
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module DelayedJobStatus
|
2
|
+
class ApplicationRecord < ActiveRecord::Base
|
3
|
+
self.abstract_class = true
|
4
|
+
|
5
|
+
def self.getJson()
|
6
|
+
return {test: checkWorkers}.to_json
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.checkWorkers
|
10
|
+
getRunningWorkers(getExpectedWorkers)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.getExpectedWorkers
|
14
|
+
file = File.open("#{Rails.root}/config/deploy.rb")
|
15
|
+
filetext = file.read
|
16
|
+
num = filetext.split("delayed_job_workers,").last.strip.split("\n").first.strip
|
17
|
+
return num.to_i
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.getRunningWorkers(workers)
|
21
|
+
response = `RAILS_ENV="production" bundle exec bin/delayed_job status -n #{workers}`
|
22
|
+
puts "#{response}"
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/config/routes.rb
ADDED
data/lib/delayed_job_status.rb
CHANGED
@@ -1,18 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
def self.getExpectedWorkers
|
7
|
-
file = File.open("#{Rails.root}/config/deploy.rb")
|
8
|
-
filetext = file.read
|
9
|
-
num = filetext.split("delayed_job_workers,").last.strip.split("\n").first.strip
|
10
|
-
return num.to_i
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.getRunningWorkers(workers)
|
14
|
-
response = `RAILS_ENV="production" bundle exec bin/delayed_job status -n #{workers}`
|
15
|
-
puts "#{response} Test"
|
16
|
-
return response
|
17
|
-
end
|
1
|
+
require "delayed_job_status/engine"
|
2
|
+
|
3
|
+
module DelayedJobStatus
|
4
|
+
|
18
5
|
end
|
metadata
CHANGED
@@ -1,22 +1,44 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnelleFrikandel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
12
|
-
dependencies:
|
11
|
+
date: 2019-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
13
27
|
description:
|
14
28
|
email: development@eskesmedia.nl
|
15
29
|
executables: []
|
16
30
|
extensions: []
|
17
31
|
extra_rdoc_files: []
|
18
32
|
files:
|
33
|
+
- MIT-LICENSE
|
34
|
+
- README.md
|
35
|
+
- Rakefile
|
36
|
+
- app/controllers/delayed_job_status/application_controller.rb
|
37
|
+
- app/controllers/delayed_job_status/status_controller.rb
|
38
|
+
- app/models/delayed_job_status/application_record.rb
|
39
|
+
- config/routes.rb
|
19
40
|
- lib/delayed_job_status.rb
|
41
|
+
- lib/delayed_job_status/engine.rb
|
20
42
|
homepage: https://rubygems.org/gems/delayed_job_status
|
21
43
|
licenses:
|
22
44
|
- MIT
|