lib/byebug/commands/var/const.rb in byebug-9.1.0 vs lib/byebug/commands/var/const.rb in byebug-10.0.0
- old
+ new
@@ -1,7 +1,9 @@
-require 'byebug/helpers/eval'
+# frozen_string_literal: true
+require "byebug/helpers/eval"
+
module Byebug
#
# Reopens the +var+ command to define the +const+ subcommand
#
class VarCommand < Command
@@ -16,34 +18,34 @@
def self.regexp
/^\s* c(?:onst)? (?:\s+ (.+))? \s*$/x
end
def self.description
- <<-EOD
+ <<-DESCRIPTION
v[ar] c[onstant]
#{short_description}
- EOD
+ DESCRIPTION
end
def self.short_description
- 'Shows constants of an object.'
+ "Shows constants of an object."
end
def execute
obj = warning_eval(str_obj)
unless obj.is_a?(Module)
- return errmsg(pr('variable.errors.not_module', object: str_obj))
+ return errmsg(pr("variable.errors.not_module", object: str_obj))
end
constants = warning_eval("#{str_obj}.constants")
- puts prv(constants.sort.map { |c| [c, obj.const_get(c)] }, 'constant')
+ puts prv(constants.sort.map { |c| [c, obj.const_get(c)] }, "constant")
end
private
def str_obj
- @str_obj ||= @match[1] || 'self.class'
+ @str_obj ||= @match[1] || "self.class"
end
end
end
end