diff --git a/.claude/settings.local.json b/.claude/settings.local.json index e9285fe..1c458de 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -2,7 +2,9 @@ "permissions": { "allow": [ "Bash(git add *)", - "Bash(git commit -m ' *)" + "Bash(git commit -m ' *)", + "Bash(git push *)", + "Bash(bundle exec *)" ] } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 03742ef..57e3f2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Rails engine scaffold with isolated namespace `SolidQueueDashboard` -- Configurable authentication hook (`SolidQueueDashboard.authenticate`) +- Rails engine scaffold with isolated namespace `SolidQueueWeb` +- Configurable authentication hook (`SolidQueueWeb.authenticate`) - Read-only dashboard with stat cards for ready, scheduled, running, blocked, and failed jobs - Queues index page showing all queues sorted by name - Jobs index with status filter tabs (ready, scheduled, claimed, blocked, failed) and per-queue filtering @@ -25,5 +25,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - CI workflow with lint (RuboCop) and test (RSpec) matrix across Ruby 3.3, 3.4, and 4.0 - `bin/release` script for versioned gem releases -[Unreleased]: https://github.com/eclectic-coding/solid_queue_dashboard/compare/v0.1.0...HEAD -[0.1.0]: https://github.com/eclectic-coding/solid_queue_dashboard/releases/tag/v0.1.0 +[Unreleased]: https://github.com/eclectic-coding/solid_queue_web/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/eclectic-coding/solid_queue_web/releases/tag/v0.1.0 diff --git a/Gemfile b/Gemfile index a154e38..9cd74f3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -# Specify your gem's dependencies in solid_queue_dashboard.gemspec. +# Specify your gem's dependencies in solid_queue_web.gemspec. gemspec gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock index 73a6841..adc6ec4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - solid_queue_dashboard (0.1.0) + solid_queue_web (0.1.0) rails (>= 8.1.3) solid_queue (>= 1.0) @@ -296,7 +296,7 @@ DEPENDENCIES rspec-rails rubocop-rails-omakase simplecov - solid_queue_dashboard! + solid_queue_web! sqlite3 CHECKSUMS @@ -386,7 +386,7 @@ CHECKSUMS simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246 simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428 solid_queue (1.4.0) sha256=e6a18d196f0b27cb6e3c77c5b31258b05fb634f8ed64fb1866ed164047216c2a - solid_queue_dashboard (0.1.0) + solid_queue_web (0.1.0) sqlite3 (2.9.4-aarch64-linux-gnu) sha256=ecabed721e6eaad54601d2685f09029d90025efc8d931040dc89cb3f8a2080ec sqlite3 (2.9.4-arm64-darwin) sha256=1d5aad413a815d236e96d43f05a1acc600b6cd086800770342a3f9c2877499ff sqlite3 (2.9.4-x86_64-linux-gnu) sha256=537a3eda71b1df1336d0055cbebe55a7317c34870c192c7b6b9d8d0be6871847 diff --git a/README.md b/README.md index 4066d24..cd0d450 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# SolidQueueDashboard +# SolidQueueWeb -[![Gem Version](https://badge.fury.io/rb/solid_queue_dashboard.svg)](https://rubygems.org/gems/solid_queue_dashboard) +[![Gem Version](https://badge.fury.io/rb/solid_queue_web.svg)](https://rubygems.org/gems/solid_queue_web) A read-only Rails engine that mounts a monitoring dashboard for [Solid Queue](https://github.com/rails/solid_queue). View queues, inspect jobs by status, and browse failed executions — all without leaving your app. @@ -17,7 +17,7 @@ A read-only Rails engine that mounts a monitoring dashboard for [Solid Queue](ht Add to your application's Gemfile: ```ruby -gem "solid_queue_dashboard" +gem "solid_queue_web" ``` Then run: @@ -31,17 +31,17 @@ bundle install Add to your `config/routes.rb`: ```ruby -mount SolidQueueDashboard::Engine, at: "/jobs" +mount SolidQueueWeb::Engine, at: "/jobs" ``` The dashboard will be available at `/jobs`. ## Authentication -The engine ships with no authentication by default. Add a block to an initializer (e.g. `config/initializers/solid_queue_dashboard.rb`) to protect the dashboard: +The engine ships with no authentication by default. Add a block to an initializer (e.g. `config/initializers/solid_queue_web.rb`) to protect the dashboard: ```ruby -SolidQueueDashboard.authenticate do +SolidQueueWeb.authenticate do # Called in the context of ApplicationController — use any helper available there. # Return a truthy value to allow access, falsy to deny (triggers HTTP Basic prompt). current_user&.admin? @@ -58,7 +58,7 @@ HTTP Basic authentication is used as a fallback when the block returns falsy. ## Contributing -Bug reports and pull requests are welcome on [GitHub](https://github.com/eclectic-coding/solid_queue_dashboard). +Bug reports and pull requests are welcome on [GitHub](https://github.com/eclectic-coding/solid_queue_web). ## License diff --git a/app/assets/images/solid_queue_dashboard/.keep b/app/assets/images/solid_queue_web/.keep similarity index 100% rename from app/assets/images/solid_queue_dashboard/.keep rename to app/assets/images/solid_queue_web/.keep diff --git a/app/assets/stylesheets/solid_queue_dashboard/application.css b/app/assets/stylesheets/solid_queue_web/application.css similarity index 100% rename from app/assets/stylesheets/solid_queue_dashboard/application.css rename to app/assets/stylesheets/solid_queue_web/application.css diff --git a/app/controllers/solid_queue_dashboard/application_controller.rb b/app/controllers/solid_queue_web/application_controller.rb similarity index 76% rename from app/controllers/solid_queue_dashboard/application_controller.rb rename to app/controllers/solid_queue_web/application_controller.rb index bb3bf52..9f93815 100644 --- a/app/controllers/solid_queue_dashboard/application_controller.rb +++ b/app/controllers/solid_queue_web/application_controller.rb @@ -1,11 +1,11 @@ -module SolidQueueDashboard +module SolidQueueWeb class ApplicationController < ActionController::Base before_action :authenticate! private def authenticate! - return unless (auth = SolidQueueDashboard.authenticate) + return unless (auth = SolidQueueWeb.authenticate) instance_exec(&auth) || request_basic_auth end diff --git a/app/controllers/solid_queue_dashboard/dashboard_controller.rb b/app/controllers/solid_queue_web/dashboard_controller.rb similarity index 94% rename from app/controllers/solid_queue_dashboard/dashboard_controller.rb rename to app/controllers/solid_queue_web/dashboard_controller.rb index 88f1fa6..2ed86e4 100644 --- a/app/controllers/solid_queue_dashboard/dashboard_controller.rb +++ b/app/controllers/solid_queue_web/dashboard_controller.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class DashboardController < ApplicationController def index @stats = { diff --git a/app/controllers/solid_queue_dashboard/failed_jobs_controller.rb b/app/controllers/solid_queue_web/failed_jobs_controller.rb similarity index 88% rename from app/controllers/solid_queue_dashboard/failed_jobs_controller.rb rename to app/controllers/solid_queue_web/failed_jobs_controller.rb index cc13a40..e95cc42 100644 --- a/app/controllers/solid_queue_dashboard/failed_jobs_controller.rb +++ b/app/controllers/solid_queue_web/failed_jobs_controller.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class FailedJobsController < ApplicationController def index @failed_jobs = SolidQueue::FailedExecution diff --git a/app/controllers/solid_queue_dashboard/jobs_controller.rb b/app/controllers/solid_queue_web/jobs_controller.rb similarity index 96% rename from app/controllers/solid_queue_dashboard/jobs_controller.rb rename to app/controllers/solid_queue_web/jobs_controller.rb index 55a97a6..a67f71f 100644 --- a/app/controllers/solid_queue_dashboard/jobs_controller.rb +++ b/app/controllers/solid_queue_web/jobs_controller.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class JobsController < ApplicationController STATUSES = %w[ready scheduled claimed blocked failed].freeze diff --git a/app/controllers/solid_queue_dashboard/queues_controller.rb b/app/controllers/solid_queue_web/queues_controller.rb similarity index 83% rename from app/controllers/solid_queue_dashboard/queues_controller.rb rename to app/controllers/solid_queue_web/queues_controller.rb index ca522e4..6f5496c 100644 --- a/app/controllers/solid_queue_dashboard/queues_controller.rb +++ b/app/controllers/solid_queue_web/queues_controller.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class QueuesController < ApplicationController def index @queues = SolidQueue::Queue.all.sort_by(&:name) diff --git a/app/helpers/solid_queue_dashboard/application_helper.rb b/app/helpers/solid_queue_web/application_helper.rb similarity index 57% rename from app/helpers/solid_queue_dashboard/application_helper.rb rename to app/helpers/solid_queue_web/application_helper.rb index d522058..71f559b 100644 --- a/app/helpers/solid_queue_dashboard/application_helper.rb +++ b/app/helpers/solid_queue_web/application_helper.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb module ApplicationHelper end end diff --git a/app/jobs/solid_queue_dashboard/application_job.rb b/app/jobs/solid_queue_web/application_job.rb similarity index 65% rename from app/jobs/solid_queue_dashboard/application_job.rb rename to app/jobs/solid_queue_web/application_job.rb index d47cf07..071f6ad 100644 --- a/app/jobs/solid_queue_dashboard/application_job.rb +++ b/app/jobs/solid_queue_web/application_job.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class ApplicationJob < ActiveJob::Base end end diff --git a/app/models/solid_queue_dashboard/application_record.rb b/app/models/solid_queue_web/application_record.rb similarity index 76% rename from app/models/solid_queue_dashboard/application_record.rb rename to app/models/solid_queue_web/application_record.rb index 17521fa..a41077f 100644 --- a/app/models/solid_queue_dashboard/application_record.rb +++ b/app/models/solid_queue_web/application_record.rb @@ -1,4 +1,4 @@ -module SolidQueueDashboard +module SolidQueueWeb class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end diff --git a/app/views/layouts/solid_queue_dashboard/application.html.erb b/app/views/layouts/solid_queue_web/application.html.erb similarity index 93% rename from app/views/layouts/solid_queue_dashboard/application.html.erb rename to app/views/layouts/solid_queue_web/application.html.erb index da2b265..2a98fd1 100644 --- a/app/views/layouts/solid_queue_dashboard/application.html.erb +++ b/app/views/layouts/solid_queue_web/application.html.erb @@ -6,7 +6,7 @@ Solid Queue Dashboard <%= csrf_meta_tags %> <%= csp_meta_tag %> - <%= stylesheet_link_tag "solid_queue_dashboard/application", media: "all" %> + <%= stylesheet_link_tag "solid_queue_web/application", media: "all" %> diff --git a/app/views/solid_queue_dashboard/dashboard/index.html.erb b/app/views/solid_queue_web/dashboard/index.html.erb similarity index 100% rename from app/views/solid_queue_dashboard/dashboard/index.html.erb rename to app/views/solid_queue_web/dashboard/index.html.erb diff --git a/app/views/solid_queue_dashboard/failed_jobs/index.html.erb b/app/views/solid_queue_web/failed_jobs/index.html.erb similarity index 100% rename from app/views/solid_queue_dashboard/failed_jobs/index.html.erb rename to app/views/solid_queue_web/failed_jobs/index.html.erb diff --git a/app/views/solid_queue_dashboard/jobs/index.html.erb b/app/views/solid_queue_web/jobs/index.html.erb similarity index 100% rename from app/views/solid_queue_dashboard/jobs/index.html.erb rename to app/views/solid_queue_web/jobs/index.html.erb diff --git a/app/views/solid_queue_dashboard/queues/index.html.erb b/app/views/solid_queue_web/queues/index.html.erb similarity index 100% rename from app/views/solid_queue_dashboard/queues/index.html.erb rename to app/views/solid_queue_web/queues/index.html.erb diff --git a/bin/rails b/bin/rails index 82a8c80..0e5e0df 100755 --- a/bin/rails +++ b/bin/rails @@ -3,7 +3,7 @@ # installed from the root of your application. ENGINE_ROOT = File.expand_path("..", __dir__) -ENGINE_PATH = File.expand_path("../lib/solid_queue_dashboard/engine", __dir__) +ENGINE_PATH = File.expand_path("../lib/solid_queue_web/engine", __dir__) # Set up gems listed in the Gemfile. ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) diff --git a/bin/release b/bin/release index 90377c9..4b15f3b 100755 --- a/bin/release +++ b/bin/release @@ -12,7 +12,7 @@ if [[ -z "$VERSION" ]]; then fi TAG="v$VERSION" -VERSION_FILE="lib/solid_queue_dashboard/version.rb" +VERSION_FILE="lib/solid_queue_web/version.rb" # Must be on main BRANCH=$(git rev-parse --abbrev-ref HEAD) @@ -48,7 +48,7 @@ sed -i '' "s/^## \[Unreleased\]$/## [$VERSION] - $TODAY/" CHANGELOG.md awk "/^## \[$VERSION\]/{print \"## [Unreleased]\n\"; print; next}1" CHANGELOG.md > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md # Update the comparison links at the bottom sed -i '' \ - "s|^\[Unreleased\]:.*|\[Unreleased\]: https://github.com/eclectic-coding/solid_queue_dashboard/compare/$TAG...HEAD\n[$VERSION]: https://github.com/eclectic-coding/solid_queue_dashboard/releases/tag/$TAG|" \ + "s|^\[Unreleased\]:.*|\[Unreleased\]: https://github.com/eclectic-coding/solid_queue_web/compare/$TAG...HEAD\n[$VERSION]: https://github.com/eclectic-coding/solid_queue_web/releases/tag/$TAG|" \ CHANGELOG.md echo "==> Committing release..." @@ -63,9 +63,9 @@ git push origin main git push origin "$TAG" echo "==> Building gem..." -gem build solid_queue_dashboard.gemspec +gem build solid_queue_web.gemspec -GEM_FILE="solid_queue_dashboard-${VERSION}.gem" +GEM_FILE="solid_queue_web-${VERSION}.gem" echo "" echo "Built: $GEM_FILE" diff --git a/config/routes.rb b/config/routes.rb index 2da5aa6..5c37df7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -SolidQueueDashboard::Engine.routes.draw do +SolidQueueWeb::Engine.routes.draw do root to: "dashboard#index" resources :queues, only: [ :index ] diff --git a/lib/solid_queue_dashboard/engine.rb b/lib/solid_queue_dashboard/engine.rb deleted file mode 100644 index 87e5481..0000000 --- a/lib/solid_queue_dashboard/engine.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "solid_queue" - -module SolidQueueDashboard - class Engine < ::Rails::Engine - isolate_namespace SolidQueueDashboard - end -end diff --git a/lib/solid_queue_dashboard/version.rb b/lib/solid_queue_dashboard/version.rb deleted file mode 100644 index 4839b36..0000000 --- a/lib/solid_queue_dashboard/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module SolidQueueDashboard - VERSION = "0.1.0" -end diff --git a/lib/solid_queue_dashboard.rb b/lib/solid_queue_web.rb similarity index 54% rename from lib/solid_queue_dashboard.rb rename to lib/solid_queue_web.rb index e1d99d6..7e46fc8 100644 --- a/lib/solid_queue_dashboard.rb +++ b/lib/solid_queue_web.rb @@ -1,7 +1,7 @@ -require "solid_queue_dashboard/version" -require "solid_queue_dashboard/engine" +require "solid_queue_web/version" +require "solid_queue_web/engine" -module SolidQueueDashboard +module SolidQueueWeb class << self def authenticate(&block) @authenticate = block if block_given? diff --git a/lib/solid_queue_web/engine.rb b/lib/solid_queue_web/engine.rb new file mode 100644 index 0000000..821738c --- /dev/null +++ b/lib/solid_queue_web/engine.rb @@ -0,0 +1,7 @@ +require "solid_queue" + +module SolidQueueWeb + class Engine < ::Rails::Engine + isolate_namespace SolidQueueWeb + end +end diff --git a/lib/solid_queue_web/version.rb b/lib/solid_queue_web/version.rb new file mode 100644 index 0000000..57e215c --- /dev/null +++ b/lib/solid_queue_web/version.rb @@ -0,0 +1,3 @@ +module SolidQueueWeb + VERSION = "0.1.0" +end diff --git a/lib/tasks/solid_queue_dashboard_tasks.rake b/lib/tasks/solid_queue_web_tasks.rake similarity index 66% rename from lib/tasks/solid_queue_dashboard_tasks.rake rename to lib/tasks/solid_queue_web_tasks.rake index b08b860..3c0fb16 100644 --- a/lib/tasks/solid_queue_dashboard_tasks.rake +++ b/lib/tasks/solid_queue_web_tasks.rake @@ -1,4 +1,4 @@ # desc "Explaining what the task does" -# task :solid_queue_dashboard do +# task :solid_queue_web do # # Task goes here # end diff --git a/solid_queue_dashboard.gemspec b/solid_queue_web.gemspec similarity index 71% rename from solid_queue_dashboard.gemspec rename to solid_queue_web.gemspec index 91f23f1..fb9f4cb 100644 --- a/solid_queue_dashboard.gemspec +++ b/solid_queue_web.gemspec @@ -1,20 +1,20 @@ -require_relative "lib/solid_queue_dashboard/version" +require_relative "lib/solid_queue_web/version" Gem::Specification.new do |spec| - spec.name = "solid_queue_dashboard" - spec.version = SolidQueueDashboard::VERSION + spec.name = "solid_queue_web" + spec.version = SolidQueueWeb::VERSION spec.authors = [ "Chuck Smith" ] spec.email = [ "eclectic-coding@users.noreply.github.com" ] - spec.homepage = "https://github.com/eclectic-coding/solid_queue_dashboard" + spec.homepage = "https://github.com/eclectic-coding/solid_queue_web" spec.summary = "A read-only Rails engine dashboard for monitoring Solid Queue jobs." - spec.description = "Mount SolidQueueDashboard in any Rails app using Solid Queue to get a " \ + spec.description = "Mount SolidQueueWeb in any Rails app using Solid Queue to get a " \ "real-time read-only view of your queues, jobs by status, and failed executions." spec.license = "MIT" spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/eclectic-coding/solid_queue_dashboard" - spec.metadata["changelog_uri"] = "https://github.com/eclectic-coding/solid_queue_dashboard/blob/main/CHANGELOG.md" + spec.metadata["source_code_uri"] = "https://github.com/eclectic-coding/solid_queue_web" + spec.metadata["changelog_uri"] = "https://github.com/eclectic-coding/solid_queue_web/blob/main/CHANGELOG.md" spec.files = Dir.chdir(File.expand_path(__dir__)) do Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb index 7bc237b..3fd35ad 100644 --- a/spec/dummy/config/routes.rb +++ b/spec/dummy/config/routes.rb @@ -1,3 +1,3 @@ Rails.application.routes.draw do - mount SolidQueueDashboard::Engine, at: "/jobs" + mount SolidQueueWeb::Engine, at: "/jobs" end diff --git a/spec/requests/solid_queue_dashboard/dashboard_spec.rb b/spec/requests/solid_queue_web/dashboard_spec.rb similarity index 100% rename from spec/requests/solid_queue_dashboard/dashboard_spec.rb rename to spec/requests/solid_queue_web/dashboard_spec.rb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 603de47..021a4a7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ SimpleCov.start "rails" do add_filter "/spec/" - add_filter "/lib/solid_queue_dashboard/version.rb" + add_filter "/lib/solid_queue_web/version.rb" add_group "Controllers", "app/controllers" add_group "Helpers", "app/helpers"