Sha256: 5b3e8b6aca1b82d6e62260a70a0ef31a5d25c0ec96e6ee88acfe0f7265ac940d

Contents?: true

Size: 708 Bytes

Versions: 10

Compression:

Stored size: 708 Bytes

Contents

require 'puppet-debugger/input_responder_plugin'
module PuppetDebugger
  module InputResponders
    class Vars < InputResponderPlugin
      COMMAND_WORDS = %w(vars ls)
      SUMMARY = 'List all the variables in the current scopes.'
      COMMAND_GROUP = :scope

      def run(args = [])
        # remove duplicate variables that are also in the facts hash
        variables = debugger.scope.to_hash.delete_if { |key, _value| debugger.node.facts.values.key?(key) }
        variables['facts'] = 'removed by the puppet-debugger' if variables.key?('facts')
        output = 'Facts were removed for easier viewing'.ai + "\n"
        output += variables.ai(sort_keys: true, indent: -1)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
puppet-debugger-0.11.0 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.10.3 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.10.2 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.10.1 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.10.0 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.9.1 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.9.0 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.8.1 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.8.0 lib/plugins/puppet-debugger/input_responders/vars.rb
puppet-debugger-0.7.0 lib/plugins/puppet-debugger/input_responders/vars.rb