lib/byebug/helpers/thread.rb in byebug-9.1.0 vs lib/byebug/helpers/thread.rb in byebug-10.0.0

- old
+ new

@@ -1,13 +1,15 @@ +# frozen_string_literal: true + module Byebug module Helpers # # Utilities for thread subcommands # module ThreadHelper def display_context(ctx) - puts pr('thread.context', thread_arguments(ctx)) + puts pr("thread.context", thread_arguments(ctx)) end def thread_arguments(ctx) { status_flag: status_flag(ctx), @@ -27,15 +29,15 @@ def context_from_thread(thnum) ctx = Byebug.contexts.find { |c| c.thnum.to_s == thnum } err = if ctx.nil? - pr('thread.errors.no_thread') + pr("thread.errors.no_thread") elsif ctx == context - pr('thread.errors.current_thread') + pr("thread.errors.current_thread") elsif ctx.ignored? - pr('thread.errors.ignored', arg: thnum) + pr("thread.errors.ignored", arg: thnum) end [ctx, err] end @@ -44,22 +46,22 @@ # @todo Check whether it is Byebug.current_context or context def location(ctx) return context.location if ctx == Byebug.current_context backtrace = ctx.thread.backtrace_locations - return '' unless backtrace && backtrace[0] + return "" unless backtrace && backtrace[0] "#{backtrace[0].path}:#{backtrace[0].lineno}" end def status_flag(ctx) - return '$' if ctx.suspended? + return "$" if ctx.suspended? - current_thread?(ctx) ? '+' : ' ' + current_thread?(ctx) ? "+" : " " end def debug_flag(ctx) - ctx.ignored? ? '!' : ' ' + ctx.ignored? ? "!" : " " end end end end