passive_queue 1.0.0 → 1.1.0
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/.ruby-version +1 -0
- data/.yard-lint.yml +94 -0
- data/CHANGELOG.md +16 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +9 -18
- data/README.md +1 -1
- data/Rakefile +4 -0
- data/lib/passive_queue/adapter.rb +28 -0
- data/lib/passive_queue/cli.rb +35 -0
- data/lib/passive_queue/configuration.rb +19 -1
- data/lib/passive_queue/engine.rb +8 -3
- data/lib/passive_queue/version.rb +1 -1
- data/lib/passive_queue/web.rb +38 -0
- data/lib/passive_queue.rb +22 -0
- data/passive_queue.gemspec +28 -0
- data/renovate.json +22 -0
- metadata +8 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14f8ed63b9c73cb9e5d8aaabb2ca9062bd28335c92b46cae2e676102fe23d2e9
|
|
4
|
+
data.tar.gz: 576d48dfdb6eef8d0725d5d1a48af30d971415386443c717e42feac607dd32f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c54ef9ca173d1e7ce2d5834669d07b3deed860d476f216066c1aaf0c49308ccbab6ee3d8fe593aa79e51adde5f1bf7541fe75cc1bfa51072570202542eb43b6c
|
|
7
|
+
data.tar.gz: 3be8fe8ce3cb36f1402456ac643139e9cb59dffe403b44c38b439b85d603f322bc267dc3d4377e20e4def4644947c2c2c63b57bf35211de36a1d3c0476656432
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.5
|
data/.yard-lint.yml
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# YARD-Lint Configuration
|
|
2
|
+
# Strict settings: all validators set to error severity and 100% coverage requirement
|
|
3
|
+
|
|
4
|
+
AllValidators:
|
|
5
|
+
# Fail on any error severity violation
|
|
6
|
+
FailOnSeverity: error
|
|
7
|
+
|
|
8
|
+
# Require 100% documentation coverage
|
|
9
|
+
MinCoverage: 100.0
|
|
10
|
+
|
|
11
|
+
# Include private and protected methods in validation
|
|
12
|
+
YardOptions:
|
|
13
|
+
- --private
|
|
14
|
+
- --protected
|
|
15
|
+
|
|
16
|
+
# Documentation Validators - All set to ERROR
|
|
17
|
+
Documentation/UndocumentedObjects:
|
|
18
|
+
Enabled: true
|
|
19
|
+
Severity: error
|
|
20
|
+
Description: All classes, modules, and methods must be documented
|
|
21
|
+
|
|
22
|
+
Documentation/UndocumentedMethodArguments:
|
|
23
|
+
Enabled: true
|
|
24
|
+
Severity: error
|
|
25
|
+
Description: All method parameters must have @param documentation
|
|
26
|
+
|
|
27
|
+
Documentation/UndocumentedReturnValue:
|
|
28
|
+
Enabled: true
|
|
29
|
+
Severity: error
|
|
30
|
+
Description: All methods with return values must have @return documentation
|
|
31
|
+
|
|
32
|
+
Documentation/MinimumDescriptionLength:
|
|
33
|
+
Enabled: true
|
|
34
|
+
Severity: error
|
|
35
|
+
MinLength: 10
|
|
36
|
+
Description: Documentation must be meaningful (minimum 10 characters)
|
|
37
|
+
|
|
38
|
+
Documentation/MarkdownSyntax:
|
|
39
|
+
Enabled: true
|
|
40
|
+
Severity: error
|
|
41
|
+
Description: All markdown in documentation must be valid
|
|
42
|
+
|
|
43
|
+
# Tag Validators - All set to ERROR
|
|
44
|
+
Tags/InvalidTypes:
|
|
45
|
+
Enabled: true
|
|
46
|
+
Severity: error
|
|
47
|
+
Description: Type specifications must use valid YARD syntax
|
|
48
|
+
|
|
49
|
+
Tags/Order:
|
|
50
|
+
Enabled: true
|
|
51
|
+
Severity: error
|
|
52
|
+
Description: Tags must follow consistent ordering
|
|
53
|
+
|
|
54
|
+
Tags/CollectionType:
|
|
55
|
+
Enabled: true
|
|
56
|
+
Severity: error
|
|
57
|
+
Description: Collections must use YARD standard syntax (e.g., Hash{K => V}, Array<Type>)
|
|
58
|
+
|
|
59
|
+
Tags/ExampleSyntax:
|
|
60
|
+
Enabled: true
|
|
61
|
+
Severity: error
|
|
62
|
+
Description: Code in @example tags must be valid Ruby syntax
|
|
63
|
+
|
|
64
|
+
Tags/MissingTypeInformation:
|
|
65
|
+
Enabled: true
|
|
66
|
+
Severity: error
|
|
67
|
+
Description: Tags requiring types must have type information
|
|
68
|
+
|
|
69
|
+
Tags/DuplicateTags:
|
|
70
|
+
Enabled: true
|
|
71
|
+
Severity: error
|
|
72
|
+
Description: No duplicate tags allowed (except @param, @option, @raise)
|
|
73
|
+
|
|
74
|
+
# Code Quality Validators - All set to ERROR
|
|
75
|
+
Quality/EmptyDescription:
|
|
76
|
+
Enabled: true
|
|
77
|
+
Severity: error
|
|
78
|
+
Description: Descriptions cannot be empty or whitespace-only
|
|
79
|
+
|
|
80
|
+
Quality/InconsistentIndentation:
|
|
81
|
+
Enabled: true
|
|
82
|
+
Severity: error
|
|
83
|
+
Description: Documentation must have consistent indentation
|
|
84
|
+
|
|
85
|
+
Quality/TrailingWhitespace:
|
|
86
|
+
Enabled: true
|
|
87
|
+
Severity: error
|
|
88
|
+
Description: No trailing whitespace in documentation
|
|
89
|
+
|
|
90
|
+
# Naming Validators - All set to ERROR
|
|
91
|
+
Naming/InconsistentParameterNames:
|
|
92
|
+
Enabled: true
|
|
93
|
+
Severity: error
|
|
94
|
+
Description: Parameter names in @param tags must match method signature
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. Since this is Passive Queue, "changes" might be a strong word.
|
|
4
4
|
|
|
5
|
+
## [1.1.0] - 2025-11-13
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Dropped Ruby 3.1 and 3.2 support - now requires Ruby >= 3.3.0
|
|
9
|
+
- Embracing modern Ruby while maintaining the art of doing nothing
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- GitHub Actions CI workflow with yard-lint validation
|
|
13
|
+
- Trusted publishing workflow for automated gem releases
|
|
14
|
+
- Continuous integration for documentation quality
|
|
15
|
+
|
|
16
|
+
## [1.0.1] - Unreleased
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Potential technical overhead by adding RSpec to the gem?
|
|
20
|
+
|
|
5
21
|
## [1.0.0] - 2025-07-12
|
|
6
22
|
|
|
7
23
|
### Added
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
passive_queue (1.
|
|
4
|
+
passive_queue (1.1.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rspec-core (3.13.5)
|
|
16
|
-
rspec-support (~> 3.13.0)
|
|
17
|
-
rspec-expectations (3.13.5)
|
|
18
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
19
|
-
rspec-support (~> 3.13.0)
|
|
20
|
-
rspec-mocks (3.13.5)
|
|
21
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
22
|
-
rspec-support (~> 3.13.0)
|
|
23
|
-
rspec-support (3.13.4)
|
|
9
|
+
rake (13.3.1)
|
|
10
|
+
yard (0.9.37)
|
|
11
|
+
yard-lint (1.2.2)
|
|
12
|
+
yard (~> 0.9)
|
|
13
|
+
zeitwerk (~> 2.6)
|
|
14
|
+
zeitwerk (2.7.3)
|
|
24
15
|
|
|
25
16
|
PLATFORMS
|
|
26
17
|
ruby
|
|
@@ -28,8 +19,8 @@ PLATFORMS
|
|
|
28
19
|
|
|
29
20
|
DEPENDENCIES
|
|
30
21
|
passive_queue!
|
|
31
|
-
rake
|
|
32
|
-
|
|
22
|
+
rake
|
|
23
|
+
yard-lint
|
|
33
24
|
|
|
34
25
|
BUNDLED WITH
|
|
35
26
|
2.6.9
|
data/README.md
CHANGED
|
@@ -428,7 +428,7 @@ Passive Queue is built on the fundamental principle that the most reliable code
|
|
|
428
428
|
- **Complete Compatibility**: Works with any existing job without modification
|
|
429
429
|
- **Inner Peace**: Developers can rest easy knowing nothing will break
|
|
430
430
|
|
|
431
|
-
## FAQ
|
|
431
|
+
## FAQ
|
|
432
432
|
|
|
433
433
|
**Q: Will my jobs actually run?**
|
|
434
434
|
A: No, and that's the point! Your jobs achieve perfect success by never executing.
|
data/Rakefile
ADDED
|
@@ -1,27 +1,50 @@
|
|
|
1
1
|
module PassiveQueue
|
|
2
|
+
# ActiveJob queue adapter that accepts jobs but never processes them.
|
|
3
|
+
# Implements the ActiveJob adapter interface with zen-like non-execution.
|
|
2
4
|
class Adapter
|
|
5
|
+
# Initializes a new Adapter instance with the zen of doing nothing
|
|
3
6
|
def initialize
|
|
4
7
|
# Initialize with the zen of doing nothing
|
|
5
8
|
end
|
|
6
9
|
|
|
10
|
+
# Enqueues a job for immediate non-execution
|
|
11
|
+
#
|
|
12
|
+
# @param job [ActiveJob::Base] the job to passively accept
|
|
13
|
+
# @return [void]
|
|
7
14
|
def enqueue(job)
|
|
8
15
|
log_job_acceptance(job)
|
|
9
16
|
end
|
|
10
17
|
|
|
18
|
+
# Enqueues a job for delayed non-execution at a specific time
|
|
19
|
+
#
|
|
20
|
+
# @param job [ActiveJob::Base] the job to schedule for non-execution
|
|
21
|
+
# @param timestamp [Numeric] Unix timestamp when the job should not be executed
|
|
22
|
+
# @return [void]
|
|
11
23
|
def enqueue_at(job, timestamp)
|
|
12
24
|
log_job_scheduling(job, timestamp)
|
|
13
25
|
end
|
|
14
26
|
|
|
27
|
+
# Enqueues multiple jobs for batch non-execution
|
|
28
|
+
#
|
|
29
|
+
# @param jobs [Array<ActiveJob::Base>] array of jobs to passively accept
|
|
30
|
+
# @return [Array<void>] results of enqueueing each job
|
|
15
31
|
def enqueue_all(jobs)
|
|
16
32
|
jobs.map { |job| enqueue(job) }
|
|
17
33
|
end
|
|
18
34
|
|
|
35
|
+
# Returns whether the adapter is stopping (always true for zen purposes)
|
|
36
|
+
#
|
|
37
|
+
# @return [Boolean] always returns true to maintain peaceful state
|
|
19
38
|
def stopping?
|
|
20
39
|
true
|
|
21
40
|
end
|
|
22
41
|
|
|
23
42
|
private
|
|
24
43
|
|
|
44
|
+
# Logs acceptance of a job with zen messaging
|
|
45
|
+
#
|
|
46
|
+
# @param job [ActiveJob::Base] the job being accepted
|
|
47
|
+
# @return [void]
|
|
25
48
|
def log_job_acceptance(job)
|
|
26
49
|
return if PassiveQueue.configuration.silence_mode
|
|
27
50
|
|
|
@@ -31,6 +54,11 @@ module PassiveQueue
|
|
|
31
54
|
puts " Status: Successfully not processed ✨"
|
|
32
55
|
end
|
|
33
56
|
|
|
57
|
+
# Logs scheduling of a job with philosophical messaging
|
|
58
|
+
#
|
|
59
|
+
# @param job [ActiveJob::Base] the job being scheduled
|
|
60
|
+
# @param timestamp [Numeric] Unix timestamp for scheduled non-execution
|
|
61
|
+
# @return [void]
|
|
34
62
|
def log_job_scheduling(job, timestamp)
|
|
35
63
|
return if PassiveQueue.configuration.silence_mode
|
|
36
64
|
|
data/lib/passive_queue/cli.rb
CHANGED
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
# lib/passive_queue/cli.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Command-line interface for PassiveQueue meditation and zen commands
|
|
5
6
|
class CLI
|
|
7
|
+
# Entry point for the CLI application
|
|
8
|
+
#
|
|
9
|
+
# @param args [Array<String>] command-line arguments
|
|
10
|
+
# @return [void]
|
|
6
11
|
def self.start(args)
|
|
7
12
|
new.run(args)
|
|
8
13
|
end
|
|
9
14
|
|
|
15
|
+
# Runs the CLI with provided arguments
|
|
16
|
+
#
|
|
17
|
+
# @param args [Array<String>] command-line arguments to process
|
|
18
|
+
# @return [void]
|
|
10
19
|
def run(args)
|
|
11
20
|
# Parse arguments manually (no Thor dependency)
|
|
12
21
|
options = parse_args(args)
|
|
@@ -25,6 +34,10 @@ module PassiveQueue
|
|
|
25
34
|
|
|
26
35
|
private
|
|
27
36
|
|
|
37
|
+
# Parses command-line arguments into an options hash
|
|
38
|
+
#
|
|
39
|
+
# @param args [Array<String>] raw command-line arguments
|
|
40
|
+
# @return [Hash] parsed options with zen, philosophical, aggressive, and duration keys
|
|
28
41
|
def parse_args(args)
|
|
29
42
|
options = {
|
|
30
43
|
zen: false,
|
|
@@ -49,6 +62,14 @@ module PassiveQueue
|
|
|
49
62
|
options
|
|
50
63
|
end
|
|
51
64
|
|
|
65
|
+
# Executes the passive meditation command
|
|
66
|
+
#
|
|
67
|
+
# @param options [Hash] parsed command-line options
|
|
68
|
+
# @option options [Boolean] :zen enable zen quotes during meditation
|
|
69
|
+
# @option options [Boolean] :philosophical enable philosophical thoughts
|
|
70
|
+
# @option options [Boolean] :aggressive aggressively passive mode (not recommended)
|
|
71
|
+
# @option options [Numeric] :duration meditation duration in seconds
|
|
72
|
+
# @return [void]
|
|
52
73
|
def passive_command(options)
|
|
53
74
|
if options[:aggressive]
|
|
54
75
|
puts "❌ Error: Don't be aggressive! The path of the passive queue is one of peace."
|
|
@@ -79,6 +100,13 @@ module PassiveQueue
|
|
|
79
100
|
puts " Your passive queue energy has been restored."
|
|
80
101
|
end
|
|
81
102
|
|
|
103
|
+
# Meditates with zen quotes or philosophical thoughts
|
|
104
|
+
#
|
|
105
|
+
# @param duration [Numeric] meditation duration in seconds
|
|
106
|
+
# @param options [Hash] options hash containing zen or philosophical flags
|
|
107
|
+
# @option options [Boolean] :zen enable zen quotes during meditation
|
|
108
|
+
# @option options [Boolean] :philosophical enable philosophical thoughts
|
|
109
|
+
# @return [void]
|
|
82
110
|
def meditate_with_wisdom(duration, options)
|
|
83
111
|
interval = duration / 3.0
|
|
84
112
|
|
|
@@ -94,6 +122,10 @@ module PassiveQueue
|
|
|
94
122
|
end
|
|
95
123
|
end
|
|
96
124
|
|
|
125
|
+
# Meditates silently with animated dots
|
|
126
|
+
#
|
|
127
|
+
# @param duration [Numeric] meditation duration in seconds
|
|
128
|
+
# @return [void]
|
|
97
129
|
def meditate_silently(duration)
|
|
98
130
|
print " Meditating"
|
|
99
131
|
|
|
@@ -112,6 +144,9 @@ module PassiveQueue
|
|
|
112
144
|
end
|
|
113
145
|
end
|
|
114
146
|
|
|
147
|
+
# Displays help information for the CLI
|
|
148
|
+
#
|
|
149
|
+
# @return [void]
|
|
115
150
|
def show_help
|
|
116
151
|
puts <<~HELP
|
|
117
152
|
Passive Queue CLI - The zen of non-productivity
|
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
# lib/passive_queue/configuration.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Configuration settings for PassiveQueue behavior and aesthetics
|
|
5
6
|
class Configuration
|
|
6
|
-
|
|
7
|
+
# @return [Integer] meditation duration in seconds
|
|
8
|
+
attr_accessor :meditation_duration
|
|
7
9
|
|
|
10
|
+
# @return [Symbol] current zen level (:low, :medium, :high, :transcendent)
|
|
11
|
+
attr_accessor :zen_level
|
|
12
|
+
|
|
13
|
+
# @return [Symbol] philosophical depth (:shallow, :deep, :profound, :existential)
|
|
14
|
+
attr_accessor :philosophical_depth
|
|
15
|
+
|
|
16
|
+
# @return [Boolean] whether to suppress output logging
|
|
17
|
+
attr_accessor :silence_mode
|
|
18
|
+
|
|
19
|
+
# Initializes configuration with default zen values
|
|
8
20
|
def initialize
|
|
9
21
|
@meditation_duration = 5 # seconds
|
|
10
22
|
@zen_level = :medium
|
|
@@ -12,10 +24,16 @@ module PassiveQueue
|
|
|
12
24
|
@silence_mode = false
|
|
13
25
|
end
|
|
14
26
|
|
|
27
|
+
# Returns available zen levels
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Symbol>] valid zen level options
|
|
15
30
|
def zen_levels
|
|
16
31
|
%i[low medium high transcendent]
|
|
17
32
|
end
|
|
18
33
|
|
|
34
|
+
# Returns available philosophical depth levels
|
|
35
|
+
#
|
|
36
|
+
# @return [Array<Symbol>] valid philosophical depth options
|
|
19
37
|
def philosophical_depths
|
|
20
38
|
%i[shallow deep profound existential]
|
|
21
39
|
end
|
data/lib/passive_queue/engine.rb
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# ================================
|
|
2
|
-
# lib/passive_queue/engine.rb
|
|
2
|
+
# lib/passive_queue/engine.rb
|
|
3
3
|
# ================================
|
|
4
4
|
module PassiveQueue
|
|
5
|
+
# Rack engine that mounts the PassiveQueue web dashboard in Rails applications
|
|
5
6
|
class Engine
|
|
7
|
+
# Rack call method that delegates to the Web application
|
|
8
|
+
#
|
|
9
|
+
# @param env [Hash] Rack environment hash
|
|
10
|
+
# @return [Array] Rack response triplet [status, headers, body]
|
|
6
11
|
def self.call(env)
|
|
7
12
|
# Strip the mount path to get relative path
|
|
8
13
|
path_info = env['PATH_INFO']
|
|
9
14
|
script_name = env['SCRIPT_NAME']
|
|
10
|
-
|
|
15
|
+
|
|
11
16
|
# Create new env with adjusted paths for the Web app
|
|
12
17
|
web_env = env.dup
|
|
13
18
|
web_env['PATH_INFO'] = path_info
|
|
14
19
|
web_env['SCRIPT_NAME'] = script_name
|
|
15
|
-
|
|
20
|
+
|
|
16
21
|
Web.new.call(web_env)
|
|
17
22
|
end
|
|
18
23
|
end
|
data/lib/passive_queue/web.rb
CHANGED
|
@@ -5,7 +5,12 @@ require 'erb'
|
|
|
5
5
|
require 'json'
|
|
6
6
|
|
|
7
7
|
module PassiveQueue
|
|
8
|
+
# Rack web application providing a dashboard interface for PassiveQueue
|
|
8
9
|
class Web
|
|
10
|
+
# Rack call method that routes requests to appropriate handlers
|
|
11
|
+
#
|
|
12
|
+
# @param env [Hash] Rack environment hash
|
|
13
|
+
# @return [Array] Rack response triplet [status, headers, body]
|
|
9
14
|
def call(env)
|
|
10
15
|
request = Rack::Request.new(env)
|
|
11
16
|
|
|
@@ -29,11 +34,17 @@ module PassiveQueue
|
|
|
29
34
|
|
|
30
35
|
private
|
|
31
36
|
|
|
37
|
+
# Renders the main dashboard HTML page
|
|
38
|
+
#
|
|
39
|
+
# @return [Array] Rack response with HTML dashboard
|
|
32
40
|
def dashboard_response
|
|
33
41
|
html = dashboard_html
|
|
34
42
|
[200, {'Content-Type' => 'text/html'}, [html]]
|
|
35
43
|
end
|
|
36
44
|
|
|
45
|
+
# Returns JSON response with queue statistics
|
|
46
|
+
#
|
|
47
|
+
# @return [Array] Rack response with JSON stats data
|
|
37
48
|
def api_stats_response
|
|
38
49
|
stats = {
|
|
39
50
|
jobs_queued: rand(9999..99999),
|
|
@@ -51,45 +62,72 @@ module PassiveQueue
|
|
|
51
62
|
[200, {'Content-Type' => 'application/json'}, [stats.to_json]]
|
|
52
63
|
end
|
|
53
64
|
|
|
65
|
+
# Returns JSON response with a random zen quote
|
|
66
|
+
#
|
|
67
|
+
# @return [Array] Rack response with JSON zen quote
|
|
54
68
|
def api_zen_response
|
|
55
69
|
quote = PassiveQueue.zen_quotes.sample
|
|
56
70
|
[200, {'Content-Type' => 'application/json'}, [{quote: quote}.to_json]]
|
|
57
71
|
end
|
|
58
72
|
|
|
73
|
+
# Returns CSS stylesheet response (unused method)
|
|
74
|
+
#
|
|
75
|
+
# @return [Array] Rack response with CSS content
|
|
59
76
|
def css_response
|
|
60
77
|
css = dashboard_css
|
|
61
78
|
[200, {'Content-Type' => 'text/css'}, [css]]
|
|
62
79
|
end
|
|
63
80
|
|
|
81
|
+
# Returns the light theme logo SVG
|
|
82
|
+
#
|
|
83
|
+
# @return [Array] Rack response with SVG logo
|
|
64
84
|
def logo_response
|
|
65
85
|
svg = logo_svg
|
|
66
86
|
[200, {'Content-Type' => 'image/svg+xml'}, [svg]]
|
|
67
87
|
end
|
|
68
88
|
|
|
89
|
+
# Returns the dark theme logo SVG
|
|
90
|
+
#
|
|
91
|
+
# @return [Array] Rack response with dark theme SVG logo
|
|
69
92
|
def logo_dark_response
|
|
70
93
|
svg = logo_svg_dark
|
|
71
94
|
[200, {'Content-Type' => 'image/svg+xml'}, [svg]]
|
|
72
95
|
end
|
|
73
96
|
|
|
97
|
+
# Returns an empty favicon response
|
|
98
|
+
#
|
|
99
|
+
# @return [Array] Rack response with empty favicon
|
|
74
100
|
def favicon_response
|
|
75
101
|
# Return empty response for favicon
|
|
76
102
|
[200, {'Content-Type' => 'image/x-icon'}, ['']]
|
|
77
103
|
end
|
|
78
104
|
|
|
105
|
+
# Returns a 404 not found response with zen humor
|
|
106
|
+
#
|
|
107
|
+
# @return [Array] Rack response with 404 HTML
|
|
79
108
|
def not_found_response
|
|
80
109
|
[404, {'Content-Type' => 'text/html'}, ['<h1>404 - Page Not Found (Just Like Our Jobs)</h1>']]
|
|
81
110
|
end
|
|
82
111
|
|
|
112
|
+
# Reads and returns the light theme logo SVG content
|
|
113
|
+
#
|
|
114
|
+
# @return [String] SVG file contents
|
|
83
115
|
def logo_svg
|
|
84
116
|
logo_path = File.join(File.dirname(__FILE__), '..', '..', 'html', 'logo.svg')
|
|
85
117
|
File.read(logo_path)
|
|
86
118
|
end
|
|
87
119
|
|
|
120
|
+
# Reads and returns the dark theme logo SVG content
|
|
121
|
+
#
|
|
122
|
+
# @return [String] dark theme SVG file contents
|
|
88
123
|
def logo_svg_dark
|
|
89
124
|
logo_path = File.join(File.dirname(__FILE__), '..', '..', 'html', 'logo-dark.svg')
|
|
90
125
|
File.read(logo_path)
|
|
91
126
|
end
|
|
92
127
|
|
|
128
|
+
# Generates and returns the complete dashboard HTML
|
|
129
|
+
#
|
|
130
|
+
# @return [String] HTML content for the dashboard page
|
|
93
131
|
def dashboard_html
|
|
94
132
|
<<~HTML
|
|
95
133
|
<!DOCTYPE html>
|
data/lib/passive_queue.rb
CHANGED
|
@@ -9,17 +9,36 @@ require "passive_queue/web"
|
|
|
9
9
|
require "passive_queue/engine"
|
|
10
10
|
require "active_job/queue_adapters/passive_queue_adapter"
|
|
11
11
|
|
|
12
|
+
# PassiveQueue is a Rails queue adapter that embraces the zen of non-productivity.
|
|
13
|
+
# It accepts all jobs but executes none, achieving perfect reliability through strategic non-action.
|
|
12
14
|
module PassiveQueue
|
|
15
|
+
# Base error class for PassiveQueue-related errors
|
|
13
16
|
class Error < StandardError; end
|
|
14
17
|
|
|
18
|
+
# Returns the current PassiveQueue configuration instance
|
|
19
|
+
#
|
|
20
|
+
# @return [Configuration] the configuration instance
|
|
15
21
|
def self.configuration
|
|
16
22
|
@configuration ||= Configuration.new
|
|
17
23
|
end
|
|
18
24
|
|
|
25
|
+
# Configures PassiveQueue with a block
|
|
26
|
+
#
|
|
27
|
+
# @yield [Configuration] the configuration instance
|
|
28
|
+
# @return [void]
|
|
29
|
+
#
|
|
30
|
+
# @example
|
|
31
|
+
# PassiveQueue.configure do |config|
|
|
32
|
+
# config.zen_level = :transcendent
|
|
33
|
+
# config.silence_mode = true
|
|
34
|
+
# end
|
|
19
35
|
def self.configure
|
|
20
36
|
yield(configuration)
|
|
21
37
|
end
|
|
22
38
|
|
|
39
|
+
# Returns an array of zen quotes about passive processing
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<String>] collection of zen wisdom
|
|
23
42
|
def self.zen_quotes
|
|
24
43
|
[
|
|
25
44
|
"The best job is the one never executed.",
|
|
@@ -35,6 +54,9 @@ module PassiveQueue
|
|
|
35
54
|
]
|
|
36
55
|
end
|
|
37
56
|
|
|
57
|
+
# Returns an array of philosophical thoughts about job processing
|
|
58
|
+
#
|
|
59
|
+
# @return [Array<String>] collection of deep philosophical reflections
|
|
38
60
|
def self.philosophical_thoughts
|
|
39
61
|
[
|
|
40
62
|
"If a job is scheduled but never runs, did it ever really exist?",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require_relative "lib/passive_queue/version"
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |spec|
|
|
4
|
+
spec.name = "passive_queue"
|
|
5
|
+
spec.version = PassiveQueue::VERSION
|
|
6
|
+
spec.authors = ["Maciej Mensfeld"]
|
|
7
|
+
spec.email = ["void@passivequeue.pro"]
|
|
8
|
+
|
|
9
|
+
spec.summary = "A Rails queue adapter that embraces the zen of non-productivity"
|
|
10
|
+
spec.description = "Rails queue adapter for mindful developers. Accepts all jobs, executes none. Perfect reliability through strategic non-action."
|
|
11
|
+
spec.homepage = "https://passivequeue.pro"
|
|
12
|
+
spec.license = "MIT"
|
|
13
|
+
spec.required_ruby_version = ">= 3.3.0"
|
|
14
|
+
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/mensfeld/passive_queue"
|
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/mensfeld/passive_queue/blob/main/CHANGELOG.md"
|
|
18
|
+
|
|
19
|
+
spec.files = Dir.chdir(__dir__) do
|
|
20
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
21
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
spec.executables = ['be']
|
|
26
|
+
spec.require_paths = ["lib"]
|
|
27
|
+
# NO runtime dependencies - true zen has no dependencies
|
|
28
|
+
end
|
data/renovate.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"config:recommended"
|
|
5
|
+
],
|
|
6
|
+
"github-actions": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"pinDigests": true
|
|
9
|
+
},
|
|
10
|
+
"includePaths": [
|
|
11
|
+
"Gemfile",
|
|
12
|
+
"passive_queue.gemspec"
|
|
13
|
+
],
|
|
14
|
+
"packageRules": [
|
|
15
|
+
{
|
|
16
|
+
"matchManagers": [
|
|
17
|
+
"github-actions"
|
|
18
|
+
],
|
|
19
|
+
"minimumReleaseAge": "7 days"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: passive_queue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -18,11 +18,14 @@ executables:
|
|
|
18
18
|
extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
|
20
20
|
files:
|
|
21
|
+
- ".ruby-version"
|
|
22
|
+
- ".yard-lint.yml"
|
|
21
23
|
- CHANGELOG.md
|
|
22
24
|
- Gemfile
|
|
23
25
|
- Gemfile.lock
|
|
24
26
|
- LICENSE
|
|
25
27
|
- README.md
|
|
28
|
+
- Rakefile
|
|
26
29
|
- bin/be
|
|
27
30
|
- html/index.html
|
|
28
31
|
- html/logo-dark.svg
|
|
@@ -37,6 +40,8 @@ files:
|
|
|
37
40
|
- lib/passive_queue/railtie.rb
|
|
38
41
|
- lib/passive_queue/version.rb
|
|
39
42
|
- lib/passive_queue/web.rb
|
|
43
|
+
- passive_queue.gemspec
|
|
44
|
+
- renovate.json
|
|
40
45
|
homepage: https://passivequeue.pro
|
|
41
46
|
licenses:
|
|
42
47
|
- MIT
|
|
@@ -51,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
51
56
|
requirements:
|
|
52
57
|
- - ">="
|
|
53
58
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 3.
|
|
59
|
+
version: 3.3.0
|
|
55
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
61
|
requirements:
|
|
57
62
|
- - ">="
|
|
58
63
|
- !ruby/object:Gem::Version
|
|
59
64
|
version: '0'
|
|
60
65
|
requirements: []
|
|
61
|
-
rubygems_version: 3.6.
|
|
66
|
+
rubygems_version: 3.6.9
|
|
62
67
|
specification_version: 4
|
|
63
68
|
summary: A Rails queue adapter that embraces the zen of non-productivity
|
|
64
69
|
test_files: []
|