From 5640495babcb4cfd69ba650b293660b7446402da Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Wed, 27 Mar 2024 23:25:35 +0800 Subject: [PATCH] Fix typos in changelog, readme and code comments (#2006) Found via `typos --format brief` --- CHANGELOG.md | 4 ++-- rack-protection/spec/lib/rack/protection/protection_spec.rb | 2 +- sinatra-contrib/README.md | 2 +- sinatra-contrib/ideas.md | 2 +- sinatra-contrib/lib/sinatra/reloader.rb | 4 ++-- sinatra-contrib/lib/sinatra/webdav.rb | 2 +- sinatra-contrib/spec/cookies_spec.rb | 2 +- test/middleware_test.rb | 4 ++-- test/settings_test.rb | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48f5840eaf..cb483c1e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -243,7 +243,7 @@ * Fix issue with passed routes and provides Fixes [#1095](https://github.com/sinatra/sinatra/pull/1095) [#1606](https://github.com/sinatra/sinatra/pull/1606) by Mike Pastore, Jordan Owens -* Add QuietLogger that excludes pathes from Rack::CommonLogger [1250](https://github.com/sinatra/sinatra/pull/1250) by Christoph Wagner +* Add QuietLogger that excludes paths from Rack::CommonLogger [1250](https://github.com/sinatra/sinatra/pull/1250) by Christoph Wagner * Sinatra::Contrib dependency updates. Fixes [#1207](https://github.com/sinatra/sinatra/pull/1207) [#1411](https://github.com/sinatra/sinatra/pull/1411) by Mike Pastore @@ -1609,7 +1609,7 @@ the 1.0 release: Hash structure. e.g., "post[title]=Hello&post[body]=World" yields params: {'post' => {'title' => 'Hello', 'body' => 'World'}}. - * Regular expressions may now be used in route pattens; captures are + * Regular expressions may now be used in route patterns; captures are available at "params[:captures]". * New ":provides" route condition takes an array of mime types and diff --git a/rack-protection/spec/lib/rack/protection/protection_spec.rb b/rack-protection/spec/lib/rack/protection/protection_spec.rb index 93a04e4dde..1f90004484 100644 --- a/rack-protection/spec/lib/rack/protection/protection_spec.rb +++ b/rack-protection/spec/lib/rack/protection/protection_spec.rb @@ -16,7 +16,7 @@ expect(session[:foo]).to eq(:bar) get '/', {}, 'rack.session' => session, 'HTTP_FOO' => 'BAR' - # wont be empty if the remote_token middleware runs after session_hijacking + # won't be empty if the remote_token middleware runs after session_hijacking # why we run the mock app without remote_token expect(session).to be_empty end diff --git a/sinatra-contrib/README.md b/sinatra-contrib/README.md index 02f4992809..154f9f1f72 100644 --- a/sinatra-contrib/README.md +++ b/sinatra-contrib/README.md @@ -69,7 +69,7 @@ consider using an alternative like [rerun](https://github.com/alexch/rerun) or * [`sinatra/test_helpers`][sinatra-test-helpers]: Helper methods to ease testing your Sinatra application. Partly extracted from Sinatra. Testing framework agnostic -* `sinatra/quiet_logger`: Extension to exclude specific pathes from access log. +* `sinatra/quiet_logger`: Extension to exclude specific paths from access log. It works by patching Rack::CommonLogger ## Installation diff --git a/sinatra-contrib/ideas.md b/sinatra-contrib/ideas.md index fc4df978f6..227dc75c5e 100644 --- a/sinatra-contrib/ideas.md +++ b/sinatra-contrib/ideas.md @@ -10,7 +10,7 @@ end * `sinatra-smart-cache`: update cache header only if arguments are more - restrictive than curent value, set caching headers that way for most helper + restrictive than current value, set caching headers that way for most helper methods (i.e. `send_file`) * Some verbose logging extension: Log what filters, routes, error handlers, diff --git a/sinatra-contrib/lib/sinatra/reloader.rb b/sinatra-contrib/lib/sinatra/reloader.rb index 8f7f19a9f6..2e5130c38d 100644 --- a/sinatra-contrib/lib/sinatra/reloader.rb +++ b/sinatra-contrib/lib/sinatra/reloader.rb @@ -395,12 +395,12 @@ def dont_reload(*glob) # attr_reader :register_path warn on -w (private attribute) def register_path; @register_path ||= nil; end - # Indicates an extesion is being registered. + # Indicates an extension is being registered. def start_registering_extension @register_path = caller_files[2] end - # Indicates the extesion has already been registered. + # Indicates the extension has already been registered. def stop_registering_extension @register_path = nil end diff --git a/sinatra-contrib/lib/sinatra/webdav.rb b/sinatra-contrib/lib/sinatra/webdav.rb index 70ef7f632c..0141087fd1 100644 --- a/sinatra-contrib/lib/sinatra/webdav.rb +++ b/sinatra-contrib/lib/sinatra/webdav.rb @@ -21,7 +21,7 @@ module Sinatra # end # end # - # You can use it in classic application just by requring the extension: + # You can use it in classic application just by requiring the extension: # # require 'sinatra' # require 'sinatra/webdav' diff --git a/sinatra-contrib/spec/cookies_spec.rb b/sinatra-contrib/spec/cookies_spec.rb index b78b409428..372cddc864 100644 --- a/sinatra-contrib/spec/cookies_spec.rb +++ b/sinatra-contrib/spec/cookies_spec.rb @@ -642,7 +642,7 @@ def cookies(*set_cookies) end describe :merge do - it 'is mergable with a hash' do + it 'is mergeable with a hash' do expect(cookies('foo=bar').merge(:bar => :baz)).to eq({"foo" => "bar", :bar => :baz}) end diff --git a/test/middleware_test.rb b/test/middleware_test.rb index aa6fcdb9e9..cd3efd1837 100644 --- a/test/middleware_test.rb +++ b/test/middleware_test.rb @@ -97,14 +97,14 @@ def call(env) get '/' end - class KeywordArgumentIntializationMiddleware < MockMiddleware + class KeywordArgumentInitializationMiddleware < MockMiddleware def initialize(app, **) super app end end it "handles keyword arguments" do - @app.use KeywordArgumentIntializationMiddleware, argument: "argument" + @app.use KeywordArgumentInitializationMiddleware, argument: "argument" get '/' end end diff --git a/test/settings_test.rb b/test/settings_test.rb index c1aa02c9c9..a85e7d2c0b 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -288,7 +288,7 @@ def foo=(value) assert body.include?("show_exceptions setting") end - it 'does not attempt to show unparseable query parameters' do + it 'does not attempt to show unparsable query parameters' do klass = Sinatra.new(Sinatra::Application) mock_app(klass) { enable :show_exceptions