Update Gems.
This commit is contained in:
parent
62f5e8f611
commit
b1d0c61fea
@ -45,9 +45,10 @@ Style/BarePercentLiterals:
|
|||||||
Style/CollectionMethods:
|
Style/CollectionMethods:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# Prefer simple tokens without type annotations.
|
# Prefer tokens with type annotations for consistency
|
||||||
|
# between formatting numbers and strings.
|
||||||
Style/FormatStringToken:
|
Style/FormatStringToken:
|
||||||
EnforcedStyle: template
|
EnforcedStyle: annotated
|
||||||
|
|
||||||
# This shouldn't be enabled until LineLength is lower.
|
# This shouldn't be enabled until LineLength is lower.
|
||||||
Style/IfUnlessModifier:
|
Style/IfUnlessModifier:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
# installed gems
|
# installed gems
|
||||||
gem "coveralls", require: false
|
gem "coveralls", "~> 0.8", require: false
|
||||||
gem "parallel_tests"
|
gem "parallel_tests"
|
||||||
gem "ronn", require: false
|
gem "ronn", require: false
|
||||||
gem "rspec"
|
gem "rspec"
|
||||||
@ -12,7 +12,6 @@ gem "rspec-retry", require: false
|
|||||||
gem "rspec-wait", require: false
|
gem "rspec-wait", require: false
|
||||||
gem "rubocop"
|
gem "rubocop"
|
||||||
gem "simplecov", require: false
|
gem "simplecov", require: false
|
||||||
gem "simplecov-cobertura", require: false
|
|
||||||
|
|
||||||
# vendored gems
|
# vendored gems
|
||||||
gem "activesupport"
|
gem "activesupport"
|
||||||
|
|||||||
@ -66,7 +66,7 @@ GEM
|
|||||||
rspec-mocks (~> 3.8.0)
|
rspec-mocks (~> 3.8.0)
|
||||||
rspec-core (3.8.2)
|
rspec-core (3.8.2)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-expectations (3.8.4)
|
rspec-expectations (3.8.5)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.8.0)
|
||||||
rspec-its (1.3.0)
|
rspec-its (1.3.0)
|
||||||
@ -80,14 +80,14 @@ GEM
|
|||||||
rspec-support (3.8.3)
|
rspec-support (3.8.3)
|
||||||
rspec-wait (0.0.9)
|
rspec-wait (0.0.9)
|
||||||
rspec (>= 3, < 4)
|
rspec (>= 3, < 4)
|
||||||
rubocop (0.74.0)
|
rubocop (0.75.0)
|
||||||
jaro_winkler (~> 1.5.1)
|
jaro_winkler (~> 1.5.1)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.6)
|
parser (>= 2.6)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 1.7)
|
unicode-display_width (>= 1.4.0, < 1.7)
|
||||||
rubocop-performance (1.4.1)
|
rubocop-performance (1.5.0)
|
||||||
rubocop (>= 0.71.0)
|
rubocop (>= 0.71.0)
|
||||||
rubocop-rspec (1.36.0)
|
rubocop-rspec (1.36.0)
|
||||||
rubocop (>= 0.68.1)
|
rubocop (>= 0.68.1)
|
||||||
@ -97,8 +97,6 @@ GEM
|
|||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-cobertura (1.3.1)
|
|
||||||
simplecov (~> 0.8)
|
|
||||||
simplecov-html (0.10.2)
|
simplecov-html (0.10.2)
|
||||||
term-ansicolor (1.7.1)
|
term-ansicolor (1.7.1)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
@ -120,7 +118,7 @@ DEPENDENCIES
|
|||||||
activesupport
|
activesupport
|
||||||
backports
|
backports
|
||||||
concurrent-ruby
|
concurrent-ruby
|
||||||
coveralls
|
coveralls (~> 0.8)
|
||||||
mechanize
|
mechanize
|
||||||
parallel_tests
|
parallel_tests
|
||||||
plist
|
plist
|
||||||
@ -134,7 +132,6 @@ DEPENDENCIES
|
|||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
ruby-macho
|
ruby-macho
|
||||||
simplecov
|
simplecov
|
||||||
simplecov-cobertura
|
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.1
|
2.0.2
|
||||||
|
|||||||
@ -410,6 +410,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_percent(percent)
|
def format_percent(percent)
|
||||||
format "%.2f", percent
|
format("%<percent>.2f", percent: percent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -88,7 +88,7 @@ module Debrew
|
|||||||
|
|
||||||
def self.debrew
|
def self.debrew
|
||||||
@active = true
|
@active = true
|
||||||
Object.send(:include, Raise)
|
Object.include Raise
|
||||||
|
|
||||||
begin
|
begin
|
||||||
yield
|
yield
|
||||||
|
|||||||
@ -254,7 +254,7 @@ module Homebrew
|
|||||||
wanted_mode = 0100644 & ~File.umask
|
wanted_mode = 0100644 & ~File.umask
|
||||||
actual_mode = formula.path.stat.mode
|
actual_mode = formula.path.stat.mode
|
||||||
unless actual_mode == wanted_mode
|
unless actual_mode == wanted_mode
|
||||||
problem format("Incorrect file permissions (%03<actual>o): chmod %03<wanted>o %{path}",
|
problem format("Incorrect file permissions (%03<actual>o): chmod %03<wanted>o %<path>s",
|
||||||
actual: actual_mode & 0777,
|
actual: actual_mode & 0777,
|
||||||
wanted: wanted_mode & 0777,
|
wanted: wanted_mode & 0777,
|
||||||
path: formula.path)
|
path: formula.path)
|
||||||
|
|||||||
@ -530,14 +530,13 @@ module Homebrew
|
|||||||
|
|
||||||
unless args.no_commit?
|
unless args.no_commit?
|
||||||
if ENV["HOMEBREW_GIT_NAME"]
|
if ENV["HOMEBREW_GIT_NAME"]
|
||||||
ENV["GIT_AUTHOR_NAME"] =
|
ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] =
|
||||||
ENV["GIT_COMMITTER_NAME"] =
|
ENV["HOMEBREW_GIT_NAME"]
|
||||||
ENV["HOMEBREW_GIT_NAME"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if ENV["HOMEBREW_GIT_EMAIL"]
|
if ENV["HOMEBREW_GIT_EMAIL"]
|
||||||
ENV["GIT_AUTHOR_EMAIL"] =
|
ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] =
|
||||||
ENV["GIT_COMMITTER_EMAIL"] =
|
ENV["HOMEBREW_GIT_EMAIL"]
|
||||||
ENV["HOMEBREW_GIT_EMAIL"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
short_name = formula_name.split("/", -1).last
|
short_name = formula_name.split("/", -1).last
|
||||||
|
|||||||
@ -1843,7 +1843,7 @@ class Formula
|
|||||||
|
|
||||||
@exec_count ||= 0
|
@exec_count ||= 0
|
||||||
@exec_count += 1
|
@exec_count += 1
|
||||||
logfn = format("#{logs}/#{active_log_prefix}%02<exec_count>d.%{cmd_base}",
|
logfn = format("#{logs}/#{active_log_prefix}%02<exec_count>d.%<cmd_base>s",
|
||||||
exec_count: @exec_count,
|
exec_count: @exec_count,
|
||||||
cmd_base: File.basename(cmd).split(" ").first)
|
cmd_base: File.basename(cmd).split(" ").first)
|
||||||
logs.mkpath
|
logs.mkpath
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class Messages
|
|||||||
|
|
||||||
oh1 "Installation times"
|
oh1 "Installation times"
|
||||||
install_times.each do |t|
|
install_times.each do |t|
|
||||||
puts format("%-20s %10.3f s", t[:formula], t[:time])
|
puts format("%<formula>-20s %<time>10.3f s", t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -19,15 +19,15 @@ module RuboCop
|
|||||||
|
|
||||||
COMMENT_FORMAT = /# [^ ]+ was verified as official when first introduced to the cask/.freeze
|
COMMENT_FORMAT = /# [^ ]+ was verified as official when first introduced to the cask/.freeze
|
||||||
|
|
||||||
MSG_NO_MATCH = "`%{url}` does not match `%{full_url}`"
|
MSG_NO_MATCH = "`%<url>s` does not match `%<full_url>s`"
|
||||||
|
|
||||||
MSG_MISSING = ("`%{domain}` does not match `%{homepage}`, a comment has to be added " \
|
MSG_MISSING = ("`%<domain>s` does not match `%<homepage>s`, a comment has to be added " \
|
||||||
"above the `url` stanza. For details, see " + REFERENCE_URL).freeze
|
"above the `url` stanza. For details, see " + REFERENCE_URL).freeze
|
||||||
|
|
||||||
MSG_WRONG_FORMAT = ("`%{comment}` does not match the expected comment format. " \
|
MSG_WRONG_FORMAT = ("`%<comment>s` does not match the expected comment format. " \
|
||||||
"For details, see " + REFERENCE_URL).freeze
|
"For details, see " + REFERENCE_URL).freeze
|
||||||
|
|
||||||
MSG_UNNECESSARY = "The URL's domain `%{domain}` matches the homepage `%{homepage}`, " \
|
MSG_UNNECESSARY = "The URL's domain `%<domain>s` matches the homepage `%<homepage>s`, " \
|
||||||
"the comment above the `url` stanza is unnecessary"
|
"the comment above the `url` stanza is unnecessary"
|
||||||
|
|
||||||
def on_cask(cask_block)
|
def on_cask(cask_block)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ module RuboCop
|
|||||||
class HomepageUrlTrailingSlash < Cop
|
class HomepageUrlTrailingSlash < Cop
|
||||||
include OnHomepageStanza
|
include OnHomepageStanza
|
||||||
|
|
||||||
MSG_NO_SLASH = "'%{url}' must have a slash after the domain."
|
MSG_NO_SLASH = "'%<url>s' must have a slash after the domain."
|
||||||
|
|
||||||
def on_homepage_stanza(stanza)
|
def on_homepage_stanza(stanza)
|
||||||
url_node = stanza.stanza_node.first_argument
|
url_node = stanza.stanza_node.first_argument
|
||||||
|
|||||||
@ -21,7 +21,7 @@ module RuboCop
|
|||||||
extend Forwardable
|
extend Forwardable
|
||||||
include CaskHelp
|
include CaskHelp
|
||||||
|
|
||||||
MESSAGE = "Use `%{preferred}` instead of `%{current}`"
|
MESSAGE = "Use `%<preferred>s` instead of `%<current>s`"
|
||||||
|
|
||||||
def on_cask(cask_block)
|
def on_cask(cask_block)
|
||||||
@cask_header = cask_block.header
|
@cask_header = cask_block.header
|
||||||
|
|||||||
@ -12,7 +12,7 @@ module RuboCop
|
|||||||
extend Forwardable
|
extend Forwardable
|
||||||
include CaskHelp
|
include CaskHelp
|
||||||
|
|
||||||
MESSAGE = "`%{stanza}` stanza out of order"
|
MESSAGE = "`%<stanza>s` stanza out of order"
|
||||||
|
|
||||||
def on_cask(cask_block)
|
def on_cask(cask_block)
|
||||||
@cask_block = cask_block
|
@cask_block = cask_block
|
||||||
|
|||||||
@ -5,10 +5,8 @@ describe Cask::Artifact::App, :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) }
|
||||||
|
|
||||||
let(:install_phase) {
|
let(:install_phase) {
|
||||||
lambda do
|
cask.artifacts.select { |a| a.is_a?(described_class) }.each do |artifact|
|
||||||
cask.artifacts.select { |a| a.is_a?(described_class) }.each do |artifact|
|
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
||||||
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +21,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
expect(source_path).to be_a_directory
|
expect(source_path).to be_a_directory
|
||||||
expect(target_path).not_to exist
|
expect(target_path).not_to exist
|
||||||
|
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path).to be_a_directory
|
expect(target_path).to be_a_directory
|
||||||
expect(source_path).not_to exist
|
expect(source_path).not_to exist
|
||||||
@ -44,7 +42,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
appsubdir = cask.staged_path.join("subdir").tap(&:mkpath)
|
appsubdir = cask.staged_path.join("subdir").tap(&:mkpath)
|
||||||
FileUtils.mv(source_path, appsubdir)
|
FileUtils.mv(source_path, appsubdir)
|
||||||
|
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path).to be_a_directory
|
expect(target_path).to be_a_directory
|
||||||
expect(appsubdir.join("Caffeine.app")).not_to exist
|
expect(appsubdir.join("Caffeine.app")).not_to exist
|
||||||
@ -55,7 +53,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app")
|
staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app")
|
||||||
FileUtils.cp_r source_path, staged_app_copy
|
FileUtils.cp_r source_path, staged_app_copy
|
||||||
|
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path).to be_a_directory
|
expect(target_path).to be_a_directory
|
||||||
expect(source_path).not_to exist
|
expect(source_path).not_to exist
|
||||||
@ -67,7 +65,8 @@ describe Cask::Artifact::App, :cask do
|
|||||||
it "avoids clobbering an existing app by moving over it" do
|
it "avoids clobbering an existing app by moving over it" do
|
||||||
target_path.mkpath
|
target_path.mkpath
|
||||||
|
|
||||||
expect(install_phase).to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path}'.")
|
expect { install_phase }
|
||||||
|
.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path}'.")
|
||||||
|
|
||||||
expect(source_path).to be_a_directory
|
expect(source_path).to be_a_directory
|
||||||
expect(target_path).to be_a_directory
|
expect(target_path).to be_a_directory
|
||||||
|
|||||||
@ -5,10 +5,8 @@ describe Cask::Artifact::App, :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-correct")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-correct")) }
|
||||||
|
|
||||||
let(:install_phase) {
|
let(:install_phase) {
|
||||||
lambda do
|
cask.artifacts.select { |a| a.is_a?(described_class) }.each do |artifact|
|
||||||
cask.artifacts.select { |a| a.is_a?(described_class) }.each do |artifact|
|
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
||||||
artifact.install_phase(command: NeverSudoSystemCommand, force: false)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +21,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "installs both apps using the proper target directory" do
|
it "installs both apps using the proper target directory" do
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path_mini).to be_a_directory
|
expect(target_path_mini).to be_a_directory
|
||||||
expect(source_path_mini).not_to exist
|
expect(source_path_mini).not_to exist
|
||||||
@ -36,7 +34,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-subdir")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-subdir")) }
|
||||||
|
|
||||||
it "installs both apps using the proper target directory" do
|
it "installs both apps using the proper target directory" do
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path_mini).to be_a_directory
|
expect(target_path_mini).to be_a_directory
|
||||||
expect(source_path_mini).not_to exist
|
expect(source_path_mini).not_to exist
|
||||||
@ -49,7 +47,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
it "only uses apps when they are specified" do
|
it "only uses apps when they are specified" do
|
||||||
FileUtils.cp_r source_path_mini, source_path_mini.sub("Caffeine Mini.app", "Caffeine Deluxe.app")
|
FileUtils.cp_r source_path_mini, source_path_mini.sub("Caffeine Mini.app", "Caffeine Deluxe.app")
|
||||||
|
|
||||||
install_phase.call
|
install_phase
|
||||||
|
|
||||||
expect(target_path_mini).to be_a_directory
|
expect(target_path_mini).to be_a_directory
|
||||||
expect(source_path_mini).not_to exist
|
expect(source_path_mini).not_to exist
|
||||||
@ -63,7 +61,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
target_path_mini.mkpath
|
target_path_mini.mkpath
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
expect(install_phase).to output(<<~EOS).to_stdout
|
expect { install_phase }.to output(<<~EOS).to_stdout
|
||||||
==> Moving App 'Caffeine Pro.app' to '#{target_path_pro}'
|
==> Moving App 'Caffeine Pro.app' to '#{target_path_pro}'
|
||||||
EOS
|
EOS
|
||||||
}.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_mini}'.")
|
}.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_mini}'.")
|
||||||
@ -77,7 +75,7 @@ describe Cask::Artifact::App, :cask do
|
|||||||
target_path_pro.mkpath
|
target_path_pro.mkpath
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
expect(install_phase).to output(<<~EOS).to_stdout
|
expect { install_phase }.to output(<<~EOS).to_stdout
|
||||||
==> Moving App 'Caffeine Mini.app' to '#{target_path_mini}'
|
==> Moving App 'Caffeine Mini.app' to '#{target_path_mini}'
|
||||||
EOS
|
EOS
|
||||||
}.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_pro}'.")
|
}.to raise_error(Cask::CaskError, "It seems there is already an App at '#{target_path_pro}'.")
|
||||||
|
|||||||
@ -3,10 +3,8 @@
|
|||||||
# TODO: this test should be named after the corresponding class, once
|
# TODO: this test should be named after the corresponding class, once
|
||||||
# that class is abstracted from installer.rb
|
# that class is abstracted from installer.rb
|
||||||
describe "Satisfy Dependencies and Requirements", :cask do
|
describe "Satisfy Dependencies and Requirements", :cask do
|
||||||
subject {
|
subject(:install) {
|
||||||
lambda do
|
Cask::Installer.new(cask).install
|
||||||
Cask::Installer.new(cask).install
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
describe "depends_on cask" do
|
describe "depends_on cask" do
|
||||||
@ -14,7 +12,7 @@ describe "Satisfy Dependencies and Requirements", :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask")) }
|
||||||
|
|
||||||
it "installs the dependency of a Cask and the Cask itself" do
|
it "installs the dependency of a Cask and the Cask itself" do
|
||||||
expect(subject).not_to raise_error
|
expect { install }.not_to raise_error
|
||||||
expect(cask).to be_installed
|
expect(cask).to be_installed
|
||||||
expect(dependency).to be_installed
|
expect(dependency).to be_installed
|
||||||
end
|
end
|
||||||
@ -23,7 +21,7 @@ describe "Satisfy Dependencies and Requirements", :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask-cyclic")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-cask-cyclic")) }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
expect(subject).to raise_error(
|
expect { install }.to raise_error(
|
||||||
Cask::CaskCyclicDependencyError,
|
Cask::CaskCyclicDependencyError,
|
||||||
"Cask 'with-depends-on-cask-cyclic' includes cyclic dependencies "\
|
"Cask 'with-depends-on-cask-cyclic' includes cyclic dependencies "\
|
||||||
"on other Casks: with-depends-on-cask-cyclic-helper",
|
"on other Casks: with-depends-on-cask-cyclic-helper",
|
||||||
@ -36,31 +34,41 @@ describe "Satisfy Dependencies and Requirements", :cask do
|
|||||||
context "given an array" do
|
context "given an array" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-array")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-array")) }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "given a comparison" do
|
context "given a comparison" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-comparison")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-comparison")) }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "given a string", :needs_compat do
|
context "given a string", :needs_compat do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("compat/with-depends-on-macos-string")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("compat/with-depends-on-macos-string")) }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "given a symbol" do
|
context "given a symbol" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-symbol")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-symbol")) }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when not satisfied" do
|
context "when not satisfied" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-failure")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-macos-failure")) }
|
||||||
|
|
||||||
it { is_expected.to raise_error(Cask::CaskError) }
|
it "raises an error" do
|
||||||
|
expect { install }.to raise_error(Cask::CaskError)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +76,9 @@ describe "Satisfy Dependencies and Requirements", :cask do
|
|||||||
context "when satisfied" do
|
context "when satisfied" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-arch")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-arch")) }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -81,21 +91,27 @@ describe "Satisfy Dependencies and Requirements", :cask do
|
|||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) }
|
||||||
let(:x11_installed) { true }
|
let(:x11_installed) { true }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when not satisfied" do
|
context "when not satisfied" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11")) }
|
||||||
let(:x11_installed) { false }
|
let(:x11_installed) { false }
|
||||||
|
|
||||||
it { is_expected.to raise_error(Cask::CaskX11DependencyError) }
|
it "does not raise an error" do
|
||||||
|
expect { install }.to raise_error Cask::CaskX11DependencyError
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when depends_on x11: false" do
|
context "when depends_on x11: false" do
|
||||||
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11-false")) }
|
let(:cask) { Cask::CaskLoader.load(cask_path("with-depends-on-x11-false")) }
|
||||||
let(:x11_installed) { false }
|
let(:x11_installed) { false }
|
||||||
|
|
||||||
it { is_expected.not_to raise_error }
|
it "does not raise an error" do
|
||||||
|
expect { install }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -14,10 +14,8 @@ describe Cask::DSL, :cask do
|
|||||||
|
|
||||||
describe "when a Cask includes an unknown method" do
|
describe "when a Cask includes an unknown method" do
|
||||||
let(:attempt_unknown_method) {
|
let(:attempt_unknown_method) {
|
||||||
lambda do
|
Cask::Cask.new("unexpected-method-cask") do
|
||||||
Cask::Cask.new("unexpected-method-cask") do
|
future_feature :not_yet_on_your_machine
|
||||||
future_feature :not_yet_on_your_machine
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,13 +30,13 @@ describe Cask::DSL, :cask do
|
|||||||
EOS
|
EOS
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
expect(attempt_unknown_method).not_to output.to_stdout
|
expect { attempt_unknown_method }.not_to output.to_stdout
|
||||||
}.to output(expected).to_stderr
|
}.to output(expected).to_stderr
|
||||||
end
|
end
|
||||||
|
|
||||||
it "will simply warn, not throw an exception" do
|
it "will simply warn, not throw an exception" do
|
||||||
expect {
|
expect {
|
||||||
attempt_unknown_method.call
|
attempt_unknown_method
|
||||||
}.not_to raise_error
|
}.not_to raise_error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -94,9 +94,8 @@ describe Homebrew::Diagnostic::Checks do
|
|||||||
file = "#{path}/foo-config"
|
file = "#{path}/foo-config"
|
||||||
FileUtils.touch file
|
FileUtils.touch file
|
||||||
FileUtils.chmod 0755, file
|
FileUtils.chmod 0755, file
|
||||||
ENV["HOMEBREW_PATH"] =
|
ENV["HOMEBREW_PATH"] = ENV["PATH"] =
|
||||||
ENV["PATH"] =
|
"#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
|
||||||
"#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}"
|
|
||||||
|
|
||||||
expect(subject.check_for_config_scripts)
|
expect(subject.check_for_config_scripts)
|
||||||
.to match('"config" scripts exist')
|
.to match('"config" scripts exist')
|
||||||
|
|||||||
@ -150,7 +150,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
app 'Foo.app'
|
app 'Foo.app'
|
||||||
%{caveats}
|
%<caveats>s
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
@ -165,7 +165,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
app 'Foo.app'
|
app 'Foo.app'
|
||||||
|
|
||||||
%{caveats}
|
%<caveats>s
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
|
|||||||
@ -202,7 +202,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
%{caveats}
|
%<caveats>s
|
||||||
version :latest
|
version :latest
|
||||||
app 'Foo.app'
|
app 'Foo.app'
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -217,7 +217,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
app 'Foo.app'
|
app 'Foo.app'
|
||||||
%{caveats}
|
%<caveats>s
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
|
|||||||
@ -67,7 +67,7 @@ module Homebrew
|
|||||||
at_exit do
|
at_exit do
|
||||||
col_width = [$times.keys.map(&:size).max.to_i + 2, 15].max
|
col_width = [$times.keys.map(&:size).max.to_i + 2, 15].max
|
||||||
$times.sort_by { |_k, v| v }.each do |method, time|
|
$times.sort_by { |_k, v| v }.each do |method, time|
|
||||||
puts format("%-*s %0.4f sec", col_width, "#{method}:", time)
|
puts format("%<method>-#{col_width}s %<time>0.4f sec", method: "#{method}:", time: time)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -415,7 +415,7 @@ module Kernel
|
|||||||
if ((size * 10).to_i % 10).zero?
|
if ((size * 10).to_i % 10).zero?
|
||||||
"#{size.to_i}#{unit}"
|
"#{size.to_i}#{unit}"
|
||||||
else
|
else
|
||||||
"#{format("%.1f", size)}#{unit}"
|
"#{format("%<size>.1f", size: size)}#{unit}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ def curl_download(*args, to: nil, **options)
|
|||||||
|
|
||||||
range_stdout = curl_output("--location", "--range", "0-1",
|
range_stdout = curl_output("--location", "--range", "0-1",
|
||||||
"--dump-header", "-",
|
"--dump-header", "-",
|
||||||
"--write-out", "%{http_code}",
|
"--write-out", "%\{http_code}",
|
||||||
"--output", "/dev/null", *args, **options).stdout
|
"--output", "/dev/null", *args, **options).stdout
|
||||||
headers, _, http_status = range_stdout.partition("\r\n\r\n")
|
headers, _, http_status = range_stdout.partition("\r\n\r\n")
|
||||||
|
|
||||||
|
|||||||
@ -163,7 +163,7 @@ module GitHub
|
|||||||
# This is a no-op if the user is opting out of using the GitHub API.
|
# This is a no-op if the user is opting out of using the GitHub API.
|
||||||
return block_given? ? yield({}) : {} if ENV["HOMEBREW_NO_GITHUB_API"]
|
return block_given? ? yield({}) : {} if ENV["HOMEBREW_NO_GITHUB_API"]
|
||||||
|
|
||||||
args = ["--header", "Accept: application/vnd.github.v3+json", "--write-out", "\n%{http_code}"]
|
args = ["--header", "Accept: application/vnd.github.v3+json", "--write-out", "\n%\{http_code}"]
|
||||||
args += ["--header", "Accept: application/vnd.github.antiope-preview+json"]
|
args += ["--header", "Accept: application/vnd.github.antiope-preview+json"]
|
||||||
|
|
||||||
token, username = api_credentials
|
token, username = api_credentials
|
||||||
|
|||||||
15
Library/Homebrew/vendor/bundle/bundler/setup.rb
vendored
15
Library/Homebrew/vendor/bundle/bundler/setup.rb
vendored
@ -5,7 +5,7 @@ ruby_version = RbConfig::CONFIG["ruby_version"]
|
|||||||
path = File.expand_path('..', __FILE__)
|
path = File.expand_path('..', __FILE__)
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.5/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.5/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.6.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.6.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.12.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.12.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/thread_safe-0.3.6/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.5/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-1.2.5/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-5.2.3/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-5.2.3/lib"
|
||||||
@ -45,24 +45,23 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mechanize-2.7.6/lib"
|
|||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mustache-1.1.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mustache-1.1.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel-1.17.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel-1.17.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel_tests-2.29.2/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parallel_tests-2.29.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.6.4.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/parser-2.6.5.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.5.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.5.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rainbow-3.0.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rainbow-3.0.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-18/2.3.0/rdiscount-2.2.0.1"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-18/2.3.0/rdiscount-2.2.0.1"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.1/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ronn-0.7.3/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ronn-0.7.3/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.8.2/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.8.3/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-core-3.8.2/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-core-3.8.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-expectations-3.8.4/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-expectations-3.8.5/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-mocks-3.8.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-mocks-3.8.2/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-3.8.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-3.8.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-its-1.3.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-its-1.3.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-retry-0.6.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-retry-0.6.1/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.6.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.6.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.74.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.75.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.4.1/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.5.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.36.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.36.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"
|
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"
|
||||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-cobertura-1.3.1/lib"
|
|
||||||
|
|||||||
@ -44,11 +44,10 @@ Performance/Count:
|
|||||||
# This cop has known compatibility issues with `ActiveRecord` and other
|
# This cop has known compatibility issues with `ActiveRecord` and other
|
||||||
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
||||||
# For more information, see the documentation in the cop itself.
|
# For more information, see the documentation in the cop itself.
|
||||||
# If you understand the known risk, you can disable `SafeMode`.
|
SafeAutoCorrect: false
|
||||||
SafeMode: true
|
|
||||||
Enabled: true
|
Enabled: true
|
||||||
VersionAdded: '0.31'
|
VersionAdded: '0.31'
|
||||||
VersionChanged: '0.39'
|
VersionChanged: '1.5'
|
||||||
|
|
||||||
Performance/Detect:
|
Performance/Detect:
|
||||||
Description: >-
|
Description: >-
|
||||||
@ -59,10 +58,10 @@ Performance/Detect:
|
|||||||
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
||||||
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
||||||
# should be considered unsafe.
|
# should be considered unsafe.
|
||||||
SafeMode: true
|
SafeAutoCorrect: false
|
||||||
Enabled: true
|
Enabled: true
|
||||||
VersionAdded: '0.30'
|
VersionAdded: '0.30'
|
||||||
VersionChanged: '0.39'
|
VersionChanged: '1.5'
|
||||||
|
|
||||||
Performance/DoubleStartEndWith:
|
Performance/DoubleStartEndWith:
|
||||||
Description: >-
|
Description: >-
|
||||||
@ -38,7 +38,6 @@ module RuboCop
|
|||||||
#
|
#
|
||||||
# Model.where(id: [1, 2, 3]).to_a.count { |m| m.method == true }
|
# Model.where(id: [1, 2, 3]).to_a.count { |m| m.method == true }
|
||||||
class Count < Cop
|
class Count < Cop
|
||||||
include SafeMode
|
|
||||||
include RangeHelp
|
include RangeHelp
|
||||||
|
|
||||||
MSG = 'Use `count` instead of `%<selector>s...%<counter>s`.'
|
MSG = 'Use `count` instead of `%<selector>s...%<counter>s`.'
|
||||||
@ -51,8 +50,6 @@ module RuboCop
|
|||||||
PATTERN
|
PATTERN
|
||||||
|
|
||||||
def on_send(node)
|
def on_send(node)
|
||||||
return if rails_safe_mode?
|
|
||||||
|
|
||||||
count_candidate?(node) do |selector_node, selector, counter|
|
count_candidate?(node) do |selector_node, selector, counter|
|
||||||
return unless eligible_node?(node)
|
return unless eligible_node?(node)
|
||||||
|
|
||||||
@ -23,8 +23,6 @@ module RuboCop
|
|||||||
# own meaning. Correcting ActiveRecord methods with this cop should be
|
# own meaning. Correcting ActiveRecord methods with this cop should be
|
||||||
# considered unsafe.
|
# considered unsafe.
|
||||||
class Detect < Cop
|
class Detect < Cop
|
||||||
include SafeMode
|
|
||||||
|
|
||||||
MSG = 'Use `%<prefer>s` instead of ' \
|
MSG = 'Use `%<prefer>s` instead of ' \
|
||||||
'`%<first_method>s.%<second_method>s`.'
|
'`%<first_method>s.%<second_method>s`.'
|
||||||
REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of ' \
|
REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of ' \
|
||||||
@ -38,8 +36,6 @@ module RuboCop
|
|||||||
PATTERN
|
PATTERN
|
||||||
|
|
||||||
def on_send(node)
|
def on_send(node)
|
||||||
return if rails_safe_mode?
|
|
||||||
|
|
||||||
detect_candidate?(node) do |receiver, second_method, args|
|
detect_candidate?(node) do |receiver, second_method, args|
|
||||||
return unless args.empty?
|
return unless args.empty?
|
||||||
return unless receiver
|
return unless receiver
|
||||||
@ -23,7 +23,14 @@ module RuboCop
|
|||||||
'multiple levels.'
|
'multiple levels.'
|
||||||
|
|
||||||
def_node_matcher :flat_map_candidate?, <<-PATTERN
|
def_node_matcher :flat_map_candidate?, <<-PATTERN
|
||||||
(send (block $(send _ ${:collect :map}) ...) ${:flatten :flatten!} $...)
|
(send
|
||||||
|
{
|
||||||
|
(block $(send _ ${:collect :map}) ...)
|
||||||
|
$(send _ ${:collect :map} (block_pass _))
|
||||||
|
}
|
||||||
|
${:flatten :flatten!}
|
||||||
|
$...
|
||||||
|
)
|
||||||
PATTERN
|
PATTERN
|
||||||
|
|
||||||
def on_send(node)
|
def on_send(node)
|
||||||
@ -132,7 +132,7 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
|
|
||||||
def max_key_value_pairs
|
def max_key_value_pairs
|
||||||
Integer(cop_config['MaxKeyValuePairs']) || 2
|
Integer(cop_config['MaxKeyValuePairs'] || 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
# A utility class for checking the use of values within an
|
# A utility class for checking the use of values within an
|
||||||
@ -3,7 +3,7 @@
|
|||||||
module RuboCop
|
module RuboCop
|
||||||
module Performance
|
module Performance
|
||||||
module Version
|
module Version
|
||||||
STRING = '1.4.1'
|
STRING = '1.5.0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user