Sha256: 7e37da2bfe95ccf51458fa60f006df378ed8d255d942a255c3b6dfa865f62a80

Contents?: true

Size: 720 Bytes

Versions: 5

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require 'puppet-debugger/input_responder_plugin'
module PuppetDebugger
  module InputResponders
    class Classes < InputResponderPlugin
      COMMAND_WORDS = %w[classes].freeze
      SUMMARY = 'List all the classes current in the catalog.'
      COMMAND_GROUP = :scope

      def run(args = [])
        filter = args
        classes = find_classes(debugger.catalog.classes, filter)
        classes.ai
      end

      def find_classes(classes, filter = [])
        return classes if filter.nil? || filter.empty?

        filter_string = filter.join(' ').downcase
        classes.find_all do |klass|
          klass.downcase.include?(filter_string)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-debugger-1.4.0 lib/plugins/puppet-debugger/input_responders/classes.rb
puppet-debugger-1.3.0 lib/plugins/puppet-debugger/input_responders/classes.rb
puppet-debugger-1.2.0 lib/plugins/puppet-debugger/input_responders/classes.rb
puppet-debugger-1.1.0 lib/plugins/puppet-debugger/input_responders/classes.rb
puppet-debugger-1.0.0 lib/plugins/puppet-debugger/input_responders/classes.rb