Skip to content

Commit

Permalink
Fix some typographical errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nisusam committed Oct 31, 2024
1 parent 96ea772 commit a465562
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/cache_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class UncacheableFragmentError < StandardError; end
# render "maintenance_tasks/runs/info/#{run.status}"
#
# Because the value passed to render ends in interpolation, Action View
# will mark all partials within the "maintenace_tasks/runs/info" folder as
# will mark all partials within the "maintenance_tasks/runs/info" folder as
# dependencies.
#
# === Explicit dependencies
Expand Down
2 changes: 1 addition & 1 deletion actionview/test/template/date_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_select_day_with_two_digit_numbers
assert_dom_equal expected, select_day(2, use_two_digit_numbers: true)
end

def test_select_day_with_day_fomat
def test_select_day_with_day_format
expected = +%(<select id="date_day" name="date[day]">\n)
expected << %(<option value="1">1st</option>\n<option selected="selected" value="2">2nd</option>\n<option value="3">3rd</option>\n<option value="4">4th</option>\n<option value="5">5th</option>\n<option value="6">6th</option>\n<option value="7">7th</option>\n<option value="8">8th</option>\n<option value="9">9th</option>\n<option value="10">10th</option>\n<option value="11">11th</option>\n<option value="12">12th</option>\n<option value="13">13th</option>\n<option value="14">14th</option>\n<option value="15">15th</option>\n<option value="16">16th</option>\n<option value="17">17th</option>\n<option value="18">18th</option>\n<option value="19">19th</option>\n<option value="20">20th</option>\n<option value="21">21st</option>\n<option value="22">22nd</option>\n<option value="23">23rd</option>\n<option value="24">24th</option>\n<option value="25">25th</option>\n<option value="26">26th</option>\n<option value="27">27th</option>\n<option value="28">28th</option>\n<option value="29">29th</option>\n<option value="30">30th</option>\n<option value="31">31st</option>\n)
expected << "</select>\n"
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/attribute_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ def define_attribute_method_pattern(pattern, attr_name, owner:, as:, override: f
canonical_method_name = pattern.method_name(attr_name)
public_method_name = pattern.method_name(as)

# If defining a regular attribute method, we don't override methods that are explictly
# defined in parrent classes.
# If defining a regular attribute method, we don't override methods that are explicitly
# defined in parent classes.
if instance_method_already_implemented?(public_method_name)
# However, for `alias_attribute`, we always define the method.
# We check for override second because `instance_method_already_implemented?`
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/secure_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module ClassMethods
#
# Finally, a password reset token that's valid for 15 minutes after issue
# is automatically configured when +reset_token+ is set to true (which it is by default)
# and the object reponds to +generates_token_for+ (which Active Records do).
# and the object responds to +generates_token_for+ (which Active Records do).
#
# To use +has_secure_password+, add bcrypt (~> 3.1.7) to your Gemfile:
#
Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def mute
# t1.join
#
# p val_1 # => "new value 1"
# p val_2 # => "oritinal value"
# p val_2 # => "original value"
# p cache.fetch("foo") # => "new value 1"
#
# # The entry requires 3 seconds to expire (expires_in + race_condition_ttl)
Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/testing/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _callable_to_source_string(callable)
source.delete_prefix!("{")
source.strip!
# It won't read nice if the callable contains multiple
# lines, and it should be a rare occurence anyway.
# lines, and it should be a rare occurrence anyway.
# Same if it takes arguments.
if !source.include?("\n") && !source.start_with?("|")
return source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_ttl_isnt_updated
assert_equal 2, @cache.increment(key, 1, expires_in: 5000)

# having to sleep two seconds in a test is bad, but we're testing
# a wide range of backends with different TTL mecanisms, most without
# a wide range of backends with different TTL mechanisms, most without
# subsecond granularity, so this is the only reliable way.
sleep 2

Expand Down
6 changes: 3 additions & 3 deletions railties/lib/rails/generators/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ def match_file(path, pattern)

def route_namespace_pattern(namespace)
namespace.each_with_index.reverse_each.reduce(nil) do |pattern, (name, i)|
cummulative_margin = "\\#{i + 1}[ ]{2}"
blank_or_indented_line = "^[ ]*\n|^#{cummulative_margin}.*\n"
"(?:(?:#{blank_or_indented_line})*?^(#{cummulative_margin})namespace :#{name} do\n#{pattern})?"
cumulative_margin = "\\#{i + 1}[ ]{2}"
blank_or_indented_line = "^[ ]*\n|^#{cumulative_margin}.*\n"
"(?:(?:#{blank_or_indented_line})*?^(#{cumulative_margin})namespace :#{name} do\n#{pattern})?"
end.then do |pattern|
/^([ ]*).+\.routes\.draw do[ ]*\n#{pattern}/
end
Expand Down
8 changes: 4 additions & 4 deletions railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def test_esbuild_option
assert_node_files
end

def test_esbuild_option_with_javacript_argument
def test_esbuild_option_with_javascript_argument
run_generator [destination_root, "--javascript", "esbuild"]
assert_gem "jsbundling-rails"
end
Expand All @@ -872,7 +872,7 @@ def test_bun_option
assert_gem "jsbundling-rails"
end

def test_bun_option_with_javacript_argument
def test_bun_option_with_javascript_argument
run_generator [destination_root, "--javascript", "bun"]
assert_gem "jsbundling-rails"
end
Expand Down Expand Up @@ -1287,12 +1287,12 @@ def test_devcontainer

assert_equal expected_rails_app_config, compose_config["services"]["rails-app"]

expected_selenium_conifg = {
expected_selenium_config = {
"image" => "selenium/standalone-chromium",
"restart" => "unless-stopped",
}

assert_equal expected_selenium_conifg, compose_config["services"]["selenium"]
assert_equal expected_selenium_config, compose_config["services"]["selenium"]
end
end

Expand Down
6 changes: 3 additions & 3 deletions railties/test/generators/plugin_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_create_mountable_application_with_mountable_option
assert_no_file "bin/test"
end

def test_create_mountable_application_with_mountable_option_and_hypenated_name
def test_create_mountable_application_with_mountable_option_and_hyphenated_name
run_generator [File.join(destination_root, "hyphenated-name"), "--mountable"]
assert_no_file "hyphenated-name/app/assets/javascripts/hyphenated/name"
assert_file "hyphenated-name/app/assets/stylesheets/hyphenated/name"
Expand All @@ -417,7 +417,7 @@ def test_create_mountable_application_with_mountable_option_and_hypenated_name
end
end

def test_create_mountable_application_with_mountable_option_and_hypenated_and_underscored_name
def test_create_mountable_application_with_mountable_option_and_hyphenated_and_underscored_name
run_generator [File.join(destination_root, "my_hyphenated-name"), "--mountable"]
assert_no_file "my_hyphenated-name/app/assets/javascripts/my_hyphenated/name"
assert_file "my_hyphenated-name/app/assets/stylesheets/my_hyphenated/name"
Expand All @@ -439,7 +439,7 @@ def test_create_mountable_application_with_mountable_option_and_hypenated_and_un
end
end

def test_create_mountable_application_with_mountable_option_and_multiple_hypenates_in_name
def test_create_mountable_application_with_mountable_option_and_multiple_hyphenates_in_name
run_generator [File.join(destination_root, "deep-hyphenated-name"), "--mountable"]
assert_no_file "deep-hyphenated-name/app/assets/javascripts/deep/hyphenated/name"
assert_file "deep-hyphenated-name/app/assets/stylesheets/deep/hyphenated/name"
Expand Down

0 comments on commit a465562

Please sign in to comment.