diff --git a/lib/hyrax/transactions/grapher.rb b/lib/hyrax/transactions/grapher.rb index 1d32b1bd7b..c8b2d5737a 100644 --- a/lib/hyrax/transactions/grapher.rb +++ b/lib/hyrax/transactions/grapher.rb @@ -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"], @@ -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\.]+)['"]}