Skip to content

Commit

Permalink
Merge pull request #2301 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
andrehjr committed Feb 25, 2024
2 parents e81bee8 + 489558b commit 0a948ae
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/pry/class_command.rb
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/pry/code_object.rb
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions lib/pry/command_set.rb
Expand Up @@ -145,7 +145,7 @@ def delete(*searches)
# Imports all the commands from one or more sets.
# @param [Array<CommandSet>] 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
Expand All @@ -157,7 +157,7 @@ def import(*sets)
# Imports some commands from a set
# @param [CommandSet] set Set to import commands from
# @param [Array<String>] 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|
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/commands/amend_line.rb
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion 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.*)/)
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/commands/ri.rb
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/commands/watch_expression/expression.rb
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/helpers/command_helpers.rb
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/input_completer.rb
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/pry/method/patcher.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/method/weird_method_locator.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/pry_class.rb
Expand Up @@ -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`.
#
Expand Down
4 changes: 2 additions & 2 deletions lib/pry/pry_instance.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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 == []
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/ring.rb
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/slop.rb
Expand Up @@ -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.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/wrapped_module.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/class_command_spec.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/code_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/command_set_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/exit_all_spec.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/hist_spec.rb
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion spec/commands/raise_up_spec.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/reload_code_spec.rb
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/commands/save_file_spec.rb
Expand Up @@ -100,15 +100,15 @@ 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
# File.read(@path).should == (Pry::Method.from_obj(@o, :baby).source +
# 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"

Expand Down
2 changes: 1 addition & 1 deletion spec/commands/watch_expression_spec.rb
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions spec/method_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/syntax_checking_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 0a948ae

Please sign in to comment.