Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #805

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/how_sprockets_works.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class NpmDirectiveProcessor < Sprockets::DirectiveProcessor
pipeline: :self,
load_paths: dirs
)
@dependecies.merge(deps)
@dependencies.merge(deps)
@required << uri
end
end
Expand Down
2 changes: 1 addition & 1 deletion guides/source_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ digit.to_s(2)
# or "000000"
```

Whe then generate a `vl` by shifting the digit with the default value of `shift` which is 0
When then generate a `vl` by shifting the digit with the default value of `shift` which is 0

```
vlq += digit << shift
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def source
if @source
@source
else
# File is read everytime to avoid memory bloat of large binary files
# File is read every time to avoid memory bloat of large binary files
File.binread(filename)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/compressing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def skip_gzip?
#
# environment.gzip = false
#
# To enable set to a truthy value. By default zlib wil
# To enable set to a truthy value. By default zlib will
# be used to gzip assets. If you have the Zopfli gem
# installed you can specify the zopfli algorithm to be used
# instead:
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def load_from_unloaded(unloaded)
processors_dep_uri = build_processors_uri(type, file_type, pipeline)
dependencies = config[:dependencies] + [processors_dep_uri]

# Read into memory and process if theres a processor pipeline
# Read into memory and process if there's a processor pipeline
if processors.any?
result = call_processors(processors, {
environment: self,
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/path_dependency_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Sprockets
# The returned dependency set can be passed to resolve_dependencies(deps)
# to check if the returned result is still fresh. In this case, entry always
# returns a single path, but multiple calls should accumulate dependencies
# into a single set thats saved off and checked later.
# into a single set that's saved off and checked later.
#
# resolve_dependencies(deps)
# # => "\x01\x02\x03"
Expand Down
4 changes: 2 additions & 2 deletions lib/sprockets/utils/gzip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def initialize(asset, archiver: ZlibArchiver)

# What non-text mime types should we compress? This list comes from:
# https://www.fastly.com/blog/new-gzip-settings-and-deciding-what-compress
COMPRESSABLE_MIME_TYPES = {
COMPRESSIBLE_MIME_TYPES = {
"application/vnd.ms-fontobject" => true,
"application/x-font-opentype" => true,
"application/x-font-ttf" => true,
Expand All @@ -71,7 +71,7 @@ def can_compress?
# can be compressed.
#
# We also check against our list of non-text compressible mime types
@charset || COMPRESSABLE_MIME_TYPES.include?(@content_type)
@charset || COMPRESSIBLE_MIME_TYPES.include?(@content_type)
end

# Private: Opposite of `can_compress?`.
Expand Down
2 changes: 1 addition & 1 deletion test/test_asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def setup
asset("project.js").digest_path
end

test "multiple charset defintions are stripped from css bundle" do
test "multiple charset definitions are stripped from css bundle" do
assert_equal "\n.foo {}\n\n.bar {}\n\n\n", asset("charset.css").to_s
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_caching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def has_relative_value?(elem)
end


test "no absolute paths are retuned from cache" do
test "no absolute paths are returned from cache" do
env1 = Sprockets::Environment.new(fixture_path('default')) do |env|
env.append_path(".")
env.cache = @cache
Expand Down
2 changes: 1 addition & 1 deletion test/test_dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def teardown

def test_env_dependency
assert_equal @env.resolve_dependency('env:DEPENDENCY_TEST_VALUE'), 'Hello'
assert_nil @env.resolve_dependency('env:NONEXISTANT_DEPENDENCY_TEST_VALUE')
assert_nil @env.resolve_dependency('env:NONEXISTENT_DEPENDENCY_TEST_VALUE')
end
end
2 changes: 1 addition & 1 deletion test/test_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def setup
end
end

test "bundled asset cached if theres an error building it" do
test "bundled asset cached if there's an error building it" do
@env.cache = nil

filename = File.join(fixture_path("default"), "tmp.coffee")
Expand Down
16 changes: 8 additions & 8 deletions test/test_performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def exist?(filename)
end
end

$dir_entires_calls = nil
$dir_entries_calls = nil
class << Dir
alias_method :original_entries, :entries
def entries(dirname, **args)
if $dir_entires_calls
$dir_entires_calls[dirname.to_s] ||= []
$dir_entires_calls[dirname.to_s] << caller
if $dir_entries_calls
$dir_entries_calls[dirname.to_s] ||= []
$dir_entries_calls[dirname.to_s] << caller
end
original_entries(dirname, **args)
end
Expand Down Expand Up @@ -61,7 +61,7 @@ def setup

def teardown
$file_stat_calls = nil
$dir_entires_calls = nil
$dir_entries_calls = nil
$processor_calls = nil
$bundle_processor_calls = nil
$cache_get_calls = nil
Expand Down Expand Up @@ -463,7 +463,7 @@ def new_environment(path = fixture_path('default'))
def reset_stats!
$file_stat_calls = {}
$file_exist_calls = {}
$dir_entires_calls = {}
$dir_entries_calls = {}
$processor_calls = {}
$bundle_processor_calls = {}
$cache_get_calls = {}
Expand All @@ -475,7 +475,7 @@ def assert_no_stat_calls
assert_equal 0, callers.size, "File.stat(#{path.inspect}) called #{callers.size} times\n\n#{format_callers(callers)}"
end

$dir_entires_calls.each do |path, callers|
$dir_entries_calls.each do |path, callers|
assert_equal 0, callers.size, "Dir.entries(#{path.inspect}) called #{callers.size} times\n\n#{format_callers(callers)}"
end
end
Expand All @@ -489,7 +489,7 @@ def assert_no_redundant_stat_calls
assert_equal 1, callers.size, "File.exist?(#{path.inspect}) called #{callers.size} times\n\n#{format_callers(callers)}"
end

$dir_entires_calls.each do |path, callers|
$dir_entries_calls.each do |path, callers|
assert_equal 1, callers.size, "Dir.entries(#{path.inspect}) called #{callers.size} times\n\n#{format_callers(callers)}"
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def app
assert_equal 404, last_response.status
end

test "if sources didnt change the server shouldnt rebundle" do
test "if sources didn't change the server shouldn't rebundle" do
get "/assets/application.js"
asset_before = @env["application.js"]
assert asset_before
Expand Down
4 changes: 2 additions & 2 deletions test/test_uri_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_parse_query_params
parse_asset_uri("file:///usr/local/var/github/app/assets/views/users.html?type=text/html;%20charset=utf-8")
end

def test_asset_uri_raise_erorr_when_invalid_uri_scheme
def test_asset_uri_raise_error_when_invalid_uri_scheme
assert_raises URI::InvalidURIError do
parse_asset_uri("http:///usr/local/var/github/app/assets/javascripts/application.js")
end
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_build_file_digest_uri
end
end

def test_file_digest_raise_erorr_when_invalid_uri_scheme
def test_file_digest_raise_error_when_invalid_uri_scheme
assert_raises URI::InvalidURIError do
parse_file_digest_uri("http:///usr/local/var/github/app/assets/javascripts/application.js")
end
Expand Down
Loading