Class: PuppetDebugger::InputResponders::Types
- Inherits:
-
PuppetDebugger::InputResponderPlugin
- Object
- PuppetDebugger::InputResponderPlugin
- PuppetDebugger::InputResponders::Types
- Defined in:
- lib/plugins/puppet-debugger/input_responders/types.rb
Constant Summary collapse
- COMMAND_WORDS =
%w[types].freeze
- SUMMARY =
'List all the types available in the environment.'
- COMMAND_GROUP =
:environment
Instance Attribute Summary
Attributes inherited from PuppetDebugger::InputResponderPlugin
Instance Method Summary collapse
-
#run(_args = []) ⇒ Object
if a error occurs we we run the types function again.
- #types ⇒ Object
Methods inherited from PuppetDebugger::InputResponderPlugin
command_completion, command_group, command_words, details, execute, #modules_paths, #puppet_debugger_lib_dir, summary
Instance Method Details
#run(_args = []) ⇒ Object
if a error occurs we we run the types function again
13 14 15 |
# File 'lib/plugins/puppet-debugger/input_responders/types.rb', line 13 def run(_args = []) types end |
#types ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/plugins/puppet-debugger/input_responders/types.rb', line 17 def types loaded_types = [] begin # this loads all the types, if already loaded the file is skipped Puppet::Type.loadall Puppet::Type.eachtype do |t| next if t.name == :component loaded_types << t.name.to_s end loaded_types.ai rescue Puppet::Error => e puts e..red Puppet.info(e.) # prevent more than two calls and recursive loop return if caller_locations(1, 10).find_all { |f| f.label == 'types' }.count > 2 types end end |