From 489558b09badc5afa60cf472fb8154eb6f59146a Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sat, 24 Feb 2024 23:11:51 +0800 Subject: [PATCH] Fix typos Found via `codespell -L jist,uper,halp,cant,aadd,aas` and `typos --hidden --format brief` --- CHANGELOG.md | 2 +- lib/pry/class_command.rb | 4 ++-- lib/pry/code_object.rb | 4 ++-- lib/pry/command_set.rb | 4 ++-- lib/pry/commands/amend_line.rb | 2 +- lib/pry/commands/raise_up.rb | 2 +- lib/pry/commands/ri.rb | 2 +- lib/pry/commands/watch_expression/expression.rb | 2 +- lib/pry/helpers/command_helpers.rb | 2 +- lib/pry/input_completer.rb | 2 +- lib/pry/method/patcher.rb | 4 ++-- lib/pry/method/weird_method_locator.rb | 2 +- lib/pry/pry_class.rb | 2 +- lib/pry/pry_instance.rb | 4 ++-- lib/pry/ring.rb | 2 +- lib/pry/slop.rb | 2 +- lib/pry/wrapped_module.rb | 2 +- spec/class_command_spec.rb | 2 +- spec/code_spec.rb | 4 ++-- spec/command_set_spec.rb | 6 +++--- spec/commands/exit_all_spec.rb | 2 +- spec/commands/hist_spec.rb | 2 +- spec/commands/raise_up_spec.rb | 2 +- spec/commands/reload_code_spec.rb | 2 +- spec/commands/save_file_spec.rb | 4 ++-- spec/commands/watch_expression_spec.rb | 2 +- spec/method_spec.rb | 8 ++++---- spec/syntax_checking_spec.rb | 8 ++++---- 28 files changed, 43 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ac0f988..6c57d0dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -977,7 +977,7 @@ complete CHANGELOG: * _pry_ now passed as 3rd parameter to :before_session hook * ls colors now configurable via Pry.config.ls.local_var_color = :bright_red etc * ls separator configurable via, e.g Pry.config.ls.separator = " " -* Pry.view_clip() now only calls inspect on a few immediates, otherwise uses the #<> syntax, which has been truncated further to exclude teh mem address, again related to #245 +* Pry.view_clip() now only calls inspect on a few immediates, otherwise uses the #<> syntax, which has been truncated further to exclude the mem address, again related to #245 ### 0.9.3 (2011/7/27) * cat --ex (cats 5 lines above and below line in file where exception was raised) diff --git a/lib/pry/class_command.rb b/lib/pry/class_command.rb index d8a4c6fc2..dc369e9d4 100644 --- a/lib/pry/class_command.rb +++ b/lib/pry/class_command.rb @@ -137,7 +137,7 @@ def setup; end # end # end # - # @example Define the invokation block anywhere you want + # @example Define the invocation block anywhere you want # def subcommands(cmd) # cmd.command :download do |opt| # description 'Downloads a content from a server' @@ -172,7 +172,7 @@ def options(opt); end # The actual body of your command should go here. # - # The `opts` mehod can be called to get the options that Pry::Slop has passed, + # The `opts` method can be called to get the options that Pry::Slop has passed, # and `args` gives the remaining, unparsed arguments. # # The return value of this method is discarded unless the command was diff --git a/lib/pry/code_object.rb b/lib/pry/code_object.rb index 931e28d6d..658ba5577 100644 --- a/lib/pry/code_object.rb +++ b/lib/pry/code_object.rb @@ -11,7 +11,7 @@ class Pry # object the user wants (applying precedence rules in doing so -- i.e methods # get precedence over commands with the same name) and 2. Returning # the appropriate object. If the user fails to provide a string - # identifer for the object (i.e they pass in `nil` or "") then the + # identifier for the object (i.e they pass in `nil` or "") then the # object looked up will be the 'current method' or 'current class' # associated with the Binding. # @@ -97,7 +97,7 @@ def command_lookup nil end - # when no paramter is given (i.e CodeObject.lookup(nil)), then we + # when no parameter is given (i.e CodeObject.lookup(nil)), then we # lookup the 'current object' from the binding. def empty_lookup return nil if str && !str.empty? diff --git a/lib/pry/command_set.rb b/lib/pry/command_set.rb index 339e6424b..f02eff22e 100644 --- a/lib/pry/command_set.rb +++ b/lib/pry/command_set.rb @@ -145,7 +145,7 @@ def delete(*searches) # Imports all the commands from one or more sets. # @param [Array] sets Command sets, all of the commands of which # will be imported. - # @return [Pry::CommandSet] Returns the reciever (a command set). + # @return [Pry::CommandSet] Returns the receiver (a command set). def import(*sets) sets.each do |set| @commands.merge! set.to_hash @@ -157,7 +157,7 @@ def import(*sets) # Imports some commands from a set # @param [CommandSet] set Set to import commands from # @param [Array] matches Commands to import - # @return [Pry::CommandSet] Returns the reciever (a command set). + # @return [Pry::CommandSet] Returns the receiver (a command set). def import_from(set, *matches) helper_module.send :include, set.helper_module matches.each do |match| diff --git a/lib/pry/commands/amend_line.rb b/lib/pry/commands/amend_line.rb index 002d47133..677911b64 100644 --- a/lib/pry/commands/amend_line.rb +++ b/lib/pry/commands/amend_line.rb @@ -76,7 +76,7 @@ def start_and_end_line_number # Takes two numbers that are 1-indexed, and returns a range (or # number) that is 0-indexed. 1-indexed means the first element is - # indentified by 1 rather than by 0 (as is the case for Ruby arrays). + # identified by 1 rather than by 0 (as is the case for Ruby arrays). # @param [Fixnum] start_line_number One-indexed number. # @param [Fixnum] end_line_number One-indexed number. # @return [Range] The zero-indexed range. diff --git a/lib/pry/commands/raise_up.rb b/lib/pry/commands/raise_up.rb index f002636e1..2c29de2eb 100644 --- a/lib/pry/commands/raise_up.rb +++ b/lib/pry/commands/raise_up.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Pry - # N.B. using a regular expresion here so that "raise-up 'foo'" does the right thing. + # N.B. using a regular expression here so that "raise-up 'foo'" does the right thing. class Command class RaiseUp < Pry::ClassCommand match(/raise-up(!?\b.*)/) diff --git a/lib/pry/commands/ri.rb b/lib/pry/commands/ri.rb index b9cb59075..2ad991a3e 100644 --- a/lib/pry/commands/ri.rb +++ b/lib/pry/commands/ri.rb @@ -57,7 +57,7 @@ def formatter(_io) RDoc::RI.const_set :PryDriver, subclass # hook it up! end - # Spin-up an RI insance. + # Spin-up an RI instance. ri = RDoc::RI::PryDriver.new( pry_instance.pager, use_stdout: true, interactive: false ) diff --git a/lib/pry/commands/watch_expression/expression.rb b/lib/pry/commands/watch_expression/expression.rb index 2214b8754..e512e061a 100644 --- a/lib/pry/commands/watch_expression/expression.rb +++ b/lib/pry/commands/watch_expression/expression.rb @@ -23,7 +23,7 @@ def to_s # Has the value of the expression changed? # - # We use the pretty-printed string represenation to detect differences + # We use the pretty-printed string representation to detect differences # as this avoids problems with dup (causes too many differences) and == # (causes too few) def changed? diff --git a/lib/pry/helpers/command_helpers.rb b/lib/pry/helpers/command_helpers.rb index 374f6b20a..b58c93c75 100644 --- a/lib/pry/helpers/command_helpers.rb +++ b/lib/pry/helpers/command_helpers.rb @@ -70,7 +70,7 @@ def unindent(dirty_text, left_padding = 0) # Find the longest common whitespace to all indented lines. Ignore lines # containing just -- or ++ as these seem to be used by comment authors - # as delimeters. + # as delimiters. scanned_text = text.scan(/^[ \t]*(?!--\n|\+\+\n)(?=[^ \t\n])/) margin = scanned_text.inject do |current_margin, next_indent| if next_indent.start_with?(current_margin) diff --git a/lib/pry/input_completer.rb b/lib/pry/input_completer.rb index 3059d4b67..572f77e90 100644 --- a/lib/pry/input_completer.rb +++ b/lib/pry/input_completer.rb @@ -234,7 +234,7 @@ def select_message(path, receiver, message, candidates) end.compact end - # build_path seperates the input into two parts: path and input. + # build_path separates the input into two parts: path and input. # input is the partial string that should be completed # path is a proc that takes an input and builds a full path. def build_path(input) diff --git a/lib/pry/method/patcher.rb b/lib/pry/method/patcher.rb index 656039d04..0ec80b984 100644 --- a/lib/pry/method/patcher.rb +++ b/lib/pry/method/patcher.rb @@ -43,7 +43,7 @@ def cache_key # # When we're redefining aliased methods we will overwrite the method at the # unaliased name (so that super continues to work). By wrapping that code in a - # transation we make that not happen, which means that alias_method_chains, etc. + # translation we make that not happen, which means that alias_method_chains, etc. # continue to work. # def with_method_transaction @@ -95,7 +95,7 @@ def wrap(source) # Update the source code so that when it has the right owner when eval'd. # # This (combined with definition_for_owner) is backup for the case that - # wrap_for_nesting fails, to ensure that the method will stil be defined in + # wrap_for_nesting fails, to ensure that the method will still be defined in # the correct place. # # @param [String] source The source to wrap diff --git a/lib/pry/method/weird_method_locator.rb b/lib/pry/method/weird_method_locator.rb index 85614aec7..70a113883 100644 --- a/lib/pry/method/weird_method_locator.rb +++ b/lib/pry/method/weird_method_locator.rb @@ -123,7 +123,7 @@ def pry_file? # know which __FILE__ and __LINE__ the binding is at, we can hope to # disambiguate these cases. # - # This obviously won't work if the source is unavaiable for some reason, + # This obviously won't work if the source is unavailable for some reason, # or if both methods have the same __FILE__ and __LINE__. # # @return [Pry::Method, nil] The Pry::Method representing the diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index f5f8db6a6..bafe1716a 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -215,7 +215,7 @@ def self.load_file_through_repl(file_name) # The maximum number of chars before clipping occurs. # # @option options [Boolean] :id (false) - # Boolean to indicate whether or not a hex reprsentation of the object ID + # Boolean to indicate whether or not a hex representation of the object ID # is attached to the return value when the length of inspect is greater than # value of `:max_length`. # diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index c66c607e9..68da39b51 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -388,7 +388,7 @@ def run_command(val) # @param [*Object] args The arguments to pass to the hook # @return [Object, Exception] The return value of the hook or the exception raised # - # If executing a hook raises an exception, we log that and then continue sucessfully. + # If executing a hook raises an exception, we log that and then continue successfully. # To debug such errors, use the global variable $pry_hook_error, which is set as a # result. def exec_hook(name, *args, &block) @@ -549,7 +549,7 @@ def output # and a mistake in specifying that exception. # # (i.e. raise-up RunThymeError.new should not be the same as - # raise-up NameError, "unititialized constant RunThymeError") + # raise-up NameError, "uninitialized constant RunThymeError") # def raise_up_common(force, *args) exception = if args == [] diff --git a/lib/pry/ring.rb b/lib/pry/ring.rb index 653ffb591..e9aeaf8b8 100644 --- a/lib/pry/ring.rb +++ b/lib/pry/ring.rb @@ -3,7 +3,7 @@ class Pry # A ring is a thread-safe fixed-capacity array to which you can only add # elements. Older entries are overwritten as you add new elements, so that the - # ring can never contain more than `max_size` elemens. + # ring can never contain more than `max_size` elements. # # @example # ring = Pry::Ring.new(3) diff --git a/lib/pry/slop.rb b/lib/pry/slop.rb index 99c48f4b0..5bd289f06 100644 --- a/lib/pry/slop.rb +++ b/lib/pry/slop.rb @@ -73,7 +73,7 @@ def parse!(items = ARGV, config = {}, &block) # Build a Slop object from a option specification. # # This allows you to design your options via a simple String rather - # than programatically. Do note though that with this method, you're + # than programmatically. Do note though that with this method, you're # unable to pass any advanced options to the on() method when creating # options. # diff --git a/lib/pry/wrapped_module.rb b/lib/pry/wrapped_module.rb index 89173dcdc..d00c893f8 100644 --- a/lib/pry/wrapped_module.rb +++ b/lib/pry/wrapped_module.rb @@ -286,7 +286,7 @@ def super(times = 1) # highest rank, that is the 'monkey patch' of this module with the # highest number of methods, which contains a source code line that # defines the module. It is considered the 'canonical' definition - # for the module. In the absense of a suitable candidate, the + # for the module. In the absence of a suitable candidate, the # candidate of rank 0 will be returned, or a CommandError raised if # there are no candidates at all. def primary_candidate diff --git a/spec/class_command_spec.rb b/spec/class_command_spec.rb index 59151d620..2d88d064e 100644 --- a/spec/class_command_spec.rb +++ b/spec/class_command_spec.rb @@ -127,7 +127,7 @@ def process; end end end - context "when help is not invloved" do + context "when help is not involved" do context "when #process accepts no arguments" do subject do command = Class.new(described_class) do diff --git a/spec/code_spec.rb b/spec/code_spec.rb index 4ae2ca0b4..c717a8204 100644 --- a/spec/code_spec.rb +++ b/spec/code_spec.rb @@ -255,7 +255,7 @@ def bound_method end context "when start_line is a Range" do - it "returns a range fo lines corresponding to the given Range" do + it "returns a range of lines corresponding to the given Range" do expect(subject.between(2..3).lines).to eq(%W[2\n 3\n]) end end @@ -434,7 +434,7 @@ def bound_method describe "#expression_at" do subject { described_class.new(['def foo', ' :test', 'end']) } - it "returns a multiline expressiong starting on the given line number" do + it "returns a multiline expression starting on the given line number" do expect(subject.expression_at(1)).to eq("def foo\n :test\nend\n") end end diff --git a/spec/command_set_spec.rb b/spec/command_set_spec.rb index 36f76204b..406c7f14b 100644 --- a/spec/command_set_spec.rb +++ b/spec/command_set_spec.rb @@ -28,7 +28,7 @@ expect(subject.count).to eq(1) end - it "assings default description" do + it "assigns default description" do command = subject.block_command('test') expect(command.description).to eq('No description.') end @@ -59,7 +59,7 @@ expect(subject.count).to eq(1) end - it "assings default description" do + it "assigns default description" do command = subject.create_command('test') {} expect(command.description).to eq('No description.') end @@ -225,7 +225,7 @@ describe "#rename_command" do before { subject.command('test') } - it "renames a comamnd" do + it "renames a command" do subject.rename_command('new-name', 'test') expect(subject['test']).to be_nil expect(subject['new-name']).not_to be_nil diff --git a/spec/commands/exit_all_spec.rb b/spec/commands/exit_all_spec.rb index aa3c705b6..25c03544e 100644 --- a/spec/commands/exit_all_spec.rb +++ b/spec/commands/exit_all_spec.rb @@ -8,7 +8,7 @@ expect(@pry.exit_value).to equal nil end - it "should break out of the repl wth a user specified value" do + it "should break out of the repl with a user specified value" do expect(@pry.eval("exit-all 'message'")).to equal false expect(@pry.exit_value).to eq("message") end diff --git a/spec/commands/hist_spec.rb b/spec/commands/hist_spec.rb index 789ceff1e..c6153c7bf 100644 --- a/spec/commands/hist_spec.rb +++ b/spec/commands/hist_spec.rb @@ -202,7 +202,7 @@ def next_input expect(@t.eval('hist')).to match(/1:\shello\n2:\sworld/) end - it "displays all history (including the current sesion) with `--all` switch" do + it "displays all history (including the current session) with `--all` switch" do @hist.push('goodbye') @hist.push('world') diff --git a/spec/commands/raise_up_spec.rb b/spec/commands/raise_up_spec.rb index dbb45f91e..d3834f0b1 100644 --- a/spec/commands/raise_up_spec.rb +++ b/spec/commands/raise_up_spec.rb @@ -17,7 +17,7 @@ end end - it "should raise an unamed exception with raise-up" do + it "should raise an unnamed exception with raise-up" do redirect_pry_io(InputTester.new("raise 'stop'", "raise-up 'noreally'")) do expect { Object.new.pry }.to raise_error(RuntimeError, "noreally") end diff --git a/spec/commands/reload_code_spec.rb b/spec/commands/reload_code_spec.rb index 845ee117a..72e3eb611 100644 --- a/spec/commands/reload_code_spec.rb +++ b/spec/commands/reload_code_spec.rb @@ -19,7 +19,7 @@ end.to raise_error(Pry::CommandError) end - it 'reloads pry commmand' do + it 'reloads pry command' do expect(pry_eval("reload-code reload-code")).to match(/reload-code was reloaded!/) end diff --git a/spec/commands/save_file_spec.rb b/spec/commands/save_file_spec.rb index 9dd809666..9672c6c13 100644 --- a/spec/commands/save_file_spec.rb +++ b/spec/commands/save_file_spec.rb @@ -100,7 +100,7 @@ def @o.bang # Pry::Method.from_obj(@o, :bang).source # end - # it 'should save multiple methods to a file trucated by --lines' do + # it 'should save multiple methods to a file truncated by --lines' do # @t.eval "save-file #{@path} -m baby -m bang --lines 2..-2" # # must add 1 as first line of method is 1 @@ -108,7 +108,7 @@ def @o.bang # Pry::Method.from_obj(@o, :bang).source).lines.to_a[1..-2].join # end - # it 'should save multiple methods to a file trucated by --lines 1 ' \ + # it 'should save multiple methods to a file truncated by --lines 1 ' \ # '(single parameter, not range)' do # @t.eval "save-file #{@path} -m baby -m bang --lines 1" diff --git a/spec/commands/watch_expression_spec.rb b/spec/commands/watch_expression_spec.rb index 08f3d107b..c99c216c2 100644 --- a/spec/commands/watch_expression_spec.rb +++ b/spec/commands/watch_expression_spec.rb @@ -64,7 +64,7 @@ def watch_eval(expr) end end - it "doesn't print when an expresison remains the same" do + it "doesn't print when an expression remains the same" do ReplTester.start do input 'a = 1' output '=> 1' diff --git a/spec/method_spec.rb b/spec/method_spec.rb index 137a9d117..c66a3f139 100644 --- a/spec/method_spec.rb +++ b/spec/method_spec.rb @@ -469,7 +469,7 @@ class << self; def meth; 1; end; end .to eq(class << @class; self; end) end - it "should attrbute overridden methods to the class not the module" do + it "should attribute overridden methods to the class not the module" do @class = Class.new do class << self def meth; 1; end @@ -698,7 +698,7 @@ def @class.required_keyword(required_key:) end describe "#owner" do - context "when it is overriden in Object" do + context "when it is overridden in Object" do before do module OwnerMod def owner @@ -719,7 +719,7 @@ def owner end describe "#parameters" do - context "when it is overriden in Object" do + context "when it is overridden in Object" do before do module ParametersMod def parameters @@ -740,7 +740,7 @@ def parameters end describe "#receiver" do - context "when it is overriden in Object" do + context "when it is overridden in Object" do before do module ReceiverMod def receiver diff --git a/spec/syntax_checking_spec.rb b/spec/syntax_checking_spec.rb index beba497f1..a6d08428e 100644 --- a/spec/syntax_checking_spec.rb +++ b/spec/syntax_checking_spec.rb @@ -61,7 +61,7 @@ end end - it "should not intefere with syntax errors explicitly raised" do + it "should not interfere with syntax errors explicitly raised" do input_tester = InputTester.new('raise SyntaxError, "unexpected $end"') redirect_pry_io(input_tester, @str_output) do Pry.start @@ -91,15 +91,15 @@ expect(output).to match(/^RuntimeError.*\nSyntaxError.*\n=> true/m) end - it "should allow whitespace delimeted strings" do + it "should allow whitespace delimited strings" do expect(mock_pry('"%s" % % foo ')).to match(/"foo"/) end - it "should allow newline delimeted strings" do + it "should allow newline delimited strings" do expect(mock_pry('"%s" % %', 'foo')).to match(/"foo"/) end - it "should allow whitespace delimeted strings ending on the first char of a line" do + it "should allow whitespace delimited strings ending on the first char of a line" do expect(mock_pry('"%s" % % ', ' #done!')).to match(/"\\n"/) end end