Autofix rubocop checks.
This commit is contained in:
parent
6ce083d294
commit
dfa22680df
@ -168,8 +168,8 @@ module Cask
|
||||
end
|
||||
|
||||
def to_h_hash_gsubs(hash)
|
||||
hash.to_h.each_with_object({}) do |(key, value), h|
|
||||
h[key] = to_h_gsubs(value)
|
||||
hash.to_h.transform_values do |value|
|
||||
to_h_gsubs(value)
|
||||
end
|
||||
rescue TypeError
|
||||
to_h_array_gsubs(hash)
|
||||
|
||||
@ -97,7 +97,7 @@ module Cask
|
||||
@manpagedir ||= HOMEBREW_PREFIX/"share/man"
|
||||
end
|
||||
|
||||
DEFAULT_DIRS.keys.each do |dir|
|
||||
DEFAULT_DIRS.each_key do |dir|
|
||||
define_method(dir) do
|
||||
explicit.fetch(dir, env.fetch(dir, default.fetch(dir)))
|
||||
end
|
||||
|
||||
@ -18,13 +18,13 @@ module Cask
|
||||
def initialize(**pairs)
|
||||
pairs.assert_valid_keys!(*VALID_KEYS)
|
||||
|
||||
super(Hash[pairs.map { |k, v| [k, Set.new([*v])] }])
|
||||
super(pairs.transform_values { |v| Set.new([*v]) })
|
||||
|
||||
self.default = Set.new
|
||||
end
|
||||
|
||||
def to_json(generator)
|
||||
Hash[map { |k, v| [k, v.to_a] }].to_json(generator)
|
||||
transform_values(&:to_a).to_json(generator)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1669,7 +1669,7 @@ class Formula
|
||||
"root_url" => bottle_spec.root_url,
|
||||
}
|
||||
bottle_info["files"] = {}
|
||||
bottle_spec.collector.keys.each do |os|
|
||||
bottle_spec.collector.each_key do |os|
|
||||
bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}"
|
||||
checksum = bottle_spec.collector[os]
|
||||
bottle_info["files"][os] = {
|
||||
|
||||
@ -196,7 +196,7 @@ class LinkageChecker
|
||||
|
||||
version_hash = {}
|
||||
version_conflict_deps = Set.new
|
||||
@brewed_dylibs.keys.each do |l|
|
||||
@brewed_dylibs.each_key do |l|
|
||||
name = l.split("/").last
|
||||
unversioned_name, = name.split("@")
|
||||
version_hash[unversioned_name] ||= Set.new
|
||||
|
||||
@ -5,7 +5,7 @@ require "open3"
|
||||
describe "RuboCop" do
|
||||
context "when calling `rubocop` outside of the Homebrew environment" do
|
||||
before do
|
||||
ENV.keys.each do |key|
|
||||
ENV.each_key do |key|
|
||||
ENV.delete(key) if key.start_with?("HOMEBREW_")
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user