Sha256: fb6806fd47c465e5cc9a930a78388d0bba52c38a98a21ea0f41206265edcf9c1

Contents?: true

Size: 674 Bytes

Versions: 21

Compression:

Stored size: 674 Bytes

Contents

require 'puppet-debugger/input_responder_plugin'
module PuppetDebugger
  module InputResponders
    class Resources < InputResponderPlugin
      COMMAND_WORDS = %w(resources)
      SUMMARY = 'List all the resources current in the catalog.'
      COMMAND_GROUP = :scope

      def run(args = [])
        res = debugger.scope.compiler.catalog.resources.map do |res|
          res.to_s.gsub(/\[/, "['").gsub(/\]/, "']") # ensure the title has quotes
        end
        if !args.first.nil?
          res[args.first.to_i].ai
        else
          output = "Resources not shown in any specific order\n".warning
          output += res.ai
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
puppet-debugger-0.17.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.16.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.15.2 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.15.1 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.15.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.14.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.13.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.12.3 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.12.2 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.12.1 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.12.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.11.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.10.3 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.10.2 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.10.1 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.10.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.9.1 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.9.0 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.8.1 lib/plugins/puppet-debugger/input_responders/resources.rb
puppet-debugger-0.8.0 lib/plugins/puppet-debugger/input_responders/resources.rb