Class: Smith::Commands::Agents
- Inherits:
-
Smith::CommandBase
- Object
- Smith::CommandBase
- Smith::Commands::Agents
- Includes:
- Common
- Defined in:
- lib/smith/commands/agency/agents.rb
Instance Attribute Summary
Attributes inherited from Smith::CommandBase
Instance Method Summary collapse
-
#_agents ⇒ Object
Return the fully qualified class of all avaiable agents.
- #execute ⇒ Object
Methods included from Common
Methods inherited from Smith::CommandBase
#banner, #format_help, #initialize, #parse_options
Methods included from Logger
Constructor Details
This class inherits a constructor from Smith::CommandBase
Instance Method Details
#_agents ⇒ Object
Return the fully qualified class of all avaiable agents
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smith/commands/agency/agents.rb', line 14 def _agents separator = ([:one_column]) ? "\n" : " " if [:group] agent_group([:group]).sort.join(separator) else Smith.agent_directories.each_with_object([]) do |agent_root_path, acc| Pathname.glob(agent_root_path.join("**/*")).each do |agent_path| if !agent_path.symlink? && !agent_path.directory? acc << Utils.class_name_from_path(agent_path, agent_root_path) end end end.sort.join(separator) end end |
#execute ⇒ Object
9 10 11 |
# File 'lib/smith/commands/agency/agents.rb', line 9 def execute responder.succeed(_agents) end |