peek-delayed_job 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/CONTRIBUTING.md +15 -0
- data/LICENSE.md +50 -0
- data/README.md +32 -0
- data/Rakefile +1 -0
- data/app/views/peek/views/_delayed_job.html.erb +1 -0
- data/lib/peek/views/delayed_job.rb +31 -0
- data/lib/peek-delayed_job/railtie.rb +6 -0
- data/lib/peek-delayed_job/version.rb +5 -0
- data/lib/peek-delayed_job.rb +3 -0
- data/peek-delayed_job.gemspec +22 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 720c93307db57dc8207d027d58d113075cd48f18
|
4
|
+
data.tar.gz: c44667fc1a4cf174fec66cafac3bb60a6998d115
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8b9d6064e4e69d706bad55313f745979a20730a362d549f8242048f460c88a70a78468c33defa924457636e74d84ed8f149d5021132cb9fb6cc3a8231597651b
|
7
|
+
data.tar.gz: 2ae1f82669d37d149242498545704ea0b25add6c3d0c8e9f25eca4c8c8c3d48b3f3f2fa3de76d1ba848d7fd1859dc8d425ca1833743b1aeb6e6f7058d05e5ba5
|
data/.gitignore
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
## Welcome!
|
2
|
+
|
3
|
+
We're so glad you're thinking about contributing to an 18F open source project! If you're unsure or afraid of anything, just ask or submit the issue or pull request anyways. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contribution, and don't want a wall of rules to get in the way of that.
|
4
|
+
|
5
|
+
Before contributing, we encourage you to read our CONTRIBUTING policy (you are here), our LICENSE, and our README, all of which should be in this repository. If you have any questions, or want to read more about our underlying policies, you can consult the 18F Open Source Policy GitHub repository at https://github.com/18f/open-source-policy, or just shoot us an email/official government letterhead note to [18f@gsa.gov](mailto:18f@gsa.gov).
|
6
|
+
|
7
|
+
## Public domain
|
8
|
+
|
9
|
+
This project is in the public domain within the United States, and
|
10
|
+
copyright and related rights in the work worldwide are waived through
|
11
|
+
the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).
|
12
|
+
|
13
|
+
All contributions to this project will be released under the CC0
|
14
|
+
dedication. By submitting a pull request, you are agreeing to comply
|
15
|
+
with this waiver of copyright interest.
|
data/LICENSE.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
This is a fork of https://github.com/peek/peek-resque. The original gem is MIT-licensed, and any modifications since commit 0536a3920ae51dce3bd2f04ba8cb897960c42097 are CC0.
|
2
|
+
|
3
|
+
## CC0 1.0 Universal Summary
|
4
|
+
|
5
|
+
This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
|
6
|
+
|
7
|
+
### No Copyright
|
8
|
+
|
9
|
+
The person who associated a work with this deed has dedicated the work to
|
10
|
+
the public domain by waiving all of his or her rights to the work worldwide
|
11
|
+
under copyright law, including all related and neighboring rights, to the
|
12
|
+
extent allowed by law.
|
13
|
+
|
14
|
+
You can copy, modify, distribute and perform the work, even for commercial
|
15
|
+
purposes, all without asking permission.
|
16
|
+
|
17
|
+
### Other Information
|
18
|
+
|
19
|
+
In no way are the patent or trademark rights of any person affected by CC0,
|
20
|
+
nor are the rights that other persons may have in the work or in how the
|
21
|
+
work is used, such as publicity or privacy rights.
|
22
|
+
|
23
|
+
Unless expressly stated otherwise, the person who associated a work with
|
24
|
+
this deed makes no warranties about the work, and disclaims liability for
|
25
|
+
all uses of the work, to the fullest extent permitted by applicable law.
|
26
|
+
When using or citing the work, you should not imply endorsement by the
|
27
|
+
author or the affirmer.
|
28
|
+
|
29
|
+
## MIT License
|
30
|
+
|
31
|
+
Copyright (c) 2013 Garrett Bjerkhoel
|
32
|
+
|
33
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
34
|
+
a copy of this software and associated documentation files (the
|
35
|
+
"Software"), to deal in the Software without restriction, including
|
36
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
37
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
38
|
+
permit persons to whom the Software is furnished to do so, subject to
|
39
|
+
the following conditions:
|
40
|
+
|
41
|
+
The above copyright notice and this permission notice shall be
|
42
|
+
included in all copies or substantial portions of the Software.
|
43
|
+
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
45
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
46
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
47
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
48
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
49
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
50
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Peek::DelayedJob
|
2
|
+
|
3
|
+
Take a peek into the current state of your DelayedJob queue. This peek view provides:
|
4
|
+
|
5
|
+
- The total number of queued jobs.
|
6
|
+
- The total number of failed jobs.
|
7
|
+
|
8
|
+
Only supports the DelayedJob ActiveRecord backend at the moment.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'peek-delayed_job'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install peek-delayed_job
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
Add the following to your `config/initializers/peek.rb`:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
Peek.into Peek::Views::DelayedJob
|
32
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1 @@
|
|
1
|
+
<strong><span data-defer-to="<%= view.defer_key %>-queued">...</span> queued / <span data-defer-to="<%= view.defer_key %>-failed">...</span> failed</strong> delayed::job
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Peek
|
2
|
+
module Views
|
3
|
+
class DelayedJob < View
|
4
|
+
def initialize(options = {})
|
5
|
+
end
|
6
|
+
|
7
|
+
def queued_count
|
8
|
+
Delayed::Job.count
|
9
|
+
end
|
10
|
+
|
11
|
+
def failure_count
|
12
|
+
Delayed::Job.where.not(failed_at: nil).count
|
13
|
+
end
|
14
|
+
|
15
|
+
def context
|
16
|
+
{
|
17
|
+
jobs: {
|
18
|
+
failed: self.failure_count
|
19
|
+
}
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def results
|
24
|
+
{
|
25
|
+
queued: self.queued_count,
|
26
|
+
failed: self.failure_count
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'peek-delayed_job/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = 'peek-delayed_job'
|
8
|
+
gem.version = Peek::DelayedJob::VERSION
|
9
|
+
gem.authors = ['Aidan Feldman']
|
10
|
+
gem.email = ['aidan.feldman@gsa.gov']
|
11
|
+
gem.description = %q{Take a peek into your DelayedJob queue.}
|
12
|
+
gem.summary = %q{Take a peek into your DelayedJob queue.}
|
13
|
+
gem.homepage = 'https://github.com/18F/peek-delayed_job'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ['lib']
|
19
|
+
|
20
|
+
gem.add_dependency 'peek', '>= 0.1.0'
|
21
|
+
gem.add_dependency 'delayed_job_active_record'
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: peek-delayed_job
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aidan Feldman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: peek
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: delayed_job_active_record
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Take a peek into your DelayedJob queue.
|
42
|
+
email:
|
43
|
+
- aidan.feldman@gsa.gov
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CONTRIBUTING.md
|
50
|
+
- LICENSE.md
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- app/views/peek/views/_delayed_job.html.erb
|
54
|
+
- lib/peek-delayed_job.rb
|
55
|
+
- lib/peek-delayed_job/railtie.rb
|
56
|
+
- lib/peek-delayed_job/version.rb
|
57
|
+
- lib/peek/views/delayed_job.rb
|
58
|
+
- peek-delayed_job.gemspec
|
59
|
+
homepage: https://github.com/18F/peek-delayed_job
|
60
|
+
licenses: []
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.4.8
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Take a peek into your DelayedJob queue.
|
82
|
+
test_files: []
|