Skip to content

Commit

Permalink
Standardrb fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Nov 15, 2021
1 parent 86d7cf4 commit 7efbdb9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/mime/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def [](type_id, complete: false, registered: false)
def type_for(filename)
results =
Array(filename).flat_map { |fn|
@extension_index[fn.chomp.downcase[/\.?([^.]*?)$/, 1]]
}.compact.inject(Set.new, :+)
@extension_index[fn.chomp.downcase[/\.?([^.]*?)$/, 1]]
}.compact.inject(Set.new, :+)

stable_sort(results)
end
Expand Down
2 changes: 1 addition & 1 deletion support/deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def rubygems_get(gem_name: "", endpoint: "")
end

def gem_downloads(name)
rubygems_get(gem_name: name)["downloads"]
rubygems_get(gem_name: name)["downloads"]
rescue => e
puts "#{name} #{e.message}"
end
Expand Down
10 changes: 5 additions & 5 deletions test/test_mime_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def mime_types
assert_kind_of Enumerator::Lazy, mime_types.map.lazy
end

it 'is countable with an enumerator' do
it "is countable with an enumerator" do
assert_equal 8, mime_types.each.count
assert_equal 8, mime_types.lazy.count
end
Expand Down Expand Up @@ -161,13 +161,13 @@ def mime_types
assert_includes mime_types.type_for("xtxt"), "text/plain"
end

it 'returns a stable order for types with equal priority' do
assert_equal %w(audio/webm video/webm), mime_types.type_for('foo.webm')
it "returns a stable order for types with equal priority" do
assert_equal %w[audio/webm video/webm], mime_types.type_for("foo.webm")
end
end

describe '#count' do
it 'can count the number of types inside' do
describe "#count" do
it "can count the number of types inside" do
assert_equal 8, mime_types.count
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_mime_types_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def setup
assert_includes MIME::Types.type_for("xtxt"), "text/plain"
end

it 'returns a stable order for types with equal priority' do
assert_equal %w(audio/webm video/webm), MIME::Types.type_for('foo.webm')
it "returns a stable order for types with equal priority" do
assert_equal %w[audio/webm video/webm], MIME::Types.type_for("foo.webm")
end
end

Expand Down

0 comments on commit 7efbdb9

Please sign in to comment.