Skip to content

Commit

Permalink
Merge branch 'main' into bulkrax-embargo-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Shana Moore authored Apr 22, 2024
2 parents 7bab12c + 41e7238 commit 09004a3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/hyrax/transactions/grapher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Transactions
# The purpose of this support class is to generate a tree of transactions and events.
#
# @example
# irb: Hyrax::Transactions::Grapher.call
# $ bundle exec rails runner "pp Hyrax::Transactions::Grapher.call"
# => {"publish" => {
# "class_name" => "Publish",
# "events" => ["on_publish"],
Expand All @@ -15,6 +15,18 @@ module Transactions
# "class_name" => "SendNotice",
# "events" => [],
# "steps" => [] }}}}
# @example
# # In cases where you've customized a container and want to see how it looks.
# $ bundle exec rails runner "pp Hyrax::Transactions::Grapher.call(container: Your::Application::Container)"
# => {"publish" => {
# "class_name" => "Publish",
# "events" => ["on_publish"],
# "steps" => {
# "send_notice" => {
# "class_name" => "SendNotice",
# "events" => [],
# "steps" => [] }}}}

class Grapher
# A best guess at how to find the published events within the source code of the transactions.
REGEXP_FOR_PUBLISH = %r{\.publish[\(\s]?['"]([\w\.]+)['"]}
Expand Down

0 comments on commit 09004a3

Please sign in to comment.