language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
Homebrew
brew
1b084b5aa021d5399f4bc560ccab715766f09c16.json
gpg2_requirement: use direct 'available?' logic
Library/Homebrew/requirements/gpg2_requirement.rb
@@ -8,5 +8,5 @@ class GPG2Requirement < Requirement # GPGTools installs GnuPG 2.0.x as a `gpg` symlink pointing # to `gpg2`. Our `gnupg` installs only a non-symlink `gpg`. # The aim is to retain support for any version above 2.0. - satisfy(build_env: false) { Gpg.gpg || Gpg.gpg2 } + satisfy(build_env: false) { Gpg.available? } end
false
Other
Homebrew
brew
212367ee7eda101d4514b968e0e48d97b00b5695.json
diagnostic: handle APFS returning hash order
Library/Homebrew/diagnostic.rb
@@ -157,7 +157,7 @@ def __check_stray_files(dir, pattern, white_list, message) end return if files.empty? - inject_file_list(files, message) + inject_file_list(files.sort, message) end def check_for_stray_dylibs
false
Other
Homebrew
brew
e0bb978cc93ab81ffeaa15656fe74384cf7982fc.json
Add tests for `FormulaAuditor#audit_deps` These tests cover a few aspects of the `FormulaAuditor#audit_deps` method. The main focus is the part where FormulaAuditor checks for dependencies on formulas which are tagged `keg_only` with the `:provided_by_macos` reason. For this particular kind of `keg_only` formulas, we expect `brew audit --new-formula` to fail with a problem message like: > Dependency 'bc' may be unnecessary as it is provided by > macOS; try to build this formula without it. For more details, see the relevant discussion: [1] https://github.com/Homebrew/homebrew-core/pull/14067#issuecomment-335046151 [2] https://github.com/Homebrew/brew/pull/3290#issuecomment-335052140
Library/Homebrew/test/dev-cmd/audit_spec.rb
@@ -217,6 +217,74 @@ class Foo < Formula end end + describe "#audit_deps" do + describe "a dependency on a macOS-provided keg-only formula" do + describe "which is whitelisted" do + let(:fa) do + formula_auditor "foo", <<-EOS.undent, new_formula: true + class Foo < Formula + url "http://example.com/foo-1.0.tgz" + homepage "http://example.com" + + depends_on "openssl" + end + EOS + end + + let(:f_openssl) do + formula do + url "http://example.com/openssl-1.0.tgz" + homepage "http://example.com" + + keg_only :provided_by_macos + end + end + + before do + allow(fa.formula.deps.first) + .to receive(:to_formula).and_return(f_openssl) + fa.audit_deps + end + + subject { fa } + + its(:problems) { are_expected.to be_empty } + end + + describe "which is not whitelisted" do + let(:fa) do + formula_auditor "foo", <<-EOS.undent, new_formula: true + class Foo < Formula + url "http://example.com/foo-1.0.tgz" + homepage "http://example.com" + + depends_on "bc" + end + EOS + end + + let(:f_bc) do + formula do + url "http://example.com/bc-1.0.tgz" + homepage "http://example.com" + + keg_only :provided_by_macos + end + end + + before do + allow(fa.formula.deps.first) + .to receive(:to_formula).and_return(f_bc) + fa.audit_deps + end + + subject { fa } + + its(:problems) { are_expected.to match([/unnecessary/]) } + end + end + end + describe "#audit_keg_only_style" do specify "keg_only_needs_downcasing" do fa = formula_auditor "foo", <<-EOS.undent, strict: true
false
Other
Homebrew
brew
99bccaae13b38eeb58c234e48386b2898845f2a1.json
Remove /cask/ from readall file filter
Library/Homebrew/cmd/readall.rb
@@ -14,7 +14,7 @@ module Homebrew def readall if ARGV.include?("--syntax") scan_files = "#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb" - ruby_files = Dir.glob(scan_files).reject{|file| file =~ /vendor|cask/ } + ruby_files = Dir.glob(scan_files).reject{|file| file.include? '/vendor/' } Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files) end
false
Other
Homebrew
brew
487bec957007612956ff97b3912f88768becaa32.json
Move `String#undent` to `compat`.
Library/Homebrew/compat.rb
@@ -26,3 +26,4 @@ require "compat/ENV/std" require "compat/ENV/super" require "compat/utils/shell" +require "compat/extend/string"
true
Other
Homebrew
brew
487bec957007612956ff97b3912f88768becaa32.json
Move `String#undent` to `compat`.
Library/Homebrew/compat/extend/string.rb
@@ -0,0 +1,18 @@ +class String + def undent + gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "") + end + alias unindent undent + + # eg: + # if foo then <<-EOS.undent_________________________________________________________72 + # Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do + # eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad + # minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + # ex ea commodo consequat. Duis aute irure dolor in reprehenderit in + # voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + # sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt + # mollit anim id est laborum. + # EOS + alias undent_________________________________________________________72 undent +end
true
Other
Homebrew
brew
487bec957007612956ff97b3912f88768becaa32.json
Move `String#undent` to `compat`.
Library/Homebrew/extend/string.rb
@@ -2,23 +2,6 @@ require_relative "../vendor/backports/string" class String - def undent - gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "") - end - alias unindent undent - - # eg: - # if foo then <<~EOS_________________________________________________________72 - # Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do - # eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad - # minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip - # ex ea commodo consequat. Duis aute irure dolor in reprehenderit in - # voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur - # sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt - # mollit anim id est laborum. - # EOS - alias undent_________________________________________________________72 undent - # String.chomp, but if result is empty: returns nil instead. # Allows `chuzzle || foo` short-circuits. def chuzzle
true
Other
Homebrew
brew
487bec957007612956ff97b3912f88768becaa32.json
Move `String#undent` to `compat`.
Library/Homebrew/test/string_spec.rb
@@ -1,41 +1,5 @@ require "extend/string" -describe String do - describe "#undent" do - it "removes leading whitespace, taking the first line as reference" do - string = <<-EOS.unindent - hi - ........my friend over - there - EOS - - expect(string).to eq("hi\n........my friend over\n there\n") - end - - it "removes nothing if the text is not indented" do - string = <<-EOS.unindent - hi - I'm not indented - EOS - - expect(string).to eq("hi\nI'm not indented\n") - end - - it "can be nested" do - nested_string = <<~EOS - goodbye - EOS - - string = <<~EOS - hello - #{nested_string} - EOS - - expect(string).to eq("hello\ngoodbye\n\n") - end - end -end - describe StringInreplaceExtension do subject { string.extend(described_class) } let(:string) { "foobar" }
true
Other
Homebrew
brew
558299b039f4b76653ad65c0c7d590885ceeb2fa.json
rubocop.yml: ignore length of manpage comments.
Library/.rubocop.yml
@@ -73,6 +73,8 @@ Metrics/CyclomaticComplexity: Metrics/LineLength: Max: 324 + # ignore manpage comments + IgnoredPatterns: ['#: '] Metrics/MethodLength: Max: 222
false
Other
Homebrew
brew
3ee3b78fbda48821e878feeafc313a9391c5729c.json
pull: Move test_bot_user to a new module GitHub Address the style issue: C: Module has too many lines. [364/360]
Library/Homebrew/dev-cmd/pull.rb
@@ -58,6 +58,18 @@ require "version" require "pkg_version" +module GitHub + module_function + + # Return the corresponding test-bot user name for the given GitHub organization. + def test_bot_user(user) + test_bot = ARGV.value "test-bot-user" + return test_bot if test_bot + return "BrewTestBot" if user.casecmp("homebrew").zero? + "#{user.capitalize}TestBot" + end +end + module Homebrew module_function @@ -231,7 +243,7 @@ def pull url else bottle_branch = "pull-bottle-#{issue}" - "https://github.com/#{test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}" + "https://github.com/#{GitHub.test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}" end curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url @@ -259,13 +271,6 @@ def pull verify_bintray_published(bintray_published_formulae) end - def test_bot_user(user) - test_bot = ARGV.value "test-bot-user" - return test_bot if test_bot - return "BrewTestBot" if user.casecmp("homebrew").zero? - "#{user.capitalize}TestBot" - end - def force_utf8!(str) str.force_encoding("UTF-8") if str.respond_to?(:force_encoding) end
false
Other
Homebrew
brew
d601edaf57ea7968873e3ae9452cec68826d814c.json
vendor-install: use full shasum PATH. Otherwise things can explode if there's a random `shasum`. See #3281.
Library/Homebrew/cmd/vendor-install.sh
@@ -81,9 +81,9 @@ fetch() { trap - SIGINT fi - if [[ -x "$(which shasum)" ]] + if [[ -x "/usr/bin/shasum" ]] then - sha="$(shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)" + sha="$(/usr/bin/shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)" elif [[ -x "$(which sha256sum)" ]] then sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
false
Other
Homebrew
brew
90ca552ba6691e358cd83ee82c5dbe55f59fdb79.json
portable-ruby: use rebuild with coverage support for Linux. This will allow `simplecov` to generate coverage by rebuilding portable Ruby with coverage support.
Library/Homebrew/cmd/vendor-install.sh
@@ -21,8 +21,8 @@ then fi elif [[ -n "$HOMEBREW_LINUX" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.tar.gz" - ruby_SHA="543c18bd33a300e6c16671437b1e0f17b03bb64e6a485fc15ff7de1eb1a0bc2a" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz" + ruby_SHA="33643b1ca6f860d6df01686636326785763e5e81cf0cef37d8a7ab96a6ca1fa1" fi fetch() {
false
Other
Homebrew
brew
dd9415c8d3c07b4fa2ac066e867297ff06c64568.json
remove sneaky empty line
Library/Homebrew/extend/os/mac/caveats.rb
@@ -42,5 +42,4 @@ def plist_caveats end s.join("\n") + "\n" unless s.empty? end - end
false
Other
Homebrew
brew
e882ce1919997ac9c5ba9b17be9b806f9007540f.json
lines_cop: add ENV.universal_binary audit exemption for wine
Library/Homebrew/rubocops/lines_cop.rb
@@ -121,6 +121,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end find_instance_method_call(body_node, "ENV", :universal_binary) do + next if @formula_name == "wine" problem "macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated." end
false
Other
Homebrew
brew
9a323c51078ee9c900fda3ee6b88d1c1e3b26b8f.json
info: pass explicit sort to handle APFS
Library/Homebrew/cmd/info.rb
@@ -67,9 +67,9 @@ def print_info def print_json ff = if ARGV.include? "--all" - Formula + Formula.sort elsif ARGV.include? "--installed" - Formula.installed + Formula.installed.sort else ARGV.formulae end
false
Other
Homebrew
brew
c9684c372754ae1e1335ccf27eda128079ff65d0.json
deps: pass explicit sort to handle APFS
Library/Homebrew/cmd/deps.rb
@@ -68,16 +68,16 @@ def deps if mode.tree? if mode.installed? - puts_deps_tree Formula.installed, !ARGV.one? + puts_deps_tree Formula.installed.sort, !ARGV.one? else raise FormulaUnspecifiedError if ARGV.named.empty? puts_deps_tree ARGV.formulae, !ARGV.one? end elsif mode.all? - puts_deps Formula + puts_deps Formula.sort elsif ARGV.named.empty? raise FormulaUnspecifiedError unless mode.installed? - puts_deps Formula.installed + puts_deps Formula.installed.sort elsif mode.for_each? puts_deps ARGV.formulae else
false
Other
Homebrew
brew
f1b183b287f7b3d94d5cc5093581fe8c1de8be9d.json
list: pass explicit sort to handle APFS
Library/Homebrew/cmd/list.rb
@@ -87,7 +87,7 @@ def list_unbrewed dirs.delete "etc" dirs.delete "var" - args = dirs + %w[-type f (] + args = dirs.sort + %w[-type f (] args.concat UNBREWED_EXCLUDE_FILES.flat_map { |f| %W[! -name #{f}] } args.concat UNBREWED_EXCLUDE_PATHS.flat_map { |d| %W[! -path #{d}] } args.concat %w[)]
false
Other
Homebrew
brew
d9074b80b7617e73084a55d8318da3fb67641bbf.json
options: pass explicit sort to handle APFS
Library/Homebrew/cmd/options.rb
@@ -16,9 +16,9 @@ module Homebrew def options if ARGV.include? "--all" - puts_options Formula.to_a + puts_options Formula.to_a.sort elsif ARGV.include? "--installed" - puts_options Formula.installed + puts_options Formula.installed.sort else raise FormulaUnspecifiedError if ARGV.named.empty? puts_options ARGV.formulae
false
Other
Homebrew
brew
16ea29a641f1672baa1fead658de2b0ad4f308b2.json
diagnostic: pass explicit sort to handle APFS
Library/Homebrew/diagnostic.rb
@@ -804,7 +804,7 @@ def __check_linked_brew(f) def check_for_linked_keg_only_brews return unless HOMEBREW_CELLAR.exist? - linked = Formula.installed.select do |f| + linked = Formula.installed.sort.select do |f| f.keg_only? && __check_linked_brew(f) end return if linked.empty?
false
Other
Homebrew
brew
795c7170e3e8135557b91e477e48cde98a714643.json
leaves: pass explicit sort to handle APFS
Library/Homebrew/cmd/leaves.rb
@@ -9,7 +9,7 @@ module Homebrew module_function def leaves - installed = Formula.installed + installed = Formula.installed.sort deps_of_installed = Set.new installed.each do |f|
false
Other
Homebrew
brew
7b8ba77ed26f84aacc1648eeb78b6d9964adfda2.json
missing: pass explicit sort to handle APFS
Library/Homebrew/cmd/missing.rb
@@ -16,9 +16,9 @@ def missing return unless HOMEBREW_CELLAR.exist? ff = if ARGV.named.empty? - Formula.installed + Formula.installed.sort else - ARGV.resolved_formulae + ARGV.resolved_formulae.sort end ff.each do |f|
false
Other
Homebrew
brew
e98d0fda86719794fd35f42b25a22fad408fd7ef.json
tap: pass explicit sort to handle APFS
Library/Homebrew/tap.rb
@@ -494,7 +494,7 @@ def self.each # an array of all installed {Tap} names. def self.names - map(&:name) + map(&:name).sort end # @private
false
Other
Homebrew
brew
35fae7ce6ab9a8bb0bde731b294771166ed9bdef.json
tap-info: pass explicit sort to handle APFS
Library/Homebrew/cmd/tap-info.rb
@@ -21,10 +21,11 @@ module Homebrew module_function def tap_info + # TODO: This still returns a non-alphabetised list on APFS. if ARGV.include? "--installed" taps = Tap else - taps = ARGV.named.map do |name| + taps = ARGV.named.sort.map do |name| Tap.fetch(name) end end
false
Other
Homebrew
brew
e308df25a9af0e84172448f03a91892a98c92b8a.json
commands: pass explicit sort to handle APFS
Library/Homebrew/cmd/commands.rb
@@ -16,12 +16,12 @@ def commands else # Find commands in Homebrew/cmd puts "Built-in commands" - puts Formatter.columns(internal_commands) + puts Formatter.columns(internal_commands.sort) # Find commands in Homebrew/dev-cmd puts puts "Built-in developer commands" - puts Formatter.columns(internal_developer_commands) + puts Formatter.columns(internal_developer_commands.sort) # Find commands in the path unless (exts = external_commands).empty?
false
Other
Homebrew
brew
ca69d654564246cf4db326dfb905ab02f32828b9.json
update-report: pass explicit sort to handle APFS
Library/Homebrew/cmd/update-report.rb
@@ -598,7 +598,7 @@ def dump_formula_report(key, title) return if formulae.empty? # Dump formula list. ohai title - puts Formatter.columns(formulae) + puts Formatter.columns(formulae.sort) end def installed?(formula)
false
Other
Homebrew
brew
60eb7c6216c389aa1968adee5bad04e12f8d8214.json
uses: pass explicit sort to handle APFS
Library/Homebrew/cmd/uses.rb
@@ -125,7 +125,7 @@ def uses end return if uses.empty? - puts Formatter.columns(uses.map(&:full_name)) + puts Formatter.columns(uses.map(&:full_name).sort) odie "Missing formulae should not have dependents!" if used_formulae_missing end end
false
Other
Homebrew
brew
f6bc7dc4c61f5fb34709da62eb68cfad74f9fd91.json
search: pass explicit sort to handle APFS
Library/Homebrew/cmd/search.rb
@@ -24,7 +24,7 @@ module Homebrew def search if ARGV.empty? - puts Formatter.columns(Formula.full_names) + puts Formatter.columns(Formula.full_names.sort) elsif ARGV.include? "--macports" exec_browser "https://www.macports.org/ports.php?by=name&substr=#{ARGV.next}" elsif ARGV.include? "--fink" @@ -52,15 +52,15 @@ def search results = search_taps(name) end - puts Formatter.columns(results) unless results.empty? + puts Formatter.columns(results.sort) unless results.empty? else query = ARGV.first regex = query_regexp(query) local_results = search_formulae(regex) - puts Formatter.columns(local_results) unless local_results.empty? + puts Formatter.columns(local_results.sort) unless local_results.empty? tap_results = search_taps(query) - puts Formatter.columns(tap_results) unless tap_results.empty? + puts Formatter.columns(tap_results.sort) unless tap_results.empty? if $stdout.tty? count = local_results.length + tap_results.length
false
Other
Homebrew
brew
29070e5cbecad6553b29bb482ce94352682b9c64.json
formula_desc_cop_spec: add empty string test
Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
@@ -27,6 +27,27 @@ class Foo < Formula end end + it "reports an offense when desc is an empty string" do + source = <<-EOS.undent + class Foo < Formula + url 'http://example.com/foo-1.0.tgz' + desc '' + end + EOS + + msg = "The desc (description) should not be an empty string." + expected_offenses = [{ message: msg, + severity: :convention, + line: 3, + column: 2, + source: source }] + + inspect_source(source, "/homebrew-core/Formula/foo.rb") + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + it "When desc is too long" do source = <<-EOS.undent class Foo < Formula
false
Other
Homebrew
brew
a0f48619341c2cf6f1980a019bcd4005cf066e21.json
audit: broaden refute_predicate nudge
Library/Homebrew/dev-cmd/audit.rb
@@ -974,8 +974,8 @@ def line_problems(line, _lineno) problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" end - if line =~ /assert !File\.exist\?/ - problem "Use `refute_predicate <path_to_file>, :exist?` instead of `assert !File.exist?`" + if line =~ /(assert !File\.exist\?|assert !\(.*\)\.exist\?)/ + problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" end return unless @strict
false
Other
Homebrew
brew
efbc1b0cb489ccc35110b4013145ded2abd3e03f.json
Add specs for `CaskLoader`.
Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb
@@ -0,0 +1,57 @@ +describe Hbc::CaskLoader::FromContentLoader do + alias_matcher :be_able_to_load, :be_can_load + + describe "::can_load?" do + it "returns true for Casks specified with `cask \"token\" do … end`" do + expect(described_class).to be_able_to_load <<~EOS + cask "token" do + end + EOS + end + + it "returns true for Casks specified with `cask \"token\" do; end`" do + expect(described_class).to be_able_to_load <<~EOS + cask "token" do; end + EOS + end + + it "returns true for Casks specified with `cask 'token' do … end`" do + expect(described_class).to be_able_to_load <<~EOS + cask 'token' do + end + EOS + end + + it "returns true for Casks specified with `cask 'token' do; end`" do + expect(described_class).to be_able_to_load <<~EOS + cask 'token' do; end + EOS + end + + it "returns true for Casks specified with `cask(\"token\") { … }`" do + expect(described_class).to be_able_to_load <<~EOS + cask("token") { + } + EOS + end + + it "returns true for Casks specified with `cask(\"token\") {}`" do + expect(described_class).to be_able_to_load <<~EOS + cask("token") {} + EOS + end + + it "returns true for Casks specified with `cask('token') { … }`" do + expect(described_class).to be_able_to_load <<~EOS + cask('token') { + } + EOS + end + + it "returns true for Casks specified with `cask('token') {}`" do + expect(described_class).to be_able_to_load <<~EOS + cask('token') {} + EOS + end + end +end
true
Other
Homebrew
brew
efbc1b0cb489ccc35110b4013145ded2abd3e03f.json
Add specs for `CaskLoader`.
Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb
@@ -0,0 +1,21 @@ +describe Hbc::CaskLoader::FromURILoader do + alias_matcher :be_able_to_load, :be_can_load + + describe "::can_load?" do + it "returns true when given an URI" do + expect(described_class).to be_able_to_load(URI("http://example.com/")) + end + + it "returns true when given a String which can be parsed to a URI" do + expect(described_class).to be_able_to_load("http://example.com/") + end + + it "returns false when given a String with Cask contents containing a URL" do + expect(described_class).not_to be_able_to_load <<~EOS + cask 'token' do + url 'http://example.com/' + end + EOS + end + end +end
true
Other
Homebrew
brew
69e2be832cbbaec7f67a77f1daae982e1ea324a4.json
Fix comment location.
Library/Homebrew/.simplecov
@@ -28,13 +28,13 @@ SimpleCov.start do end else command_name "#{command_name} (#{$PROCESS_ID})" - # Not using this during integration tests makes the tests 4x times faster - # without changing the coverage. subdirs = Dir.chdir(SimpleCov.root) { Dir.glob("*") } .reject { |d| d.end_with?(".rb") || ["test", "vendor"].include?(d) } .map { |d| "#{d}/**/*.rb" }.join(",") + # Not using this during integration tests makes the tests 4x times faster + # without changing the coverage. track_files "#{SimpleCov.root}/{#{subdirs},*.rb}" end
false
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/rubocops/extend/formula_cop.rb
@@ -298,7 +298,7 @@ def caveats_strings # Returns the array of arguments of the method_node def parameters(method_node) - method_node.method_args if method_node.send_type? || method_node.block_type? + method_node.arguments if method_node.send_type? || method_node.block_type? end # Returns true if the given parameters are present in method call
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/Gemfile
@@ -1,10 +1,12 @@ source "https://rubygems.org" +require_relative "../constants" + gem "parallel_tests" gem "rspec" gem "rspec-its", require: false gem "rspec-wait", require: false -gem "rubocop" +gem "rubocop", HOMEBREW_RUBOCOP_VERSION group :coverage do gem "codecov", require: false
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/Gemfile.lock
@@ -9,15 +9,15 @@ GEM diff-lcs (1.3) docile (1.1.5) json (2.1.0) - parallel (1.11.2) - parallel_tests (2.14.1) + parallel (1.12.0) + parallel_tests (2.17.0) parallel parser (2.4.0.0) ast (~> 2.2) powerpack (0.1.1) rainbow (2.2.2) rake - rake (12.0.0) + rake (12.1.0) rspec (3.6.0) rspec-core (~> 3.6.0) rspec-expectations (~> 3.6.0) @@ -36,20 +36,20 @@ GEM rspec-support (3.6.0) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (0.49.1) + rubocop (0.50.0) parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.8.1) - simplecov (0.14.1) + ruby-progressbar (1.9.0) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) - unicode-display_width (1.2.1) + simplecov-html (0.10.2) + unicode-display_width (1.3.0) url (0.3.2) PLATFORMS @@ -61,8 +61,8 @@ DEPENDENCIES rspec rspec-its rspec-wait - rubocop + rubocop (= 0.50.0) simplecov BUNDLED WITH - 1.14.6 + 1.15.4
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/bottle_block_cop_spec.rb
@@ -24,7 +24,7 @@ class Foo < Formula column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -60,7 +60,7 @@ class Foo < Formula end EOS - new_source = autocorrect_source(cop, source) + new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/caveats_cop_spec.rb
@@ -25,7 +25,7 @@ def caveats column: 5, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/checksum_cop_spec.rb
@@ -34,7 +34,7 @@ class Foo < Formula column: 14, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -68,7 +68,7 @@ class Foo < Formula column: 14, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -102,7 +102,7 @@ class Foo < Formula column: 31, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -142,7 +142,7 @@ class Foo < Formula column: 20, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -175,7 +175,7 @@ class Foo < Formula column: 12, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -215,7 +215,7 @@ class Foo < Formula end EOS - new_source = autocorrect_source(cop, source) + new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/class_cop_spec.rb
@@ -29,7 +29,7 @@ class Foo < #{formula["class"]} column: 12, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) @@ -49,7 +49,7 @@ class Foo < Formula end EOS - new_source = autocorrect_source(cop, source) + new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) end end @@ -71,7 +71,7 @@ class Foo < Formula column: 0, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/components_order_cop_spec.rb
@@ -21,7 +21,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -47,7 +47,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -74,7 +74,7 @@ def plist column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -99,7 +99,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -129,7 +129,7 @@ class Foo < Formula end EOS - corrected_source = autocorrect_source(cop, source) + corrected_source = autocorrect_source(source) expect(corrected_source).to eq(correct_source) end @@ -156,7 +156,7 @@ class Foo < Formula end end EOS - corrected_source = autocorrect_source(cop, source) + corrected_source = autocorrect_source(source) expect(corrected_source).to eq(correct_source) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/components_redundancy_cop_spec.rb
@@ -23,7 +23,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -46,7 +46,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -70,7 +70,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/conflicts_cop_spec.rb
@@ -22,7 +22,7 @@ class FooAT20 < Formula column: 2, source: source }] - inspect_source(cop, source, "/homebrew-core/Formula/foo@2.0.rb") + inspect_source(source, "/homebrew-core/Formula/foo@2.0.rb") expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -36,7 +36,7 @@ class FooAT20 < Formula desc 'Bar' end EOS - inspect_source(cop, source, "/homebrew-core/Formula/foo@2.0.rb") + inspect_source(source, "/homebrew-core/Formula/foo@2.0.rb") expect(cop.offenses).to eq([]) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/formula_desc_cop_spec.rb
@@ -20,7 +20,7 @@ class Foo < Formula column: 0, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -45,7 +45,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source, "/homebrew-core/Formula/foo.rb") + inspect_source(source, "/homebrew-core/Formula/foo.rb") expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -70,7 +70,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source, "/homebrew-core/Formula/foo.rb") + inspect_source(source, "/homebrew-core/Formula/foo.rb") expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -96,7 +96,7 @@ class Foo < Formula column: 8, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -116,7 +116,7 @@ class Foo < Formula column: 8, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -136,7 +136,7 @@ class Foo < Formula column: 8, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -156,7 +156,7 @@ class Foo < Formula column: 8, source: source }] - inspect_source(cop, source, "/homebrew-core/Formula/foo.rb") + inspect_source(source, "/homebrew-core/Formula/foo.rb") expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) end @@ -176,7 +176,7 @@ class Foo < Formula end EOS - corrected_source = autocorrect_source(cop, source, "/homebrew-core/Formula/foo.rb") + corrected_source = autocorrect_source(source, "/homebrew-core/Formula/foo.rb") expect(corrected_source).to eq(correct_source) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/homepage_cop_spec.rb
@@ -20,7 +20,7 @@ class Foo < Formula column: 0, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -41,7 +41,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -72,7 +72,7 @@ class #{name.capitalize} < Formula end EOS - inspect_source(cop, source) + inspect_source(source) if homepage =~ %r{http:\/\/www\.freedesktop\.org} if homepage =~ /Software/ expected_offenses = [{ message: "#{homepage} should be styled " \
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/lines_cop_spec.rb
@@ -42,7 +42,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) @@ -70,7 +70,7 @@ class Foo<Formula column: 10, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -98,7 +98,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -120,7 +120,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -142,7 +142,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -170,7 +170,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -194,7 +194,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -219,7 +219,7 @@ class Foo < Formula column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -246,7 +246,7 @@ class Foo < Formula column: 7, source: source }] - inspect_source(cop, source, "/homebrew-core/") + inspect_source(source, "/homebrew-core/") expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -274,7 +274,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -299,7 +299,7 @@ def test column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -324,7 +324,7 @@ def options column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -349,7 +349,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -373,7 +373,7 @@ class Foo < Formula column: 5, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -391,7 +391,7 @@ class Wine < Formula end EOS - inspect_source(cop, source, "/homebrew-core/Formula/wine.rb") + inspect_source(source, "/homebrew-core/Formula/wine.rb") expect(cop.offenses).to eq([]) end @@ -412,7 +412,7 @@ class Foo < Formula column: 5, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -436,7 +436,7 @@ class Foo < Formula column: 5, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -458,7 +458,7 @@ class Foo < Formula column: 10, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -474,7 +474,7 @@ class Cctools < Formula end EOS - inspect_source(cop, source, "/homebrew-core/Formula/cctools.rb") + inspect_source(source, "/homebrew-core/Formula/cctools.rb") expect(cop.offenses).to eq([]) end @@ -493,7 +493,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -509,7 +509,7 @@ class KibanaAT44 < Formula end EOS - inspect_source(cop, source, "/homebrew-core/Formula/kibana@4.4.rb") + inspect_source(source, "/homebrew-core/Formula/kibana@4.4.rb") expect(cop.offenses).to eq([]) end end
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/options_cop_spec.rb
@@ -21,7 +21,7 @@ class Foo < Formula column: 10, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -48,7 +48,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -72,7 +72,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -95,7 +95,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -122,7 +122,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/patches_cop_spec.rb
@@ -13,7 +13,7 @@ class Foo < Formula url 'http://example.com/foo-1.0.tgz' end EOS - inspect_source(cop, source) + inspect_source(source) expect(cop.offenses).to eq([]) end @@ -34,7 +34,7 @@ def patches column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -61,7 +61,7 @@ def patches end EOS - inspect_source(cop, source) + inspect_source(source) expected_offense = if patch_url =~ %r{/raw\.github\.com/} [{ message: <<-EOS.undent.chomp, GitHub/Gist patches should specify a revision: @@ -154,7 +154,7 @@ def patches column: 26, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -183,7 +183,7 @@ class Foo < Formula end EOS - inspect_source(cop, source) + inspect_source(source) expected_offense = if patch_url =~ %r{/raw\.github\.com/} [{ message: <<-EOS.undent.chomp, GitHub/Gist patches should specify a revision:
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/text_cop_spec.rb
@@ -24,7 +24,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -48,7 +48,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -73,7 +73,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -98,7 +98,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -123,7 +123,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -148,7 +148,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -173,7 +173,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -210,7 +210,7 @@ def plist; <<-EOS.undent column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -237,7 +237,7 @@ def install column: 0, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -267,7 +267,7 @@ def install column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual) @@ -292,7 +292,7 @@ def install column: 4, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)
true
Other
Homebrew
brew
979519572602a95bcb2b15fb279e92ddad9f4c6c.json
Fix RuboCop tests.
Library/Homebrew/test/rubocops/urls_cop_spec.rb
@@ -126,7 +126,7 @@ class Foo < Formula column: formula["col"], source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) @@ -160,7 +160,7 @@ class Foo < Formula column: formula["col"], source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) @@ -183,7 +183,7 @@ class Foo < Formula column: 2, source: source }] - inspect_source(cop, source) + inspect_source(source) expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) @@ -222,13 +222,13 @@ class Foo < Formula column: formula["col"], source: source }] - inspect_source(cop, source) + inspect_source(source) # Check for expected offenses expected_offenses.zip(cop.offenses.reverse).each do |expected, actual| expect_offense(expected, actual) end # Check for expected auto corrected source - new_source = autocorrect_source(cop, source) + new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) end end
true
Other
Homebrew
brew
a7cf6c1ff038a14b09d433e969c4e4a186d7b6f1.json
Cask AbstractArtifact: fix install order
Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb
@@ -50,8 +50,8 @@ def <=>(other) Vst3Plugin, ScreenSaver, ], - Binary, Pkg, + Binary, PostflightBlock, Zap, ].each_with_index.flat_map { |classes, i| [*classes].map { |c| [c, i] } }.to_h
false
Other
Homebrew
brew
4f8af059dfd0e73f23571747cc703bda29de9b8f.json
os/mac: ignore apps found in Time Machine backups. These can introduce confusion on e.g. outdated Xcode versions when they are the only (or first) versions that are found.
Library/Homebrew/os/mac.rb
@@ -229,7 +229,9 @@ def compilers_standard? end def app_with_bundle_id(*ids) - path = mdfind(*ids).first + path = mdfind(*ids) + .reject { |p| p.include?("/Backups.backupdb/") } + .first Pathname.new(path) unless path.nil? || path.empty? end
false
Other
Homebrew
brew
4e957165d14f14d7dc5a306bf9233ae17b6ed772.json
audit: prefer assert/refute_predicate over File.exist?
Library/Homebrew/dev-cmd/audit.rb
@@ -967,6 +967,14 @@ def line_problems(line, _lineno) problem "Use `assert_match` instead of `assert ...include?`" end + if line =~ /(assert File\.exist\?|File\.exist\?)/ + problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" + end + + if line =~ /(assert !File\.exist\?|!File\.exist\?)/ + problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" + end + return unless @strict problem "`#{Regexp.last_match(1)}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/
false
Other
Homebrew
brew
32c69ed789044cb898146eb0591f809ec09d0c83.json
Update my name in Kickstarter-Supporters
docs/Kickstarter-Supporters.md
@@ -379,7 +379,7 @@ These wonderful people supported our Kickstarter by giving us £10 or more: * [Andrew Brown](http://pvalu.es) * [Bethany Sumner](http://www.bethanysumner.com/) * [Orta](http://orta.io) -* [Michał Gołębiowski](https://github.com/mgol) +* [Michał Gołębiowski-Owczarek](https://github.com/mgol) * [Adam C. Foltzer](http://www.acfoltzer.net/) * [Steve Hiemstra](https://www.speg.com) * [Anton Sipos](http://www.softwarefuturism.com)
false
Other
Homebrew
brew
02362259a54c0b8d7399e7b19f0a56519cb1b9d1.json
Don’t reorder “basic” artifacts.
Library/Homebrew/cask/lib/hbc/artifact.rb
@@ -25,39 +25,5 @@ module Hbc module Artifact - # NOTE: Order is important here! - # - # The `uninstall` stanza should be run first, as it may - # depend on other artifacts still being installed. - # - # We want to extract nested containers before we - # handle any other artifacts. - # - CLASSES = [ - PreflightBlock, - Uninstall, - NestedContainer, - Installer, - App, - Suite, - Artifact, # generic 'artifact' stanza - Colorpicker, - Pkg, - Prefpane, - Qlplugin, - Dictionary, - Font, - Service, - StageOnly, - Binary, - InputMethod, - InternetPlugin, - AudioUnitPlugin, - VstPlugin, - Vst3Plugin, - ScreenSaver, - PostflightBlock, - Zap, - ].freeze end end
true
Other
Homebrew
brew
02362259a54c0b8d7399e7b19f0a56519cb1b9d1.json
Don’t reorder “basic” artifacts.
Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb
@@ -21,34 +21,42 @@ def self.dirmethod end def <=>(other) + return unless other.class < AbstractArtifact + return 0 if self.class == other.class + @@sort_order ||= [ # rubocop:disable Style/ClassVars PreflightBlock, + # The `uninstall` stanza should be run first, as it may + # depend on other artifacts still being installed. Uninstall, + # We want to extract nested containers before we + # handle any other artifacts. NestedContainer, Installer, - App, - Suite, - Artifact, # generic 'artifact' stanza - Colorpicker, - Pkg, - Prefpane, - Qlplugin, - Dictionary, - Font, - Service, - StageOnly, + [ + App, + Suite, + Artifact, + Colorpicker, + Prefpane, + Qlplugin, + Dictionary, + Font, + Service, + InputMethod, + InternetPlugin, + AudioUnitPlugin, + VstPlugin, + Vst3Plugin, + ScreenSaver, + ], Binary, - InputMethod, - InternetPlugin, - AudioUnitPlugin, - VstPlugin, - Vst3Plugin, - ScreenSaver, + Pkg, PostflightBlock, Zap, - ] + ].each_with_index.flat_map { |classes, i| [*classes].map { |c| [c, i] } }.to_h - (@@sort_order.index(self.class) <=> @@sort_order.index(other.class)).to_i + (@@sort_order[self.class] <=> @@sort_order[other.class]).to_i end # TODO: this sort of logic would make more sense in dsl.rb, or a
true
Other
Homebrew
brew
83e2049636d023f8181badf844171fe4f9e5a29f.json
formulary: handle unreadable bottle formula. This occurs for any formulae that use relative `require` to files that are inside of e.g. a tap to use abstract formulae.
Library/Homebrew/formulary.rb
@@ -124,7 +124,15 @@ def initialize(bottle_name) def get_formula(spec, **) contents = Utils::Bottles.formula_contents @bottle_filename, name: name - formula = Formulary.from_contents name, @bottle_filename, contents, spec + formula = begin + Formulary.from_contents name, @bottle_filename, contents, spec + rescue FormulaUnreadableError => e + opoo <<-EOS.undent + Unreadable formula in #{@bottle_filename}: + #{e} + EOS + super + end formula.local_bottle_path = @bottle_filename formula end
false
Other
Homebrew
brew
4f55565677101a1a3b63567ce937b8cf72eae252.json
Add test for php version in URL middle
Library/Homebrew/test/version_spec.rb
@@ -649,6 +649,11 @@ .to be_detected_from("ftp://gcc.gnu.org/pub/gcc/snapshots/6-20151227/gcc-6-20151227.tar.bz2") end + specify "semver in middle of URL" do + expect(Version.create("7.1.10")) + .to be_detected_from("https://php.net/get/php-7.1.10.tar.gz/from/this/mirror") + end + specify "from URL" do expect(Version.create("1.2.3")) .to be_detected_from("http://github.com/foo/bar.git", tag: "v1.2.3")
false
Other
Homebrew
brew
9d36096d68d5b362f223b993ac7662588450d942.json
Add version detection support for php URL Pulls a semver from anywhere in the URL (not just stem).
Library/Homebrew/version.rb
@@ -456,6 +456,10 @@ def self._parse(spec) # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz m = /\.v(\d+[a-z]?)/.match(stem) return m.captures.first unless m.nil? + + # e.g. https://secure.php.net/get/php-7.1.10.tar.bz2/from/this/mirror + m = /[-.vV]?((?:\d+\.)+\d+(?:[-_.]?(?i:alpha|beta|pre|rc)\.?\d{,2})?)/.match(spec_s) + return m.captures.first unless m.nil? end end
false
Other
Homebrew
brew
03ae6aae3b95447bc79398b3c58a9fcee67e98ef.json
text_files: Skip the formula in .brew/formula.rb
Library/Homebrew/keg_relocate.rb
@@ -124,6 +124,7 @@ def text_files next true if pn.symlink? next true if pn.directory? next false if pn.basename.to_s == "orig-prefix.txt" # for python virtualenvs + next true if pn == self/".brew/#{name}.rb" next true if Metafiles::EXTENSIONS.include?(pn.extname) if pn.text_executable? text_files << pn
false
Other
Homebrew
brew
a8ca47d294d1399393c4f066e0bebd356d500148.json
diagnostic: remove unnecessary blank line.
Library/Homebrew/diagnostic.rb
@@ -791,7 +791,6 @@ def check_coretap_git_origin branch = coretap_path.git_branch return if branch.nil? || branch =~ /master/ - <<-EOS.undent Homebrew/homebrew-core is not on the master branch
false
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/cask/lib/hbc/cli/info.rb
@@ -23,6 +23,7 @@ def self.info(cask) installation_info(cask) repo_info(cask) name_info(cask) + language_info(cask) artifact_info(cask) Installer.print_caveats(cask) end @@ -51,6 +52,13 @@ def self.name_info(cask) puts cask.name.empty? ? Formatter.error("None") : cask.name end + def self.language_info(cask) + return if cask.languages.empty? + + ohai "Languages" + puts cask.languages.join(", ") + end + def self.repo_info(cask) user, repo, token = QualifiedToken.parse(Hbc.all_tokens.detect { |t| t.split("/").last == cask.token })
true
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/cask/lib/hbc/dsl.rb
@@ -63,6 +63,7 @@ class DSL :gpg, :homepage, :language, + :languages, :name, :sha256, :staged_path, @@ -139,6 +140,12 @@ def language_eval @language = @language_blocks.default.call end + def languages + return [] if @language_blocks.nil? + + @language_blocks.keys.flatten + end + def url(*args, &block) set_unique_stanza(:url, args.empty? && !block_given?) do begin
true
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/test/cask/cli/info_spec.rb
@@ -90,6 +90,38 @@ EOS end + it "should print languages if the Cask provided any" do + expect { + Hbc::CLI::Info.run("with-languages") + }.to output(<<-EOS.undent).to_stdout + with-languages: 1.2.3 + http://example.com/local-caffeine + Not installed + From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/with-languages.rb + ==> Name + None + ==> Languages + zh, en-US + ==> Artifacts + Caffeine.app (App) + EOS + end + + it 'should not print "Languages" section divider if the languages block has no output' do + expect { + Hbc::CLI::Info.run("with-conditional-languages") + }.to output(<<-EOS.undent).to_stdout + with-conditional-languages: 1.2.3 + http://example.com/local-caffeine + Not installed + From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/with-conditional-languages.rb + ==> Name + None + ==> Artifacts + Caffeine.app (App) + EOS + end + describe "when no Cask is specified" do it "raises an exception" do expect {
true
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/test/cask/dsl_spec.rb
@@ -177,6 +177,36 @@ expect(cask.call.sha256).to eq("xyz789") expect(cask.call.url.to_s).to eq("https://example.org/en-US.zip") end + + it "returns empty array if no languages specified" do + cask = lambda do + Hbc::Cask.new("cask-with-apps") do + url "https://example.org/file.zip" + end + end + + expect(cask.call.languages).to be_empty + end + + it "returns an array of available languages" do + cask = lambda do + Hbc::Cask.new("cask-with-apps") do + language "zh" do + sha256 "abc123" + "zh-CN" + end + + language "en-US", default: true do + sha256 "xyz789" + "en-US" + end + + url "https://example.org/file.zip" + end + end + + expect(cask.call.languages).to eq(["zh", "en-US"]) + end end describe "app stanza" do
true
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/test/support/fixtures/cask/Casks/with-conditional-languages.rb
@@ -0,0 +1,9 @@ +cask 'with-conditional-languages' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end
true
Other
Homebrew
brew
92311901c9d85e0e43147386535118b66ca718cd.json
add available languages to cask info command add language tests for dsl add fixtures, tests for languages info output add extra lines
Library/Homebrew/test/support/fixtures/cask/Casks/with-languages.rb
@@ -0,0 +1,18 @@ +cask 'with-languages' do + version '1.2.3' + + language "zh" do + sha256 "abc123" + "zh-CN" + end + + language "en-US", default: true do + sha256 "xyz789" + "en-US" + end + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end
true
Other
Homebrew
brew
7cadff0a33d062b526d2ac246bd1d9e6cc689f53.json
Use `PATH` where possible.
Library/Homebrew/dev-cmd/update-test.rb
@@ -81,7 +81,7 @@ def update_test safe_system "git", "reset", "--hard", start_commit # update ENV["PATH"] - ENV["PATH"] = "#{curdir}/bin:#{ENV["PATH"]}" + ENV["PATH"] = PATH.new(ENV["PATH"]).prepend(curdir/"bin") # run brew update oh1 "Running brew update..."
true
Other
Homebrew
brew
7cadff0a33d062b526d2ac246bd1d9e6cc689f53.json
Use `PATH` where possible.
Library/Homebrew/utils.rb
@@ -264,7 +264,7 @@ def inject_dump_stats!(the_module, pattern) def with_system_path old_path = ENV["PATH"] - ENV["PATH"] = "/usr/bin:/bin" + ENV["PATH"] = PATH.new("/usr/bin", "/bin") yield ensure ENV["PATH"] = old_path
true
Other
Homebrew
brew
bcca2a7c6b80a6450bd8261af987a8da260b6b89.json
brew: handle Ruby 2.3 more gracefully. - `brew.rb` needed updated to fail unless on Ruby 2.3 - `brew update` should unset `HOMEBREW_RUBY_PATH` to ensure that this doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been installed.
Library/Homebrew/brew.rb
@@ -5,8 +5,12 @@ std_trap = trap("INT") { exit! 130 } # no backtrace thanks # check ruby version before requiring any modules. -RUBY_TWO = RUBY_VERSION.split(".").first.to_i >= 2 -raise "Homebrew must be run under Ruby 2!" unless RUBY_TWO +RUBY_VERSION_SPLIT = RUBY_VERSION.split "." +RUBY_X = RUBY_VERSION_SPLIT[0].to_i +RUBY_Y = RUBY_VERSION_SPLIT[1].to_i +if RUBY_X < 2 || (RUBY_X == 2 && RUBY_Y < 3) + raise "Homebrew must be run under Ruby 2.3!" +end require "pathname" HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
true
Other
Homebrew
brew
bcca2a7c6b80a6450bd8261af987a8da260b6b89.json
brew: handle Ruby 2.3 more gracefully. - `brew.rb` needed updated to fail unless on Ruby 2.3 - `brew update` should unset `HOMEBREW_RUBY_PATH` to ensure that this doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been installed.
Library/Homebrew/cmd/update.sh
@@ -570,6 +570,7 @@ EOS -d "$HOMEBREW_LIBRARY/LinkedKegs" || (-n "$HOMEBREW_DEVELOPER" && -z "$HOMEBREW_UPDATE_PREINSTALL") ]] then + unset HOMEBREW_RUBY_PATH brew update-report "$@" return $? elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]]
true
Other
Homebrew
brew
bcca2a7c6b80a6450bd8261af987a8da260b6b89.json
brew: handle Ruby 2.3 more gracefully. - `brew.rb` needed updated to fail unless on Ruby 2.3 - `brew update` should unset `HOMEBREW_RUBY_PATH` to ensure that this doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been installed.
Library/Homebrew/dev-cmd/update-test.rb
@@ -81,7 +81,7 @@ def update_test safe_system "git", "reset", "--hard", start_commit # update ENV["PATH"] - ENV["PATH"] = "#{curdir}/bin:/usr/local/bin:/usr/bin:/bin" + ENV["PATH"] = "#{curdir}/bin:#{ENV["PATH"]}" # run brew update oh1 "Running brew update..."
true
Other
Homebrew
brew
56149c725a97280396e74c4afa948fbe7e554e3d.json
travis.yml: update Xcode version.
.travis.yml
@@ -11,7 +11,7 @@ matrix: fast_finish: true include: - os: osx - osx_image: xcode8.3 + osx_image: xcode9 rvm: system - os: linux sudo: false
false
Other
Homebrew
brew
479544665b9e6edf66c7add1eb6b3c98d98de384.json
Support UN M.49 region codes.
Library/Homebrew/locale.rb
@@ -2,9 +2,9 @@ class Locale class ParserError < StandardError end - LANGUAGE_REGEX = /(?:[a-z]{2,3})/ # ISO 639-1 or ISO 639-2 - REGION_REGEX = /(?:[A-Z]{2})/ # ISO 3166-1 - SCRIPT_REGEX = /(?:[A-Z][a-z]{3})/ # ISO 15924 + LANGUAGE_REGEX = /(?:[a-z]{2,3})/ # ISO 639-1 or ISO 639-2 + REGION_REGEX = /(?:[A-Z]{2}|\d{3})/ # ISO 3166-1 or UN M.49 + SCRIPT_REGEX = /(?:[A-Z][a-z]{3})/ # ISO 15924 LOCALE_REGEX = /\A((?:#{LANGUAGE_REGEX}|#{REGION_REGEX}|#{SCRIPT_REGEX})(?:\-|$)){1,3}\Z/
true
Other
Homebrew
brew
479544665b9e6edf66c7add1eb6b3c98d98de384.json
Support UN M.49 region codes.
Library/Homebrew/test/locale_spec.rb
@@ -9,6 +9,10 @@ expect(described_class.parse("zh-CN-Hans")).to eql(described_class.new("zh", "CN", "Hans")) end + it "correctly parses a string with a UN M.49 region code" do + expect(described_class.parse("es-419")).to eql(described_class.new("es", "419", nil)) + end + context "raises a ParserError when given" do it "an empty string" do expect { described_class.parse("") }.to raise_error(Locale::ParserError)
true
Other
Homebrew
brew
3ed832d4f0465aa9d938d3f4867ad12aaf394710.json
BottleLoader: Use the formula stored in the bottle
Library/Homebrew/exceptions.rb
@@ -555,12 +555,12 @@ def initialize(resource) # raised when a single patch file is not found and apply hasn't been specified class MissingApplyError < RuntimeError; end -class BottleVersionMismatchError < RuntimeError - def initialize(bottle_file, bottle_version, formula, formula_version) +class BottleFormulaUnavailableError < RuntimeError + def initialize(bottle_path, formula_path) super <<-EOS.undent - Bottle version mismatch - Bottle: #{bottle_file} (#{bottle_version}) - Formula: #{formula.full_name} (#{formula_version}) + This bottle does not contain the formula file: + #{bottle_path} + #{formula_path} EOS end end
true
Other
Homebrew
brew
3ed832d4f0465aa9d938d3f4867ad12aaf394710.json
BottleLoader: Use the formula stored in the bottle
Library/Homebrew/formulary.rb
@@ -122,14 +122,10 @@ def initialize(bottle_name) super name, Formulary.path(full_name) end - def get_formula(spec, alias_path: nil) - formula = super + def get_formula(spec, **) + contents = Utils::Bottles.formula_contents @bottle_filename, name: name + formula = Formulary.from_contents name, @bottle_filename, contents, spec formula.local_bottle_path = @bottle_filename - formula_version = formula.pkg_version - bottle_version = Utils::Bottles.resolve_version(@bottle_filename) - unless formula_version == bottle_version - raise BottleVersionMismatchError.new(@bottle_filename, bottle_version, formula, formula_version) - end formula end end
true
Other
Homebrew
brew
3ed832d4f0465aa9d938d3f4867ad12aaf394710.json
BottleLoader: Use the formula stored in the bottle
Library/Homebrew/test/exceptions_spec.rb
@@ -181,8 +181,8 @@ class Baz < Formula; end its(:to_s) { is_expected.to eq("Resource <resource foo> is defined more than once") } end -describe BottleVersionMismatchError do - subject { described_class.new("/foo.bottle.tar.gz", "1.0", formula, "1.1") } +describe BottleFormulaUnavailableError do + subject { described_class.new("/foo.bottle.tar.gz", "foo/1.0/.brew/foo.rb") } let(:formula) { double(Formula, full_name: "foo") } - its(:to_s) { is_expected.to match(/Bottle version mismatch/) } + its(:to_s) { is_expected.to match(/This bottle does not contain the formula file/) } end
true
Other
Homebrew
brew
7974ce24b619f921071dc607f0ea1a50e5379b9f.json
Fix regex style
Library/Homebrew/diagnostic.rb
@@ -789,7 +789,7 @@ def check_coretap_git_origin return if ENV["CI"] || ENV["JENKINS_HOME"] branch = coretap_path.git_branch - return if branch.nil? || branch =~ %r{master} + return if branch.nil? || branch =~ /master/ <<-EOS.undent
false
Other
Homebrew
brew
222da9de1ce1b75433458a79a76e747408202cf9.json
portable-ruby: use rebuild with coverage support. This will allow `simplecov` to generate coverage by rebuilding portable Ruby with coverage support.
Library/Homebrew/cmd/vendor-install.sh
@@ -13,8 +13,8 @@ if [[ -n "$HOMEBREW_MACOS" ]] then if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.tar.gz" - ruby_SHA="9060cdddbc5b5a0cc7188a251c40b2845e9d8b8ce346c83c585a965a111cab54" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz" + ruby_SHA="34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b" else ruby_URL="" ruby_SHA="" @@ -45,6 +45,11 @@ fetch() { curl_args[${#curl_args[*]}]="--progress-bar" fi + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100600" ]] + then + curl_args[${#curl_args[*]}]="--insecure" + fi + temporary_path="$CACHED_LOCATION.incomplete" mkdir -p "$HOMEBREW_CACHE"
false
Other
Homebrew
brew
745f5abc55fccdf7fb27b7ac4889bf8c8bcb5187.json
README: add Commsworld logo. They host our physical hardware.
README.md
@@ -65,6 +65,10 @@ Our Jenkins CI installation is hosted by [DigitalOcean](https://m.do.co/c/7e39c3 ![DigitalOcean](https://cloud.githubusercontent.com/assets/125011/26827038/4b7b5ade-4ab3-11e7-811b-fed3ab0e934d.png) +Our physical hardware is hosted by [Commsworld](https://www.commsworld.com). + +![Commsworld powered by Fluency](https://user-images.githubusercontent.com/125011/30822845-1716bc2c-a222-11e7-843e-ea7c7b6a1503.png) + Our bottles (binary packages) are hosted by [Bintray](https://bintray.com/homebrew). [![Downloads by Bintray](https://bintray.com/docs/images/downloads_by_bintray_96.png)](https://bintray.com/homebrew)
false
Other
Homebrew
brew
dd75dd8a25b6e60b4f87c2220335e5bd37b9cc0f.json
os/mac/version: allow leopard_64_or_later bottles.
Library/Homebrew/os/mac/version.rb
@@ -12,6 +12,7 @@ class Version < ::Version mountain_lion: "10.8", lion: "10.7", snow_leopard: "10.6", + leopard_64: "10.5", leopard: "10.5", tiger: "10.4", }.freeze
false
Other
Homebrew
brew
598ea0cdece3646ce1c202862e01a4464180ed88.json
portable-ruby: fix installation on Leopard. Download it insecurely there and require `rubygems` for `Gem::Version`.
Library/Homebrew/cmd/vendor-install.sh
@@ -45,6 +45,11 @@ fetch() { curl_args[${#curl_args[*]}]="--progress-bar" fi + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100600" ]] + then + curl_args[${#curl_args[*]}]="--insecure" + fi + temporary_path="$CACHED_LOCATION.incomplete" mkdir -p "$HOMEBREW_CACHE"
true
Other
Homebrew
brew
598ea0cdece3646ce1c202862e01a4464180ed88.json
portable-ruby: fix installation on Leopard. Download it insecurely there and require `rubygems` for `Gem::Version`.
Library/Homebrew/utils/ruby.sh
@@ -37,7 +37,7 @@ setup-ruby-path() { if [[ -n "$HOMEBREW_RUBY_PATH" ]] then - ruby_old_version="$("$HOMEBREW_RUBY_PATH" -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")" + ruby_old_version="$("$HOMEBREW_RUBY_PATH" -rrubygems -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")" fi if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
true
Other
Homebrew
brew
aa665b94587ee7b0d69e783a669269a9954e8428.json
portable-ruby: improve installation messaging. - Use “Pouring” to be more consistent with our normal messaging. - Don’t be silent by default.
Library/Homebrew/cmd/vendor-install.sh
@@ -135,7 +135,7 @@ install() { fi safe_cd "$VENDOR_DIR" - [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Unpacking $(basename "$VENDOR_URL")" + [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Pouring $(basename "$VENDOR_URL")" tar "$tar_args" "$CACHED_LOCATION" safe_cd "$VENDOR_DIR/portable-$VENDOR_NAME"
true
Other
Homebrew
brew
aa665b94587ee7b0d69e783a669269a9954e8428.json
portable-ruby: improve installation messaging. - Use “Pouring” to be more consistent with our normal messaging. - Don’t be silent by default.
Library/Homebrew/utils/ruby.sh
@@ -22,7 +22,7 @@ setup-ruby-path() { if [[ $(readlink "$vendor_ruby_current_version") != "$(<"$vendor_dir/portable-ruby-version")" ]] then - if ! brew vendor-install ruby --quiet + if ! brew vendor-install ruby then onoe "Failed to upgrade vendor Ruby." fi @@ -42,7 +42,7 @@ setup-ruby-path() { if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] then - brew vendor-install ruby --quiet + brew vendor-install ruby if [[ ! -x "$vendor_ruby_path" ]] then odie "Failed to install vendor Ruby."
true
Other
Homebrew
brew
df7fb212c264e0ebe92b1e312f783d20e3e6fbe3.json
brew.sh: update no git repository message. Clarify that this message doesn’t only trigger when there’s no Git repository but also when there’s no tags that `git describe` can use.
Library/Homebrew/brew.sh
@@ -23,7 +23,7 @@ HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbr HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION" if [[ -z "$HOMEBREW_VERSION" ]] then - HOMEBREW_VERSION=">1.2.0 (no git repository)" + HOMEBREW_VERSION=">1.2.0 (shallow or no git repository)" HOMEBREW_USER_AGENT_VERSION="1.X.Y" fi
false
Other
Homebrew
brew
5fa4d60c7b6c6d0e8488ad3a7d6649233af4fb2e.json
Replace String#% with Kernel.#format
Library/Homebrew/test/version_spec.rb
@@ -248,11 +248,11 @@ end failure_message do |expected| - format = <<-EOS + message = <<-EOS expected: %s detected: %s EOS - format % [expected, detected] + format(message, expected, detected) end end
false
Other
Homebrew
brew
557105640b5154e3fe1299aa31abdc106aa71df5.json
Add a failure message to be_detected_from matcher
Library/Homebrew/test/version_spec.rb
@@ -241,8 +241,18 @@ describe "::detect" do matcher :be_detected_from do |url, specs = {}| - match do |version| - Version.detect(url, specs) == version + detected = Version.detect(url, specs) + + match do |expected| + detected == expected + end + + failure_message do |expected| + format = <<-EOS + expected: %s + detected: %s + EOS + format % [expected, detected] end end
false
Other
Homebrew
brew
353810d934ad807449ed360d950662a5cc92e94b.json
Upgrade vendored Ruby to 2.3.3 for Linux.
Library/Homebrew/cmd/vendor-install.sh
@@ -21,8 +21,8 @@ then fi elif [[ -n "$HOMEBREW_LINUX" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.0.0-p648.x86_64_linux.bottle.tar.gz" - ruby_SHA="dbb5118a22a6a75cc77e62544a3d8786d383fab1bdaf8c154951268807357bf0" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.tar.gz" + ruby_SHA="543c18bd33a300e6c16671437b1e0f17b03bb64e6a485fc15ff7de1eb1a0bc2a" fi fetch() {
false
Other
Homebrew
brew
b2b413165f3553c48c8e060dd97ccde9c13cae80.json
Upgrade vendored Ruby to 2.3.3. Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
.travis.yml
@@ -15,7 +15,7 @@ matrix: rvm: system - os: linux sudo: false - rvm: 2.0.0 + rvm: 2.3.3 before_install: - export HOMEBREW_NO_AUTO_UPDATE=1
true
Other
Homebrew
brew
b2b413165f3553c48c8e060dd97ccde9c13cae80.json
Upgrade vendored Ruby to 2.3.3. Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
Library/Homebrew/cmd/vendor-install.sh
@@ -13,8 +13,8 @@ if [[ -n "$HOMEBREW_MACOS" ]] then if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.0.0-p648.leopard_64.bottle.tar.gz" - ruby_SHA="5c1240abe4be91c9774a0089c2a38a8ccfff87c009e8e5786730c659d5e633f7" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.tar.gz" + ruby_SHA="9060cdddbc5b5a0cc7188a251c40b2845e9d8b8ce346c83c585a965a111cab54" else ruby_URL="" ruby_SHA=""
true
Other
Homebrew
brew
b2b413165f3553c48c8e060dd97ccde9c13cae80.json
Upgrade vendored Ruby to 2.3.3. Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
Library/Homebrew/extend/os/mac/diagnostic.rb
@@ -195,8 +195,8 @@ def check_for_other_package_managers end def check_ruby_version - ruby_version = "2.0" - return if RUBY_VERSION[/\d\.\d/] == ruby_version + ruby_version = "2.3.3" + return if RUBY_VERSION == ruby_version return if ARGV.homebrew_developer? && OS::Mac.prerelease? <<-EOS.undent
true
Other
Homebrew
brew
b2b413165f3553c48c8e060dd97ccde9c13cae80.json
Upgrade vendored Ruby to 2.3.3. Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
Library/Homebrew/utils/ruby.sh
@@ -2,7 +2,8 @@ setup-ruby-path() { local vendor_dir local vendor_ruby_current_version local vendor_ruby_path - local ruby_version_major + local ruby_old_version + local minimum_ruby_version="2.3.3" vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor" vendor_ruby_current_version="$vendor_dir/portable-ruby/current" @@ -36,12 +37,10 @@ setup-ruby-path() { if [[ -n "$HOMEBREW_RUBY_PATH" ]] then - ruby_version_major="$("$HOMEBREW_RUBY_PATH" --version)" - ruby_version_major="${ruby_version_major#ruby }" - ruby_version_major="${ruby_version_major%%.*}" + ruby_old_version="$("$HOMEBREW_RUBY_PATH" -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")" fi - if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] + if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]] then brew vendor-install ruby --quiet if [[ ! -x "$vendor_ruby_path" ]]
true
Other
Homebrew
brew
b2b413165f3553c48c8e060dd97ccde9c13cae80.json
Upgrade vendored Ruby to 2.3.3. Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
Library/Homebrew/vendor/portable-ruby-version
@@ -1 +1 @@ -2.0.0-p648 +2.3.3
true
Other
Homebrew
brew
733d485065e55ad1cf159eec89927c4990bbdfaf.json
superenv: help Autotools with 10.13 SDK on 10.12 The GNU Autotools tests for whether futimens and utimensat are available reliably come to incorrect conclusions on 10.12 with the 10.13 SDK in Xcode 9. This overrides its decisions by forcing the right answer in superenv using ac_cv_func_* environment variables and setting them to "no" on 10.12.
Library/Homebrew/extend/os/mac/extend/ENV/super.rb
@@ -96,9 +96,12 @@ def setup_build_environment(formula = nil) self["SDKROOT"] = MacOS.sdk_path end - # Filter out symbols known not to be defined on 10.11 since GNU Autotools - # can't reliably figure this out with Xcode 8 on its own yet. - if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0" + # Filter out symbols known not to be defined since GNU Autotools can't + # reliably figure this out with Xcode 8 and above. + if MacOS.version == "10.12" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "9.0" + ENV["ac_cv_func_futimens"] = "no" + ENV["ac_cv_func_utimensat"] = "no" + elsif MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0" %w[basename_r clock_getres clock_gettime clock_settime dirname_r getentropy mkostemp mkostemps timingsafe_bcmp].each do |s| ENV["ac_cv_func_#{s}"] = "no"
false
Other
Homebrew
brew
8bf28477a3da58ea5c6113d9ce3228c08c4c0ec0.json
popen: Add an options argument Useful for selectively enabling or silencing stderr, for example. popen_read("foo", err: :err)
Library/Homebrew/utils/popen.rb
@@ -1,20 +1,20 @@ module Utils - def self.popen_read(*args, &block) - popen(args, "rb", &block) + def self.popen_read(*args, **options, &block) + popen(args, "rb", options, &block) end - def self.popen_write(*args, &block) - popen(args, "wb", &block) + def self.popen_write(*args, **options, &block) + popen(args, "wb", options, &block) end - def self.popen(args, mode) + def self.popen(args, mode, options = {}) IO.popen("-", mode) do |pipe| if pipe return pipe.read unless block_given? yield pipe else - $stderr.reopen("/dev/null", "w") - exec(*args) + options[:err] ||= :close + exec(*args, options) end end end
false
Other
Homebrew
brew
626cb6ca91f99df6f7c646d95cb5e82d0dd6532d.json
audit: Add more tests for FormulaAudit/Miscellaneous cop
Library/Homebrew/test/rubocops/lines_cop_spec.rb
@@ -380,6 +380,21 @@ class Foo < Formula end end + it "with build.universal? exempted formula" do + source = <<-EOS.undent + class Wine < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build.universal? + "foo" + end + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/wine.rb") + expect(cop.offenses).to eq([]) + end + it "with ENV.universal_binary" do source = <<-EOS.undent class Foo < Formula @@ -450,6 +465,19 @@ class Foo < Formula end end + it "with ruby-macho alternatives audit exempted formula" do + source = <<-EOS.undent + class Cctools < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "install_name_tool", "-id" + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/cctools.rb") + expect(cop.offenses).to eq([]) + end + it "with npm install without language::Node args" do source = <<-EOS.undent class Foo < Formula @@ -471,5 +499,18 @@ class Foo < Formula expect_offense(expected, actual) end end + + it "with npm install without language::Node args in kibana" do + source = <<-EOS.undent + class KibanaAT44 < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "npm", "install" + end + EOS + + inspect_source(cop, source, "/homebrew-core/Formula/kibana@4.4.rb") + expect(cop.offenses).to eq([]) + end end end
false
Other
Homebrew
brew
e12d2746b65d46f07e3ecc737d07926118dfb278.json
os/mac/diagnostic: allow custom Ruby for devs. This avoids `brew doctor` warnings on High Sierra but in general this is a good idea for future versions and to allow Homebrew developers to test things out with different versions of Ruby.
Library/Homebrew/extend/os/mac/diagnostic.rb
@@ -197,6 +197,7 @@ def check_for_other_package_managers def check_ruby_version ruby_version = "2.0" return if RUBY_VERSION[/\d\.\d/] == ruby_version + return if ARGV.homebrew_developer? && OS::Mac.prerelease? <<-EOS.undent Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew
true
Other
Homebrew
brew
e12d2746b65d46f07e3ecc737d07926118dfb278.json
os/mac/diagnostic: allow custom Ruby for devs. This avoids `brew doctor` warnings on High Sierra but in general this is a good idea for future versions and to allow Homebrew developers to test things out with different versions of Ruby.
Library/Homebrew/test/os/mac/diagnostic_spec.rb
@@ -47,15 +47,10 @@ end specify "#check_ruby_version" do - allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.13")) - stub_const("RUBY_VERSION", "2.3.3p222") + allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.12")) + stub_const("RUBY_VERSION", "1.8.6") expect(subject.check_ruby_version) - .to match <<-EOS.undent - Ruby version 2.3.3p222 is unsupported on 10.13. Homebrew - is developed and tested on Ruby 2.0, and may not work correctly - on other Rubies. Patches are accepted as long as they don't cause breakage - on supported Rubies. - EOS + .to match "Ruby version 1.8.6 is unsupported on 10.12" end end
true
Other
Homebrew
brew
03ace9b1104f1ddc2adc75a68531167d7e3ea7e0.json
Require more HTTP mirrors for old OS X versions. This allows the bootstrap of `curl` and `git` on versions of Mac OS X that cannot reliably download from HTTPS servers any longer. Once these are both installed users are able to update Homebrew and download files securely. Also, as we're doing this, don't point 10.5 users to Tigerbrew as they are already given caveats for using Homebrew itself.
Library/Homebrew/dev-cmd/audit.rb
@@ -202,12 +202,12 @@ def initialize(formula, options = {}) @specs = %w[stable devel head].map { |s| formula.send(s) }.compact end - def self.check_http_content(url, name, user_agents: [:default], check_content: false, strict: false) + def self.check_http_content(url, user_agents: [:default], check_content: false, strict: false, require_http: false) return unless url.start_with? "http" details = nil user_agent = nil - hash_needed = url.start_with?("http:") && name != "curl" + hash_needed = url.start_with?("http:") && !require_http user_agents.each do |ua| details = http_content_headers_and_checksum(url, hash_needed: hash_needed, user_agent: ua) user_agent = ua @@ -576,7 +576,6 @@ def audit_homepage return unless DevelopmentTools.curl_handles_most_https_homepages? if http_content_problem = FormulaAuditor.check_http_content(homepage, - formula.name, user_agents: [:browser, :default], check_content: true, strict: @strict) @@ -629,13 +628,14 @@ def audit_specs end %w[Stable Devel HEAD].each do |name| - next unless spec = formula.send(name.downcase) + spec_name = name.downcase.to_sym + next unless spec = formula.send(spec_name) - ra = ResourceAuditor.new(spec, online: @online, strict: @strict).audit + ra = ResourceAuditor.new(spec, spec_name, online: @online, strict: @strict).audit problems.concat ra.problems.map { |problem| "#{name}: #{problem}" } spec.resources.each_value do |resource| - ra = ResourceAuditor.new(resource, online: @online, strict: @strict).audit + ra = ResourceAuditor.new(resource, spec_name, online: @online, strict: @strict).audit problems.concat ra.problems.map { |problem| "#{name} resource #{resource.name.inspect}: #{problem}" } @@ -1086,20 +1086,22 @@ def devel_only?(formula) end class ResourceAuditor - attr_reader :problems - attr_reader :version, :checksum, :using, :specs, :url, :mirrors, :name + attr_reader :name, :version, :checksum, :url, :mirrors, :using, :specs, :owner + attr_reader :spec_name, :problems - def initialize(resource, options = {}) + def initialize(resource, spec_name, options = {}) @name = resource.name @version = resource.version @checksum = resource.checksum @url = resource.url @mirrors = resource.mirrors @using = resource.using @specs = resource.specs - @online = options[:online] - @strict = options[:strict] - @problems = [] + @owner = resource.owner + @spec_name = spec_name + @online = options[:online] + @strict = options[:strict] + @problems = [] end def audit @@ -1173,11 +1175,26 @@ def audit_download_strategy problem "Redundant :using value in URL" end + def self.curl_git_openssl_and_deps + @curl_git_openssl_and_deps ||= begin + formulae_names = ["curl", "git", "openssl"] + formulae_names += formulae_names.flat_map do |f| + Formula[f].recursive_dependencies.map(&:name) + end + formulae_names.uniq + rescue FormulaUnavailableError + [] + end + end + def audit_urls urls = [url] + mirrors - if name == "curl" && !urls.find { |u| u.start_with?("http://") } && url != Formula["curl"].head.url - problem "should always include at least one HTTP url" + require_http = ResourceAuditor.curl_git_openssl_and_deps.include?(owner.name) + + if spec_name == :stable && require_http && + !urls.find { |u| u.start_with?("http://") } + problem "should always include at least one HTTP mirror" end return unless @online @@ -1189,7 +1206,7 @@ def audit_urls # A `brew mirror`'ed URL is usually not yet reachable at the time of # pull request. next if url =~ %r{^https://dl.bintray.com/homebrew/mirror/} - if http_content_problem = FormulaAuditor.check_http_content(url, name) + if http_content_problem = FormulaAuditor.check_http_content(url, name, require_http: require_http) problem http_content_problem end elsif strategy <= GitDownloadStrategy
true