lib/plugins/puppet-debugger/input_responders/whereami.rb in puppet-debugger-0.19.0 vs lib/plugins/puppet-debugger/input_responders/whereami.rb in puppet-debugger-1.0.0
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
require 'puppet-debugger/input_responder_plugin'
module PuppetDebugger
module InputResponders
class Whereami < InputResponderPlugin
- COMMAND_WORDS = %w(whereami)
+ COMMAND_WORDS = %w[whereami].freeze
SUMMARY = 'Show code surrounding the current context.'
COMMAND_GROUP = :context
# source_file and source_line_num instance variables must be set for this
# method to show the surrounding code
@@ -19,11 +21,11 @@
source_code = Puppet[:code]
code = DebuggerCode.from_string(source_code, :puppet)
else
code = DebuggerCode.from_file(file, :puppet)
end
- return code.with_marker(line_num).around(line_num, num_lines)
- .with_line_numbers.with_indentation(5).with_file_reference.to_s
+ code.with_marker(line_num).around(line_num, num_lines)
+ .with_line_numbers.with_indentation(5).with_file_reference.to_s
end
end
# @return [Integer]
# @param num [String,Integer] number of lines