mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Merge pull request #2034 from pry/1824-frozen-string-literal
Fix offences of the Style/FrozenStringLiteralComment cop
This commit is contained in:
commit
c123bce661
221 changed files with 522 additions and 72 deletions
|
@ -71,3 +71,9 @@ Gemspec/RequiredRubyVersion:
|
|||
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: true
|
||||
EnforcedStyle: always
|
||||
Exclude:
|
||||
- 'spec/fixtures/example_nesting.rb'
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
gemspec
|
||||
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rake/clean'
|
||||
require 'rubygems/package_task'
|
||||
|
||||
|
|
2
bin/pry
2
bin/pry
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
$0 = 'pry'
|
||||
|
||||
require 'pry'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'pry/version'
|
||||
require 'pry/last_exception'
|
||||
require 'pry/forwardable'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class BasicObject < BasicObject
|
||||
[:Kernel, :File, :Dir, :LoadError, :ENV, :Pry].each do |constant|
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# A super-class for Commands that are created with a single block.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# A super-class of Commands with structure.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'stringio'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'method_source'
|
||||
|
||||
class Pry
|
||||
|
@ -254,12 +256,12 @@ class Pry
|
|||
# @return [String] a formatted representation (based on the configuration of
|
||||
# the object).
|
||||
def to_s
|
||||
print_to_output("", false)
|
||||
print_to_output(''.dup, false)
|
||||
end
|
||||
|
||||
# @return [String] a (possibly highlighted) copy of the source code.
|
||||
def highlighted
|
||||
print_to_output("", true)
|
||||
print_to_output(''.dup, true)
|
||||
end
|
||||
|
||||
# Writes a formatted representation (based on the configuration of the
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'method_source'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Code
|
||||
# Represents a range of lines in a code listing.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Code
|
||||
# Represents a line of code (which may, in fact, contain multiple lines if
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# This class is responsible for taking a string (identifying a
|
||||
# command/class/method/etc) and returning the relevant type of object.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'pp'
|
||||
require 'English'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'delegate'
|
||||
require 'shellwords'
|
||||
|
||||
|
@ -352,7 +354,7 @@ class Pry
|
|||
# @param [String] val The line of input
|
||||
# @return [Array]
|
||||
def tokenize(val)
|
||||
val.replace(interpolate_string(val)) if command_options[:interpolate]
|
||||
val = interpolate_string(val) if command_options[:interpolate]
|
||||
|
||||
self.class.command_regex =~ val
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class NoCommandError < StandardError
|
||||
def initialize(match, owner)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'ostruct'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class AmendLine < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Bang < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class BangPry < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cat < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cat
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cat
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cat
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cat
|
||||
|
@ -14,10 +16,10 @@ class Pry
|
|||
raise CommandError, "No input expressions!" if numbered_input_items.empty?
|
||||
|
||||
if numbered_input_items.length > 1
|
||||
content = ""
|
||||
content = ''
|
||||
numbered_input_items.each do |i, s|
|
||||
content << "#{Helpers::Text.bold(i.to_s)}:\n"
|
||||
content << decorate(Pry::Code(s).with_indentation(2)).to_s
|
||||
content += "#{Helpers::Text.bold(i.to_s)}:\n"
|
||||
content += decorate(Pry::Code(s).with_indentation(2)).to_s
|
||||
end
|
||||
|
||||
content
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Cd < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ChangeInspector < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ChangePrompt < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ClearScreen < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class CodeCollector
|
||||
|
@ -142,7 +144,7 @@ class Pry
|
|||
end
|
||||
|
||||
ranged_array = Array(array[range]) || []
|
||||
ranged_array.compact.each { |v| all << yield(v) }
|
||||
ranged_array.compact.each { |v| all += yield(v) }
|
||||
end
|
||||
|
||||
all
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class DisablePry < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
Pry::Commands.instance_eval do
|
||||
command(%r{!s/(.*?)/(.*?)}, "") do |source, dest|
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Edit < Pry::ClassCommand
|
||||
|
@ -69,9 +71,7 @@ class Pry
|
|||
initial_temp_file_content,
|
||||
initial_temp_file_content.lines.count
|
||||
)
|
||||
silence_warnings do
|
||||
eval_string.replace content
|
||||
end
|
||||
pry_instance.eval_string = content
|
||||
Pry.history.push(content)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Edit
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Edit
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Exit < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ExitAll < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ExitProgram < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class FindMethod < Pry::ClassCommand
|
||||
|
@ -97,7 +99,7 @@ class Pry
|
|||
# if `-c` was not given
|
||||
def additional_info(header, method)
|
||||
if opts.content?
|
||||
": " << colorize_code(matched_method_lines(header, method))
|
||||
': ' + colorize_code(matched_method_lines(header, method))
|
||||
else
|
||||
""
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class FixIndent < Pry::ClassCommand
|
||||
|
@ -12,7 +14,7 @@ class Pry
|
|||
|
||||
def process
|
||||
indented_str = Pry::Indent.indent(eval_string)
|
||||
eval_string.replace indented_str
|
||||
pry_instance.eval_string = indented_str
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Help < Pry::ClassCommand
|
||||
|
@ -58,7 +60,7 @@ class Pry
|
|||
# @param [Array<Pry::Command>] commands
|
||||
# @return [String] The generated help string.
|
||||
def help_text_for_commands(name, commands)
|
||||
"#{bold(name.capitalize)}\n" << commands.map do |command|
|
||||
"#{bold(name.capitalize)}\n" + commands.map do |command|
|
||||
" #{command.options[:listing].to_s.ljust(18)} " \
|
||||
"#{command.description.capitalize}"
|
||||
end.join("\n")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Hist < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ImportSet < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class JumpTo < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ListInspectors < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
@ -33,7 +35,7 @@ class Pry
|
|||
end
|
||||
|
||||
def format_value(value)
|
||||
Pry::ColorPrinter.pp(value, '')
|
||||
Pry::ColorPrinter.pp(value, ''.dup)
|
||||
end
|
||||
|
||||
def correct_opts?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Ls < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Nesting < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Play < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class PryBacktrace < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Version < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# N.B. using a regular expresion here so that "raise-up 'foo'" does the right thing.
|
||||
class Command
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ReloadCode < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Reset < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'stringio'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class SaveFile < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShellCommand < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShellMode < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShowDoc < Command::ShowInfo
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShowInfo < Pry::ClassCommand
|
||||
|
@ -73,7 +75,7 @@ class Pry
|
|||
end
|
||||
|
||||
def content_and_header_for_code_object(code_object)
|
||||
header(code_object) << content_for(code_object)
|
||||
header(code_object) + content_for(code_object)
|
||||
end
|
||||
|
||||
def content_and_headers_for_all_module_candidates(mod)
|
||||
|
@ -82,13 +84,13 @@ class Pry
|
|||
mod.number_of_candidates.times do |v|
|
||||
candidate = mod.candidate(v)
|
||||
begin
|
||||
result << "\nCandidate #{v + 1}/#{mod.number_of_candidates}: " \
|
||||
result += "\nCandidate #{v + 1}/#{mod.number_of_candidates}: " \
|
||||
"#{candidate.source_file}:#{candidate.source_line}\n"
|
||||
content = content_for(candidate)
|
||||
|
||||
result << "Number of lines: #{content.lines.count}\n\n" << content
|
||||
result += "Number of lines: #{content.lines.count}\n\n" + content
|
||||
rescue Pry::RescuableException
|
||||
result << "\nNo content found.\n"
|
||||
result += "\nNo content found.\n"
|
||||
next
|
||||
end
|
||||
end
|
||||
|
@ -106,17 +108,17 @@ class Pry
|
|||
content = content_for(code_object)
|
||||
|
||||
h = "\n#{bold('From:')} #{file_name}"
|
||||
h << code_object_header(code_object, line_num)
|
||||
h << "\n#{bold('Number of lines:')} " << "#{content.lines.count}\n\n"
|
||||
h += code_object_header(code_object, line_num)
|
||||
h += "\n#{bold('Number of lines:')} " + "#{content.lines.count}\n\n"
|
||||
if @used_super
|
||||
h << bold('** Warning:')
|
||||
h << " Cannot find code for #{@original_code_object.nonblank_name}. " \
|
||||
h += bold('** Warning:')
|
||||
h += " Cannot find code for #{@original_code_object.nonblank_name}. " \
|
||||
"Showing superclass #{code_object.nonblank_name} instead. **\n\n"
|
||||
end
|
||||
|
||||
if content.lines.none?
|
||||
h << bold('** Warning:')
|
||||
h << " Cannot find code for '#{code_object.name}' (source_location is nil)"
|
||||
h += bold('** Warning:')
|
||||
h += " Cannot find code for '#{code_object.name}' (source_location is nil)"
|
||||
end
|
||||
|
||||
h
|
||||
|
@ -139,23 +141,23 @@ class Pry
|
|||
|
||||
def method_header(code_object, line_num)
|
||||
h = ""
|
||||
h << (code_object.c_method? ? ' (C Method):' : ":#{line_num}:")
|
||||
h << method_sections(code_object)[:owner]
|
||||
h << method_sections(code_object)[:visibility]
|
||||
h << method_sections(code_object)[:signature]
|
||||
h += (code_object.c_method? ? ' (C Method):' : ":#{line_num}:")
|
||||
h += method_sections(code_object)[:owner]
|
||||
h += method_sections(code_object)[:visibility]
|
||||
h += method_sections(code_object)[:signature]
|
||||
h
|
||||
end
|
||||
|
||||
def module_header(code_object, line_num)
|
||||
h = ""
|
||||
h << ":#{line_num}\n"
|
||||
h << bold(code_object.module? ? "Module" : "Class")
|
||||
h << " #{bold('name:')} #{code_object.nonblank_name}"
|
||||
h += ":#{line_num}\n"
|
||||
h += bold(code_object.module? ? "Module" : "Class")
|
||||
h += " #{bold('name:')} #{code_object.nonblank_name}"
|
||||
|
||||
if code_object.number_of_candidates > 1
|
||||
h << bold("\nNumber of monkeypatches: ")
|
||||
h << code_object.number_of_candidates.to_s
|
||||
h << ". Use the `-a` option to display all available monkeypatches"
|
||||
h += bold("\nNumber of monkeypatches: ")
|
||||
h += code_object.number_of_candidates.to_s
|
||||
h += ". Use the `-a` option to display all available monkeypatches"
|
||||
end
|
||||
h
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShowInput < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ShowSource < Command::ShowInfo
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Stat < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class SwitchTo < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class ToggleColor < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class WatchExpression < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class WatchExpression
|
||||
|
@ -12,7 +14,7 @@ class Pry
|
|||
|
||||
def eval!
|
||||
@previous_value = value
|
||||
@value = Pry::ColorPrinter.pp(target_eval(target, source), "")
|
||||
@value = Pry::ColorPrinter.pp(target_eval(target, source), ''.dup)
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'method_source'
|
||||
|
||||
class Pry
|
||||
|
@ -105,7 +107,7 @@ class Pry
|
|||
.with_marker(marker)
|
||||
.highlighted
|
||||
pry_instance.pager.page(
|
||||
"\n#{bold('From:')} #{location}:\n\n" << pretty_code << "\n"
|
||||
"\n#{bold('From:')} #{location}:\n\n" + pretty_code + "\n"
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Command
|
||||
class Wtf < Pry::ClassCommand
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'ostruct'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Config
|
||||
# Attributable provides the ability to create "attribute"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Config
|
||||
# LazyValue is a Proc (block) wrapper. It is meant to be used as a
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Config
|
||||
# MemoizedValue is a Proc (block) wrapper. It is meant to be used as a
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
class Config
|
||||
# Value holds a value for the given attribute and decides how it should
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# @api private
|
||||
# @since ?.?.?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# @return [Array] Code of the method used when implementing Pry's
|
||||
# __binding__, along with line indication to be used with instance_eval (and
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'shellwords'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# @api private
|
||||
# @since ?.?.?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
# As a REPL, we often want to catch any unexpected exceptions that may have
|
||||
# been raised; however we don't want to go overboard and prevent the user
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
module Forwardable
|
||||
require 'forwardable'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "pry/helpers/base_helpers"
|
||||
require "pry/helpers/options_helpers"
|
||||
require "pry/helpers/command_helpers"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
module Helpers
|
||||
module BaseHelpers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'tempfile'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
module Helpers
|
||||
# This class contains methods useful for extracting
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
module Helpers
|
||||
module OptionsHelpers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rbconfig'
|
||||
|
||||
class Pry
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pry
|
||||
module Helpers
|
||||
def self.tablify_or_one_line(heading, things, config = Pry.config)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue