lib/gloo/verbs/run.rb in gloo-0.3.0 vs lib/gloo/verbs/run.rb in gloo-0.4.0
- old
+ new
@@ -6,17 +6,17 @@
#
module Gloo
module Verbs
class Run < Gloo::Core::Verb
-
- KEYWORD = 'run'
- KEYWORD_SHORT = 'r'
-
- #
+
+ KEYWORD = 'run'.freeze
+ KEYWORD_SHORT = 'r'.freeze
+
+ #
# Run the verb.
- #
+ #
def run
name = @tokens.second
pn = Gloo::Core::Pn.new name
o = pn.resolve
@@ -24,22 +24,53 @@
o.send_message 'run'
else
$log.error "Could not send message to object. Bad path: #{name}"
end
end
-
- #
+
+ #
# Get the Verb's keyword.
- #
+ #
def self.keyword
return KEYWORD
end
- #
+ #
# Get the Verb's keyword shortcut.
- #
+ #
def self.keyword_shortcut
return KEYWORD_SHORT
+ end
+
+ # ---------------------------------------------------------------------
+ # Help
+ # ---------------------------------------------------------------------
+
+ #
+ # Get help for this verb.
+ #
+ def self.help
+ return <<~TEXT
+ RUN VERB
+ NAME: run
+ SHORTCUT: r
+
+ DESCRIPTION
+ Run a script or other object.
+ This is the same as sending a 'run' message to the object.
+
+ SYNTAX
+ run <path.to.object>
+
+ PARAMETERS
+ path.to.object - Reference to the object which will be run.
+
+ RESULT
+ The result depends on the object that is run.
+
+ ERRORS
+ The errors depend on the object that is run.
+ TEXT
end
end
end
end