tramway 4.0.2 → 4.1

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -0
  3. data/app/assets/javascripts/tramway/tramway.js +58 -2
  4. data/app/controllers/tramway/plugins/solid_queue/application_controller.rb +28 -0
  5. data/app/controllers/tramway/plugins/solid_queue/jobs_controller.rb +82 -0
  6. data/app/controllers/tramway/plugins/solid_queue/queues_controller.rb +38 -0
  7. data/app/controllers/tramway/plugins/solid_queue/recurring_tasks_controller.rb +26 -0
  8. data/app/helpers/tramway/plugins/solid_queue/jobs_helper.rb +27 -0
  9. data/app/helpers/tramway/plugins/solid_queue/queues_helper.rb +27 -0
  10. data/app/jobs/tramway/solid_queue/application_job.rb +14 -0
  11. data/app/jobs/tramway/solid_queue/bulk_destroy_job.rb +13 -0
  12. data/app/jobs/tramway/solid_queue/bulk_discard_job.rb +13 -0
  13. data/app/jobs/tramway/solid_queue/bulk_retry_job.rb +13 -0
  14. data/app/jobs/tramway/solid_queue/destroy_all_job.rb +13 -0
  15. data/app/models/tramway/solid_queue/jobs_filter.rb +53 -0
  16. data/app/views/tramway/plugins/solid_queue/_subnav.html.haml +7 -0
  17. data/app/views/tramway/plugins/solid_queue/jobs/index.html.haml +89 -0
  18. data/app/views/tramway/plugins/solid_queue/jobs/show.html.haml +90 -0
  19. data/app/views/tramway/plugins/solid_queue/queues/index.html.haml +46 -0
  20. data/app/views/tramway/plugins/solid_queue/recurring_tasks/index.html.haml +33 -0
  21. data/config/locales/en.yml +62 -0
  22. data/config/routes.rb +10 -0
  23. data/config/tailwind.config.js +1 -0
  24. data/lib/generators/tramway/install/install_generator.rb +12 -0
  25. data/lib/generators/tramway/install/solid_queue_helpers.rb +54 -0
  26. data/lib/tramway/config.rb +7 -1
  27. data/lib/tramway/configs/plugins.rb +66 -0
  28. data/lib/tramway/errors.rb +36 -0
  29. data/lib/tramway/navbar.rb +23 -0
  30. data/lib/tramway/plugins/base.rb +33 -0
  31. data/lib/tramway/plugins/solid_queue/config.rb +13 -0
  32. data/lib/tramway/plugins/solid_queue/plugin.rb +37 -0
  33. data/lib/tramway/plugins/solid_queue/routes.rb +50 -0
  34. data/lib/tramway/plugins/solid_queue.rb +7 -0
  35. data/lib/tramway/plugins.rb +37 -0
  36. data/lib/tramway/version.rb +1 -1
  37. metadata +26 -1
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/plugins/solid_queue/config'
4
+ require 'tramway/plugins/solid_queue/routes'
5
+ require 'tramway/plugins/solid_queue/plugin'
6
+
7
+ Tramway::Plugins.register(Tramway::Plugins::SolidQueue::Plugin)
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/errors'
4
+ require 'tramway/plugins/base'
5
+
6
+ module Tramway
7
+ # Registry for Tramway plugins. A plugin is a class implementing the
8
+ # `Tramway::Plugins::Base` interface, registered via `Tramway::Plugins.register`,
9
+ # and referenced by name from `Tramway.config.plugins`.
10
+ module Plugins
11
+ module_function
12
+
13
+ def registry
14
+ @registry ||= {}
15
+ end
16
+
17
+ def register(plugin_class)
18
+ registry[plugin_class.plugin_name.to_sym] = plugin_class
19
+ end
20
+
21
+ def registered?(name)
22
+ registry.key?(name.to_sym)
23
+ end
24
+
25
+ def fetch(name)
26
+ registry.fetch(name.to_sym) do
27
+ raise Tramway::Errors::UnknownPluginError.new(name:, available: registry.keys)
28
+ end
29
+ end
30
+
31
+ def each(&)
32
+ registry.each(&)
33
+ end
34
+ end
35
+ end
36
+
37
+ require 'tramway/plugins/solid_queue'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '4.0.2'
4
+ VERSION = '4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: '4.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme
@@ -279,7 +279,19 @@ files:
279
279
  - app/components/tramway/tooltip_component.html.haml
280
280
  - app/components/tramway/tooltip_component.rb
281
281
  - app/controllers/tramway/entities_controller.rb
282
+ - app/controllers/tramway/plugins/solid_queue/application_controller.rb
283
+ - app/controllers/tramway/plugins/solid_queue/jobs_controller.rb
284
+ - app/controllers/tramway/plugins/solid_queue/queues_controller.rb
285
+ - app/controllers/tramway/plugins/solid_queue/recurring_tasks_controller.rb
282
286
  - app/helpers/tramway/application_helper.rb
287
+ - app/helpers/tramway/plugins/solid_queue/jobs_helper.rb
288
+ - app/helpers/tramway/plugins/solid_queue/queues_helper.rb
289
+ - app/jobs/tramway/solid_queue/application_job.rb
290
+ - app/jobs/tramway/solid_queue/bulk_destroy_job.rb
291
+ - app/jobs/tramway/solid_queue/bulk_discard_job.rb
292
+ - app/jobs/tramway/solid_queue/bulk_retry_job.rb
293
+ - app/jobs/tramway/solid_queue/destroy_all_job.rb
294
+ - app/models/tramway/solid_queue/jobs_filter.rb
283
295
  - app/views/kaminari/_first_page.html.haml
284
296
  - app/views/kaminari/_gap.html.haml
285
297
  - app/views/kaminari/_last_page.html.haml
@@ -297,6 +309,11 @@ files:
297
309
  - app/views/tramway/entities/new.html.haml
298
310
  - app/views/tramway/entities/show.html.haml
299
311
  - app/views/tramway/layouts/application.html.haml
312
+ - app/views/tramway/plugins/solid_queue/_subnav.html.haml
313
+ - app/views/tramway/plugins/solid_queue/jobs/index.html.haml
314
+ - app/views/tramway/plugins/solid_queue/jobs/show.html.haml
315
+ - app/views/tramway/plugins/solid_queue/queues/index.html.haml
316
+ - app/views/tramway/plugins/solid_queue/recurring_tasks/index.html.haml
300
317
  - config/locales/en.yml
301
318
  - config/routes.rb
302
319
  - config/tailwind.config.js
@@ -304,6 +321,7 @@ files:
304
321
  - lib/generators/tramway/install/font_awesome_helpers.rb
305
322
  - lib/generators/tramway/install/install_generator.rb
306
323
  - lib/generators/tramway/install/layout_helpers.rb
324
+ - lib/generators/tramway/install/solid_queue_helpers.rb
307
325
  - lib/kaminari/helpers/tag.rb
308
326
  - lib/rules/turbo_html_attributes_rules.rb
309
327
  - lib/tasks/tramway_tasks.rake
@@ -315,6 +333,7 @@ files:
315
333
  - lib/tramway/configs/entities/page.rb
316
334
  - lib/tramway/configs/entities/route.rb
317
335
  - lib/tramway/configs/entity.rb
336
+ - lib/tramway/configs/plugins.rb
318
337
  - lib/tramway/decorators/association.rb
319
338
  - lib/tramway/decorators/class_helper.rb
320
339
  - lib/tramway/decorators/collection_decorator.rb
@@ -338,6 +357,12 @@ files:
338
357
  - lib/tramway/helpers/views_helper.rb
339
358
  - lib/tramway/navbar.rb
340
359
  - lib/tramway/pg_searchable.rb
360
+ - lib/tramway/plugins.rb
361
+ - lib/tramway/plugins/base.rb
362
+ - lib/tramway/plugins/solid_queue.rb
363
+ - lib/tramway/plugins/solid_queue/config.rb
364
+ - lib/tramway/plugins/solid_queue/plugin.rb
365
+ - lib/tramway/plugins/solid_queue/routes.rb
341
366
  - lib/tramway/searchable.rb
342
367
  - lib/tramway/utils/field.rb
343
368
  - lib/tramway/utils/render.rb