Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 1c5db7c

Browse files
committed
Add ability to emit usage info from modules on load
1 parent cdd6cbe commit 1c5db7c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/cli/modules.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def use(module_path)
2727
mod = context.load_module(module_path)
2828
mod.event_emitter.subscribe(self)
2929
print_good "Loaded module: #{mod}"
30+
mod.emit_usage_info
3031
@context_stack.push(context)
3132
rescue StandardError => e
3233
print_bad "Failed to load module: #{e}"

lib/wpxf/core/module_info.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,10 @@ def module_date
5050
def module_description_preformatted
5151
@info[:desc_preformatted]
5252
end
53+
54+
# Emits any information that the user should be aware of before using the module.
55+
def emit_usage_info
56+
nil
57+
end
5358
end
5459
end

0 commit comments

Comments
 (0)