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 | def6b1eaf74cab3be2c807ca5609df3fa98bb8c9.json | Use Keg#uninstall to clean up kegs | Library/Homebrew/cmd/cleanup.rb | @@ -70,7 +70,7 @@ def cleanup_keg keg
puts "Would remove: #{keg}"
else
puts "Removing: #{keg}..."
- keg.rmtree
+ keg.uninstall
end
end
| false |
Other | Homebrew | brew | acf76f3f5502846f21933cbf77302f332f18c1c1.json | Add module for logging filesystem leaks in tests | Library/Homebrew/test/testing_env.rb | @@ -90,8 +90,32 @@ def assert_version_tokens tokens, version
end
end
+ module FSLeakLogger
+ def self.included(klass)
+ require "find"
+ @@log = File.open("fs_leak_log", "w")
+ klass.make_my_diffs_pretty!
+ end
+
+ def before_setup
+ @__files_before_test = []
+ Find.find(TES... | false |
Other | Homebrew | brew | 76e86891e4846b6b728ac87d3af76820e662d975.json | Remove opt link in Keg#uninstall | Library/Homebrew/cmd/uninstall.rb | @@ -11,7 +11,6 @@ def uninstall
puts "Uninstalling #{keg}..."
keg.unlink
keg.uninstall
- rm_opt_link keg.fname
rm_pin keg.fname
end
end
@@ -29,7 +28,6 @@ def uninstall
end
end
- rm_opt_link name
rm_pin name
... | true |
Other | Homebrew | brew | 76e86891e4846b6b728ac87d3af76820e662d975.json | Remove opt link in Keg#uninstall | Library/Homebrew/keg.rb | @@ -97,6 +97,12 @@ def initialize path
def uninstall
rmtree
parent.rmdir_if_possible
+
+ opt = HOMEBREW_PREFIX.join("opt", fname)
+ if opt.symlink? && self == opt.resolved_path
+ opt.unlink
+ opt.parent.rmdir_if_possible
+ end
end
def unlink | true |
Other | Homebrew | brew | de24d731725a0a6be1339fbdd879f12a136c037d.json | Use Keg#uninstall to uninstall kegs | Library/Homebrew/cmd/uninstall.rb | @@ -22,8 +22,11 @@ def uninstall
if rack.directory?
puts "Uninstalling #{name}..."
- rack.subdirs.each { |d| Keg.new(d).unlink }
- rack.rmtree
+ rack.subdirs.each do |d|
+ keg = Keg.new(d)
+ keg.unlink
+ keg.uninstall
+ end
... | true |
Other | Homebrew | brew | de24d731725a0a6be1339fbdd879f12a136c037d.json | Use Keg#uninstall to uninstall kegs | Library/Homebrew/test/test_keg.rb | @@ -25,6 +25,16 @@ def setup
mkpath HOMEBREW_PREFIX/"lib"
end
+ def teardown
+ @keg.unlink
+ @keg.uninstall
+
+ $stdout = @old_stdout
+
+ rmtree HOMEBREW_PREFIX/"bin"
+ rmtree HOMEBREW_PREFIX/"lib"
+ end
+
def test_linking_keg
assert_equal 3, @keg.link
(HOMEBREW_PREFIX/"bin").chi... | true |
Other | Homebrew | brew | bcfc9d8cf79b6586c4da467dc2e50b0044e1b958.json | Remove linked kegs directory when empty | Library/Homebrew/keg.rb | @@ -120,7 +120,11 @@ def unlink
Find.prune if src.directory?
end
end
- linked_keg_record.unlink if linked_keg_record.symlink?
+
+ if linked_keg_record.symlink?
+ linked_keg_record.unlink
+ linked_keg_record.parent.rmdir_if_possible
+ end
dirs.reverse_each(&:rmdir_if_possib... | false |
Other | Homebrew | brew | f222ca04fd31b0cd05e25b0c92b27049802147bb.json | Remove pin directory when empty | Library/Homebrew/formula_pin.rb | @@ -23,6 +23,7 @@ def pin
def unpin
path.unlink if pinned?
+ PINDIR.rmdir_if_possible
end
def pinned? | true |
Other | Homebrew | brew | f222ca04fd31b0cd05e25b0c92b27049802147bb.json | Remove pin directory when empty | Library/Homebrew/test/test_formula_pin.rb | @@ -27,19 +27,17 @@ def test_pinnable_if_kegs_exist
assert_predicate @pin, :pinnable?
end
- def test_pin
+ def test_unpin
(@f.rack+'0.1').mkpath
@pin.pin
+
assert_predicate @pin, :pinned?
assert_equal 1, FormulaPin::PINDIR.children.length
- end
- def test_unpin
- (@f.rack+'0.1').m... | true |
Other | Homebrew | brew | f25f6fbb3981b64022b07e453a1583aa6915185a.json | Fix directory leaks in formula prefix tests | Library/Homebrew/test/test_formula.rb | @@ -58,7 +58,7 @@ def test_installed_prefix_head_installed
prefix.mkpath
assert_equal prefix, f.installed_prefix
ensure
- prefix.rmtree
+ f.rack.rmtree
end
def test_installed_prefix_devel_installed
@@ -73,7 +73,7 @@ def test_installed_prefix_devel_installed
prefix.mkpath
assert_equa... | false |
Other | Homebrew | brew | 9a6d2a31d9cf7e608d575b1507cd6d287b770988.json | Fix directory leak in test_cleanup | Library/Homebrew/test/test_cmd_cleanup.rb | @@ -23,5 +23,8 @@ def test_cleanup
refute_predicate f1, :installed?
refute_predicate f2, :installed?
assert_predicate f3, :installed?
+ ensure
+ [f1, f2, f3].each(&:clear_cache)
+ f3.rack.rmtree
end
end | false |
Other | Homebrew | brew | 98e01d2b83710f5317447a9857cf1b98d14f19d2.json | Fix directory leak in test_argv | Library/Homebrew/test/test_ARGV.rb | @@ -17,7 +17,7 @@ def test_argv_kegs
@argv << 'mxcl'
assert_equal 1, @argv.kegs.length
ensure
- keg.rmtree
+ keg.parent.rmtree
end
def test_argv_named | false |
Other | Homebrew | brew | 4d14cafaa543ebeb133d65a6e82967509c223ae8.json | Fix directory leak in test_cleaner | Library/Homebrew/test/test_cleaner.rb | @@ -11,7 +11,7 @@ def setup
end
def teardown
- @f.prefix.rmtree if @f.prefix.exist?
+ @f.rack.rmtree if @f.rack.exist?
end
def test_clean_file | false |
Other | Homebrew | brew | 9f03b285738d5f82d4ecaaa1807eb1888177ce14.json | Fix directory leak in test_pathname_version | Library/Homebrew/test/test_versions.rb | @@ -96,6 +96,8 @@ def test_pathname_version
d = HOMEBREW_CELLAR/'foo-0.1.9'
d.mkpath
assert_equal version('0.1.9'), d.version
+ ensure
+ d.unlink
end
def test_no_version | false |
Other | Homebrew | brew | 8d12684efe43e20b62d4f20836c673051107246e.json | Pass repository path into the updater | Library/Homebrew/cmd/update.rb | @@ -25,7 +25,7 @@ def update
unlink_tap_formula(tapped_formulae)
report = Report.new
- master_updater = Updater.new
+ master_updater = Updater.new(HOMEBREW_REPOSITORY)
begin
master_updater.pull!
ensure
@@ -39,7 +39,7 @@ def update
each_tap do |user, repo|
repo.cd do
- ... | true |
Other | Homebrew | brew | 8d12684efe43e20b62d4f20836c673051107246e.json | Pass repository path into the updater | Library/Homebrew/test/test_updater.rb | @@ -4,7 +4,7 @@
class UpdaterTests < Homebrew::TestCase
class UpdaterMock < ::Updater
- def initialize(*args)
+ def initialize(*)
super
@outputs = Hash.new { |h, k| h[k] = [] }
@expected = []
@@ -42,7 +42,7 @@ def self.fixture_data
end
def setup
- @updater = UpdaterMock.new
+... | true |
Other | Homebrew | brew | 61e633426a6a53b1a2821af79b2d21a04d9bcb2e.json | Remove obsolete constant
Formula that use this do not load anymore. | Library/Homebrew/compat/formula.rb | @@ -44,6 +44,3 @@ def self.factory(name)
Formulary.factory(name)
end
end
-
-class UnidentifiedFormula < Formula
-end | false |
Other | Homebrew | brew | 4e817eaa6c46694ba4868a559f92aa064ef177af.json | Remove FormulaPin dependency on FileUtils | Library/Homebrew/formula_pin.rb | @@ -1,5 +1,3 @@
-require 'fileutils'
-
class FormulaPin
PINDIR = Pathname.new("#{HOMEBREW_LIBRARY}/PinnedKegs")
@@ -12,9 +10,9 @@ def path
end
def pin_at(version)
- PINDIR.mkpath unless PINDIR.exist?
+ PINDIR.mkpath
version_path = @f.rack.join(version)
- FileUtils.ln_s(version_path, path) un... | false |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/formula.rb | @@ -26,7 +26,7 @@ class Formula
attr_accessor :local_bottle_path
- def initialize(name, path)
+ def initialize(name, path, spec)
@name = name
@path = path
@homepage = self.class.homepage | true |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/formulary.rb | @@ -46,8 +46,8 @@ def initialize(name, path)
end
# Gets the formula instance.
- def get_formula
- klass.new(name, path)
+ def get_formula(spec)
+ klass.new(name, path, spec)
end
# Return the Class for this formula, `require`-ing it if
@@ -98,7 +98,7 @@ def initialize bottle_name
... | true |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/test/test_formula.rb | @@ -6,8 +6,9 @@ def test_formula_instantiation
klass = Class.new(Formula) { url "http://example.com/foo-1.0.tar.gz" }
name = "formula_name"
path = Formula.path(name)
+ spec = :stable
- f = klass.new(name, path)
+ f = klass.new(name, path, spec)
assert_equal name, f.name
assert_equal ... | true |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/test/test_formula_install.rb | @@ -59,7 +59,7 @@ def test_script_install
url "file://#{File.expand_path(__FILE__)}"
version "1"
def initialize
- super "test_script_formula", Pathname.new(__FILE__).expand_path
+ super "test_script_formula", Pathname.new(__FILE__).expand_path, :stable
end
end.new
| true |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/test/testball.rb | @@ -1,7 +1,7 @@
require 'formula'
class TestBall < Formula
- def initialize(name="test_ball", path=Pathname.new(__FILE__).expand_path)
+ def initialize(name="test_ball", path=Pathname.new(__FILE__).expand_path, spec=:stable)
self.class.instance_eval do
stable.url "file://#{TEST_DIRECTORY}/tarballs/tes... | true |
Other | Homebrew | brew | 5beaa512e61f7222d4f19569b8118f9e1f02a18f.json | Pass the requested spec into the formula instance | Library/Homebrew/test/testing_env.rb | @@ -95,8 +95,8 @@ class TestCase < ::Minitest::Test
TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze
TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze
- def formula(name="formula_name", path=Formula.path(name), &block)
- @_f = Class.new(Formula, &... | true |
Other | Homebrew | brew | 8976a960df0a4768be3a6df77874a151535e14f7.json | brew-test-bot: use Dir[] for globbing | Library/Contributions/cmd/brew-test-bot.rb | @@ -471,8 +471,8 @@ def run
raise "Missing Jenkins variables!" unless jenkins and job and id
ARGV << '--verbose'
- copied = system "cp #{jenkins}/jobs/\"#{job}\"/configurations/axis-version/*/builds/#{id}/archive/*.bottle*.* ."
- exit unless copied
+ cp_args = Dir["#{jenkins}/jobs/#{job}/configurations/axis-... | false |
Other | Homebrew | brew | 1c176348caf6f6d220a1f877433a3ea581ab3030.json | doctor: add caveats to avoid scaring people.
Sporadically people ask to whitelist doctor warnings or file issues when
there's nothing actually wrong. Help reassure such people with a
friendly message.
Closes Homebrew/homebrew#30230.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/doctor.rb | @@ -1130,8 +1130,16 @@ def doctor
methods.each do |method|
out = checks.send(method)
unless out.nil? or out.empty?
+ if first_warning
+ puts <<-EOS.undent
+ #{Tty.white}Please note that these warnings are just used to help the Homebrew maintainers
+ with debuggin... | false |
Other | Homebrew | brew | cca11731ca5842b65764344a2ce955764a0c9c42.json | Remove play, replaced by typesafe-activator
In Play 2.3 the play command has become the activator command. Play has
been updated to use Activator.
People should use typesafe-activator formula instead.
You can read more about this change at:
http://www.playframework.com/documentation/2.3.x/Migration23
and
http://www.... | Library/Homebrew/blacklist.rb | @@ -79,5 +79,14 @@ def blacklisted? name
GNU Fortran is now provided as part of GCC, and can be installed with:
brew install gcc
EOS
+ when 'play' then <<-EOS.undent
+ Since Play 2.3 the play command has become the activator command.
+ Play has been updated to use Activator. It can be installed ... | false |
Other | Homebrew | brew | 4f8be5bb66033ae1cd3e15a75f1a35ac1174440b.json | Remove obsolete doctor check
Both build environments remove MACOSX_DEPLOYMENT_TARGET by default. | Library/Homebrew/cmd/doctor.rb | @@ -871,18 +871,6 @@ def check_for_linked_keg_only_brews
end
end
-def check_for_MACOSX_DEPLOYMENT_TARGET
- target = ENV.fetch('MACOSX_DEPLOYMENT_TARGET') { return }
-
- unless target == MacOS.version.to_s then <<-EOS.undent
- MACOSX_DEPLOYMENT_TARGET was set to #{target.inspect}
- This is used by Fink, bu... | false |
Other | Homebrew | brew | d9c586e201b6d5ebfd7ccfe466808a2214494c0f.json | Remove unnecessary string evals from doctor | Library/Homebrew/cmd/doctor.rb | @@ -377,20 +377,19 @@ def check_access_usr_local
end
%w{include etc lib lib/pkgconfig share}.each do |d|
- class_eval <<-EOS, __FILE__, __LINE__ + 1
- def check_access_#{d.sub("/", "_")}
- if (dir = HOMEBREW_PREFIX+'#{d}').exist? && !dir.writable_real?
- <<-EOF.undent
- \#{dir} isn't writable... | false |
Other | Homebrew | brew | c4cdd2b7ac2b55ffcba227e43e67a7462229ecf4.json | Use .each, not .all? to enumerate formulae | Library/Homebrew/cmd/versions.rb | @@ -11,7 +11,7 @@ def versions
Please use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions
EOS
- ARGV.formulae.all? do |f|
+ ARGV.formulae.each do |f|
versions = FormulaVersions.new(f)
path = versions.repository_path
versions.each do |versi... | false |
Other | Homebrew | brew | 88aaa36bec984ed84d148dee6c3d56d92c96f026.json | Remove unused require | Library/Homebrew/cmd/list.rb | @@ -11,7 +11,6 @@ def list
return unless HOMEBREW_CELLAR.exist?
if ARGV.include? '--pinned'
- require 'formula'
list_pinned
elsif ARGV.include? '--versions'
list_versions | false |
Other | Homebrew | brew | b87f9b37d6b75f514111098dbb460fdbc8054161.json | Pull requires out of methods | Library/Homebrew/cmd/doctor.rb | @@ -1,5 +1,7 @@
-require 'cmd/missing'
-require 'version'
+require "cmd/missing"
+require "formula"
+require "keg"
+require "version"
class Volumes
def initialize
@@ -181,7 +183,6 @@ def check_for_other_package_managers
end
def check_for_broken_symlinks
- require 'keg'
broken_symlinks = []
Keg::PRUNE... | true |
Other | Homebrew | brew | b87f9b37d6b75f514111098dbb460fdbc8054161.json | Pull requires out of methods | Library/Homebrew/cmd/info.rb | @@ -1,9 +1,10 @@
-require 'formula'
-require 'tab'
-require 'keg'
-require 'caveats'
-require 'blacklist'
-require 'utils/json'
+require "blacklist"
+require "caveats"
+require "cmd/options"
+require "formula"
+require "keg"
+require "tab"
+require "utils/json"
module Homebrew
def info
@@ -128,7 +129,6 @@ def inf... | true |
Other | Homebrew | brew | 4fd63dc4f8670df9b0ded98eb9a30f004069e4b8.json | Expose inreplace as a class method | Library/Homebrew/cmd/bottle.rb | @@ -33,10 +33,6 @@
EOS
module Homebrew extend self
- class << self
- include Utils::Inreplace
- end
-
def keg_contains string, keg
if not ARGV.homebrew_developer?
return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg
@@ -236,7 +232,7 @@ def merge
f = Formul... | true |
Other | Homebrew | brew | 4fd63dc4f8670df9b0ded98eb9a30f004069e4b8.json | Expose inreplace as a class method | Library/Homebrew/utils/inreplace.rb | @@ -20,5 +20,6 @@ def inreplace paths, before=nil, after=nil
Pathname(path).atomic_write(s)
end
end
+ module_function :inreplace
end
end | true |
Other | Homebrew | brew | fb7ce8c4847bc6bacd8b6f3fb684332228847df7.json | Fix a typo | Library/Contributions/example-formula.rb | @@ -250,7 +250,7 @@ def install
# patch you have to resort to `inreplace`, because in the patch
# you don't have access to any var defined by the formula. Only
# HOMEBREW_PREFIX is available in the embedded patch.
- # inreplace supports reg. exes.
+ # inreplace supports regular expressions.
in... | false |
Other | Homebrew | brew | c73baa39cb466e941af14227157b200f188b4d05.json | Add explicit mkpath to Pathname#write_env_script | Library/Homebrew/extend/pathname.rb | @@ -362,6 +362,7 @@ def write_exec_script *targets
def write_env_script target, env
env_export = ''
env.each {|key, value| env_export += "#{key}=\"#{value}\" "}
+ dirname.mkpath
self.write <<-EOS.undent
#!/bin/bash
#{env_export}exec "#{target}" "$@" | false |
Other | Homebrew | brew | 5cbc5437f5578aa206cefe131072f3cc4738e69c.json | Add explicit mkpath to Pathname#write_jar_script | Library/Homebrew/extend/pathname.rb | @@ -380,6 +380,7 @@ def env_script_all_files dst, env
# Writes an exec script that invokes a java jar
def write_jar_script target_jar, script_name, java_opts=""
+ mkpath
(self+script_name).write <<-EOS.undent
#!/bin/bash
exec java #{java_opts} -jar #{target_jar} "$@" | false |
Other | Homebrew | brew | d96f15e324d6757f8bb85fbd12cea777e0abc9bf.json | Add explicit mkpath to Pathname#write_exec_script | Library/Homebrew/extend/pathname.rb | @@ -348,6 +348,7 @@ def write_exec_script *targets
opoo "tried to write exec scripts to #{self} for an empty list of targets"
return
end
+ mkpath
targets.each do |target|
target = Pathname.new(target) # allow pathnames or strings
(self+target.basename()).write <<-EOS.undent | false |
Other | Homebrew | brew | 9b4bb3d9e4b1ea9380595d9f673d86b529f6b297.json | Fix retry condition when auto-tapping deps
Fixes Homebrew/homebrew#30212. | Library/Homebrew/formula_installer.rb | @@ -91,10 +91,15 @@ def prelude
end
def verify_deps_exist
- f.recursive_dependencies.map(&:to_formula)
- rescue TapFormulaUnavailableError => e
- Homebrew.install_tap(e.user, e.repo)
- retry
+ begin
+ f.recursive_dependencies.map(&:to_formula)
+ rescue TapFormulaUnavailableError => e
+ ... | false |
Other | Homebrew | brew | ff047a88a5b2d8ff1446332ee9773da5e197332d.json | Move aplus to the boneyard
Does not compile with modern compilers and has not been updated
since 2008.
Closes Homebrew/homebrew#30040. | Library/Homebrew/tap_migrations.rb | @@ -1,6 +1,7 @@
TAP_MIGRATIONS = {
"agedu" => "homebrew/headonly",
"aimage" => "homebrew/boneyard",
+ "aplus" => "homebrew/boneyard",
"apple-gcc42" => "homebrew/versions",
"appledoc" => "homebrew/boneyard",
"appswitch" => "homebrew/binary", | false |
Other | Homebrew | brew | be1822dd728b4ca3d6b3be528ae067de482810e4.json | Place alias adjacent to aliased method | Library/Homebrew/compilers.rb | @@ -10,6 +10,10 @@ class CompilerFailure
attr_reader :compiler, :major_version
attr_rw :cause, :version
+ # Allows Apple compiler `fails_with` statements to keep using `build`
+ # even though `build` and `version` are the same internally
+ alias_method :build, :version
+
MESSAGES = {
:cxx11 => 'This ... | false |
Other | Homebrew | brew | ff2d8fece3ff9645d4a26ca285604e597d15db7e.json | Remove unused method alias
Unlike CompilerFailure, the interface of Compiler is entirely internal,
so we don't need to maintain compatibility with anything. | Library/Homebrew/compilers.rb | @@ -1,13 +1,4 @@
class Compiler < Struct.new(:name, :version, :priority)
- # This is exposed under the `build` name for compatibility, since
- # `fails_with` continues to use `build` in the public API.
- # `build` indicates the build number of an Apple compiler.
- # This is preferred over version numbers since the... | false |
Other | Homebrew | brew | 86942aeaeeb96bc44f32ac3a485f4aec8026dbf6.json | Remove an internal method from compat | Library/Homebrew/compat/fails_with_llvm.rb | @@ -4,10 +4,6 @@ def fails_with_llvm msg=nil, data=nil
puts "Use the fails_with DSL instead"
end
- def fails_with_llvm?
- fails_with? :llvm
- end
-
def self.fails_with_llvm msg=nil, data={}
data = msg if Hash === msg
fails_with(:llvm) { build(data.delete(:build).to_i) } | false |
Other | Homebrew | brew | e91f359a56f8c798a35df06ab028af85ee423ddf.json | Remove an unnecessary use of ARGV.build_head? | Library/Homebrew/download_strategy.rb | @@ -364,7 +364,7 @@ def _fetch
class SubversionDownloadStrategy < VCSDownloadStrategy
def cache_tag
- ARGV.build_head? ? "svn-HEAD" : "svn"
+ resource.version.head? ? "svn-HEAD" : "svn"
end
def repo_valid? | false |
Other | Homebrew | brew | 5c24876d024e3789fe5e87e31e9315c0eb1dfee6.json | Fix audit suggestion | Library/Homebrew/cmd/audit.rb | @@ -416,7 +416,7 @@ def audit_line(line, lineno)
end
if line =~ /if\s+ARGV\.include\?\s+'--(HEAD|devel)'/
- problem "Use \"if ARGV.build_#{$1.downcase}?\" instead"
+ problem "Use \"if build.#{$1.downcase}?\" instead"
end
if line =~ /make && make/ | false |
Other | Homebrew | brew | 89ba5b2b0a9ba25aacd51baa367d963d9915f62f.json | brew-test-bot: fix FormulaUnavailableError handling | Library/Contributions/cmd/brew-test-bot.rb | @@ -126,7 +126,12 @@ def initialize argument
@formulae = []
url_match = argument.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX
- formula = Formula.factory argument rescue FormulaUnavailableError
+
+ begin
+ formula = Formulary.factory(argument)
+ rescue FormulaUnavailableError
+ end
+
git "r... | false |
Other | Homebrew | brew | 299b272c6c244bc703828d6f91052dd87ac5d35c.json | brew-test-bot: make test commands shell-safe | Library/Contributions/cmd/brew-test-bot.rb | @@ -36,7 +36,7 @@ def initialize test, command, options={}
@category = test.category
@command = command
@puts_output_on_success = options[:puts_output_on_success]
- @name = command.split[1].delete '-'
+ @name = command[1].delete("-")
@status = :running
@repository = HOMEBREW_REPOSITORY
... | false |
Other | Homebrew | brew | d487c3d97827ac9ff976cde5a5d587236a8ffb4c.json | brew-test-bot: remove dead code | Library/Contributions/cmd/brew-test-bot.rb | @@ -391,19 +391,12 @@ def test cmd, options={}
end
def check_results
- message = "All tests passed and raring to brew."
-
status = :passed
steps.each do |step|
case step.status
when :passed then next
when :running then raise
- when :failed then
- if status == :pas... | false |
Other | Homebrew | brew | 03488424cb8faf5d82f81767fa9a1442d5ce386a.json | Handle non-ASCII output encoded as ASCII
Some tool involved in `brew install node` is emitting UTF-8 even though
LANG and LC_ALL are unset. Since the external encoding is US-ASCII, we
need to guard against bad data here. | Library/Contributions/cmd/brew-test-bot.rb | @@ -522,7 +522,11 @@ def run
failure = testcase.add_element 'failure' if step.failed?
if step.has_output?
# Remove invalid XML CData characters from step output.
- output = REXML::CData.new step.output.delete("\000\a\b\e\f")
+ output = step.output
+ if output.respond_to?(:for... | false |
Other | Homebrew | brew | d3ad1212fb175d22627e42d9da15ce8c8eeb5b6b.json | Make compiler objects directly | Library/Homebrew/test/test_fails_with.rb | @@ -2,10 +2,6 @@
require 'test/testball'
class FailsWithTests < Test::Unit::TestCase
- class Double < Compiler
- attr_accessor :name, :version
- end
-
def assert_fails_with(cc)
assert @f.new.fails_with?(cc)
end
@@ -18,11 +14,8 @@ def fails_with(*args, &block)
@f.fails_with(*args, &block)
end... | false |
Other | Homebrew | brew | 4c0d2c2bfb99d91be404e9c05e3b569ffa7dcc39.json | Handle failures in temporary_install better | Library/Homebrew/test/test_formula_install.rb | @@ -10,21 +10,20 @@ def teardown
end
def temporary_install f
- # Brew and install the given formula
+ f.prefix.mkpath
+ keg = Keg.new(f.prefix)
+
shutup do
f.brew { f.install }
end
- # Allow the test to do some processing
- yield
+ begin
+ yield
+ ensure
+ keg.u... | false |
Other | Homebrew | brew | 1beefdb5d06d5ec07714aede24dce020ff6b0b37.json | Remove repeated test code | Library/Homebrew/test/test_formula_install.rb | @@ -63,12 +63,6 @@ def initialize
end
end.new
- temporary_install f do
- shutup do
- f.brew { f.install }
- end
-
- assert_equal 1, f.bin.children.length
- end
+ temporary_install(f) { assert_equal 1, f.bin.children.length }
end
end | false |
Other | Homebrew | brew | e9cf30eb2c576507cd6e096cf7f5ab3ffad494f9.json | Support older Minitest constant | Library/Homebrew/cmd/test.rb | @@ -9,6 +9,8 @@ module Homebrew extend self
if Object.const_defined?(:Minitest)
FailedAssertion = Minitest::Assertion
+ elsif Object.const_defined?(:MiniTest)
+ FailedAssertion = MiniTest::Assertion
else
FailedAssertion = Test::Unit::AssertionFailedError
end | false |
Other | Homebrew | brew | 9a554f5f4b41d49ce0dd7e9f8c09ee519c1cb2e2.json | Use example.com as domain in tests | Library/Homebrew/test/test_dependency_collector.rb | @@ -111,19 +111,19 @@ def test_does_not_mutate_dependency_spec
def test_resource_dep_git_url
resource = Resource.new
- resource.url("git://github.com/foo/bar.git")
+ resource.url("git://example.com/foo/bar.git")
assert_instance_of GitDependency, @d.add(resource)
end
def test_resource_dep_gz... | true |
Other | Homebrew | brew | 9a554f5f4b41d49ce0dd7e9f8c09ee519c1cb2e2.json | Use example.com as domain in tests | Library/Homebrew/test/test_download_strategies.rb | @@ -4,7 +4,7 @@
class ResourceDouble
attr_reader :url, :specs
- def initialize(url="http://foo.com/bar.tar.gz", specs={})
+ def initialize(url="http://example.com/foo.tar.gz", specs={})
@url = url
@specs = specs
end
@@ -38,7 +38,7 @@ def test_expand_safe_system_args_does_not_mutate_argument
clas... | true |
Other | Homebrew | brew | 9a554f5f4b41d49ce0dd7e9f8c09ee519c1cb2e2.json | Use example.com as domain in tests | Library/Homebrew/test/test_formula.rb | @@ -155,21 +155,21 @@ def test_class_naming
def test_formula_spec_integration
f = Class.new(Formula) do
homepage 'http://example.com'
- url 'file:///foo.com/testball-0.1.tbz'
- mirror 'file:///foo.org/testball-0.1.tbz'
+ url 'http://example.com/test-0.1.tbz'
+ mirror 'http://example.o... | true |
Other | Homebrew | brew | 9a554f5f4b41d49ce0dd7e9f8c09ee519c1cb2e2.json | Use example.com as domain in tests | Library/Homebrew/test/test_resource.rb | @@ -55,7 +55,7 @@ def test_version
end
def test_version_from_url
- @resource.url('http://foo.com/bar-1.0.tar.gz')
+ @resource.url('http://example.com/foo-1.0.tar.gz')
assert_version_equal '1.0', @resource.version
assert @resource.version.detected_from_url?
end
@@ -68,7 +68,7 @@ def test_versi... | true |
Other | Homebrew | brew | 4f476d70661ff6b108f5c5e3175ee2db8d55927b.json | Remove dummy method | Library/Homebrew/test/test_formula.rb | @@ -197,9 +197,6 @@ def test_factory
require 'formula'
class #{Formulary.class_s(name)} < Formula
url 'foo-1.0'
- def initialize(*args)
- super
- end
end
}
end | false |
Other | Homebrew | brew | 502078099fb59212164d757fe2b66e58adfaa0d4.json | Prefer self.class.name to self.class.to_s | Library/Homebrew/debrew.rb | @@ -40,7 +40,7 @@ def debrew(exception, formula=nil)
raise exception unless $debugged_exceptions.add?(exception)
puts "#{exception.backtrace.first}"
- puts "#{Tty.red}#{exception.class.to_s}#{Tty.reset}: #{exception.to_s}"
+ puts "#{Tty.red}#{exception.class.name}#{Tty.reset}: #{exception}"
begin
ag... | true |
Other | Homebrew | brew | 502078099fb59212164d757fe2b66e58adfaa0d4.json | Prefer self.class.name to self.class.to_s | Library/Homebrew/requirement.rb | @@ -80,7 +80,7 @@ def to_dependency
private
def infer_name
- klass = self.class.to_s
+ klass = self.class.name || self.class.to_s
klass.sub!(/(Dependency|Requirement)$/, '')
klass.sub!(/^(\w+::)*/, '')
klass.downcase | true |
Other | Homebrew | brew | 4651b5214f4d90e16cb5ec8e832ff18dc06221f6.json | Remove a const_defined? check | Library/Homebrew/test/test_requirement.rb | @@ -87,11 +87,16 @@ def test_dsl_build
end
def test_infer_name_from_class
- klass, const = self.class, :FooRequirement
+ const = :FooRequirement
+ klass = self.class
+
klass.const_set(const, Class.new(Requirement))
- assert_equal "foo", klass.const_get(const).new.name
- ensure
- klass.send(... | false |
Other | Homebrew | brew | 96195295a3462070a26e03148f5140bbf0ea4dfd.json | Deprecate Pathname#cp and Pathname#chmod_R
As far as I can tell these methods have only ever been used in the test
suite.
Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.
Closes Homebrew/homebrew#30081. | Library/Homebrew/extend/pathname.rb | @@ -132,6 +132,7 @@ def default_stat
private :default_stat
def cp dst
+ opoo "Pathname#cp is deprecated, use FileUtils.cp"
if file?
FileUtils.cp to_s, dst
else
@@ -194,6 +195,7 @@ def rmdir_if_possible
end
def chmod_R perms
+ opoo "Pathname#chmod_R is deprecated, use FileUtils.chm... | true |
Other | Homebrew | brew | 96195295a3462070a26e03148f5140bbf0ea4dfd.json | Deprecate Pathname#cp and Pathname#chmod_R
As far as I can tell these methods have only ever been used in the test
suite.
Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.
Closes Homebrew/homebrew#30081. | Library/Homebrew/test/test_pathname.rb | @@ -46,12 +46,6 @@ def test_write_does_not_overwrite
assert_raises(RuntimeError) { @file.write('CONTENT') }
end
- def test_chmod_R
- perms = 0777
- FileUtils.expects(:chmod_R).with(perms, @dir.to_s)
- @dir.chmod_R(perms)
- end
-
def test_atomic_write
touch @file
@file.atomic_write('CON... | true |
Other | Homebrew | brew | 6eb7e0c27fcbc53d58e2a112ef10e902d54b6a7b.json | Eliminate an uninitialized ivar warning | Library/Homebrew/compilers.rb | @@ -65,7 +65,8 @@ def initialize compiler, &block
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
@version ||= @major_version + '.999'
else
- @version = (@version || 9999).to_i
+ @version ||= 9999
+ @version = @version.to_i
end
end
| false |
Other | Homebrew | brew | 93d8e716410bdf04346791e64b7446528371dfed.json | Use Digest#file if it's available | Library/Homebrew/extend/pathname.rb | @@ -244,11 +244,15 @@ def text_executable?
%r[^#!\s*\S+] === open('r') { |f| f.read(1024) }
end
- def incremental_hash(hasher)
- incr_hash = hasher.new
- buf = ""
- open('rb') { |f| incr_hash << buf while f.read(1024, buf) }
- incr_hash.hexdigest
+ def incremental_hash(klass)
+ digest = klass... | false |
Other | Homebrew | brew | 5ec52ea4da260d2f7abfc765fdcd2819076bd212.json | Remove unnecessary require | Library/Homebrew/test/testing_env.rb | @@ -77,7 +77,6 @@ def shutup
require 'test/unit' # must be after at_exit
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
-require 'extend/ENV'
ARGV.extend(HomebrewArgvExtension)
begin | false |
Other | Homebrew | brew | dd1f742854e965261a31e05674cba0cf767c364b.json | Remove unnecessary code | Library/Homebrew/test/testing_env.rb | @@ -79,7 +79,6 @@ def shutup
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
require 'extend/ENV'
ARGV.extend(HomebrewArgvExtension)
-ENV.extend(Stdenv)
begin
require 'rubygems' | false |
Other | Homebrew | brew | 6e634890e8ffd8336e0826508ec0d67d1e426162.json | Add methods for building test file paths | Library/Homebrew/test/test_mach.rb | @@ -5,8 +5,16 @@ def setup
@archs = [:i386, :x86_64, :ppc7400, :ppc64].extend(ArchitectureListExtension)
end
+ def dylib_path(name)
+ Pathname.new("#{TEST_FOLDER}/mach/#{name}.dylib")
+ end
+
+ def bundle_path(name)
+ Pathname.new("#{TEST_FOLDER}/mach/#{name}.bundle")
+ end
+
def test_fat_dylib
-... | false |
Other | Homebrew | brew | e3472540c1789cb30d529c9647213f71f96f1879.json | Pull common code into setup method | Library/Homebrew/test/test_mach.rb | @@ -171,12 +171,17 @@ def test_architecture_list_arch_flags_methods
class TextExecutableTests < Test::Unit::TestCase
include FileHelper
+ attr_reader :pn
+
+ def setup
+ @pn = HOMEBREW_PREFIX.join("an_executable")
+ end
+
def teardown
- (HOMEBREW_PREFIX/'foo_script').unlink
+ HOMEBREW_PREFIX.join("... | false |
Other | Homebrew | brew | c7685d2b70d4e6fc7ac5bbc77791687d4d0d4d98.json | Extract constant strings | Library/Homebrew/test/test_patching.rb | @@ -3,6 +3,9 @@
require 'testball'
class PatchingTests < Test::Unit::TestCase
+ PATCH_URL_A = "file:///#{TEST_FOLDER}/patches/noop-a.diff"
+ PATCH_URL_B = "file:///#{TEST_FOLDER}/patches/noop-b.diff"
+
def formula(&block)
super do
url "file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz"
@@ -21,7 +24,... | false |
Other | Homebrew | brew | df7756aeb9bbf13d3dc2a65fa291ff6625a48e69.json | Pull mock initialization code into initialize | Library/Homebrew/test/test_updater.rb | @@ -4,17 +4,21 @@
class UpdaterTests < Test::Unit::TestCase
class UpdaterMock < ::Updater
+ def initialize(*args)
+ super
+ @outputs = Hash.new { |h, k| h[k] = [] }
+ @expected = []
+ @called = []
+ end
+
def in_repo_expect(cmd, output = '')
- @outputs ||= Hash.new { |h,k| h[k... | false |
Other | Homebrew | brew | 65673d60c1ee8aa5c4776bef0dd4fa9d95f81474.json | Move updater mock into test class namespace | Library/Homebrew/test/test_updater.rb | @@ -2,33 +2,33 @@
require 'cmd/update'
require 'yaml'
-class UpdaterMock < Updater
- def in_repo_expect(cmd, output = '')
- @outputs ||= Hash.new { |h,k| h[k] = [] }
- @expected ||= []
- @expected << cmd
- @outputs[cmd] << output
- end
+class UpdaterTests < Test::Unit::TestCase
+ class UpdaterMock <... | false |
Other | Homebrew | brew | d8f86f290b7d8beb51553ec1d4abc334de37d014.json | Use external interface in tests | Library/Homebrew/test/test_dependency_collector.rb | @@ -2,19 +2,17 @@
require 'dependency_collector'
require 'extend/set'
-module DependencyCollectorTestExtension
+class DependencyCollectorTests < Test::Unit::TestCase
def find_dependency(name)
- deps.find { |dep| dep.name == name }
+ @d.deps.find { |dep| dep.name == name }
end
def find_requirement(k... | false |
Other | Homebrew | brew | cd4b801749985930771d3472c9276c33d6fe6848.json | Simplify test setup | Library/Homebrew/test/Rakefile | @@ -1,13 +1,10 @@
require 'rake'
require 'rake/testtask'
-require 'pathname'
-TEST_DIRECTORY = Pathname.new(File.expand_path(__FILE__)).parent.realpath
-TEST_FILES = FileList["#{TEST_DIRECTORY}/test_*.rb"]
+TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))
+TEST_FILES = Dir["#{TEST_DIRECTORY}/test_*.rb"]
G... | false |
Other | Homebrew | brew | ba856de06e14c1b6c96ed615d2a96ae929402fcd.json | Remove rcov rake task
rcov is not compatible with Ruby 2.0. | Library/Homebrew/test/Rakefile | @@ -32,19 +32,3 @@ namespace :test do
end
end
end
-
-begin
- require 'rubygems'
- require 'rcov/rcovtask'
-
- Rcov::RcovTask.new do |t|
- t.libs << Dir.pwd
- t.test_files = TEST_FILES
- t.rcov_opts = %w{--exclude=Gems
- --exclude=test_
- --exclude=testball
- ... | false |
Other | Homebrew | brew | 7f10aa3b6ef5ec13f815ea215d6f6c735373bc86.json | Fix visibility of FileUtils extension methods | Library/Homebrew/extend/fileutils.rb | @@ -1,7 +1,7 @@
require 'fileutils'
# We enhance FileUtils to make our Formula code more readable.
-module FileUtils extend self
+module FileUtils
# Create a temporary directory then yield. When the block returns,
# recursively delete the temporary directory.
@@ -26,15 +26,16 @@ def mktemp(prefix=name)
m... | false |
Other | Homebrew | brew | 83f2ee5aeabc55bc0806a7be168eaa272dc84ca5.json | Use RbConfig.ruby if it's available | Library/Homebrew/global.rb | @@ -68,8 +68,14 @@ def mkpath
HOMEBREW_TEMP = Pathname.new(ENV.fetch('HOMEBREW_TEMP', '/tmp'))
-RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
-RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
+if RbConfig.respond_to?(:ruby)
+ RUBY_PATH = Pathname.new(RbConfig.ruby)
+... | true |
Other | Homebrew | brew | 83f2ee5aeabc55bc0806a7be168eaa272dc84ca5.json | Use RbConfig.ruby if it's available | Library/Homebrew/test/testing_env.rb | @@ -29,8 +29,14 @@
require 'tap_constants'
-RUBY_BIN = Pathname.new(RbConfig::CONFIG['bindir'])
-RUBY_PATH = RUBY_BIN + RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']
+if RbConfig.respond_to?(:ruby)
+ RUBY_PATH = Pathname.new(RbConfig.ruby)
+else
+ RUBY_PATH = Pathname.new(RbConfig::CONFIG["b... | true |
Other | Homebrew | brew | 974b7e71ef11a09f188f0f5e40d609c0732b3406.json | Use opt shortcut methods | Library/Homebrew/build.rb | @@ -135,14 +135,13 @@ def install
deps.each(&:modify_build_environment)
keg_only_deps.each do |dep|
- opt = dep.opt_prefix
- ENV.prepend_path 'PATH', "#{opt}/bin"
- ENV.prepend_path 'PKG_CONFIG_PATH', "#{opt}/lib/pkgconfig"
- ENV.prepend_path 'PKG_CONFIG_PATH', "#{opt}/share/... | false |
Other | Homebrew | brew | 6d0f0cb195a0e3db68c33a65f09ad482af6ecb95.json | metafiles: simplify #copy? further | Library/Homebrew/extend/pathname.rb | @@ -378,7 +378,7 @@ def write_jar_script target_jar, script_name, java_opts=""
def install_metafiles from=Pathname.pwd
Pathname(from).children.each do |p|
next if p.directory?
- next unless Metafiles.copy?(p)
+ next unless Metafiles.copy?(p.basename.to_s)
# Some software symlinks these f... | true |
Other | Homebrew | brew | 6d0f0cb195a0e3db68c33a65f09ad482af6ecb95.json | metafiles: simplify #copy? further | Library/Homebrew/metafiles.rb | @@ -10,16 +10,10 @@ def self.list?(file)
!copy?(file)
end
- def self.copy?(path)
- path = path.to_s.downcase
- ext = File.extname(path)
-
- if EXTENSIONS.include?(ext)
- basename = File.basename(path, ext)
- else
- basename = File.basename(path)
- end
-
- return BASENAMES.include... | true |
Other | Homebrew | brew | fcacb25cd5ca92b12a19a92b5e1a562d82392aec.json | Eliminate FORMULA_META_FILES constant | Library/Homebrew/cmd/list.rb | @@ -1,3 +1,5 @@
+require "metafiles"
+
module Homebrew extend self
def list
@@ -100,7 +102,7 @@ def initialize path
else
print_dir pn
end
- elsif FORMULA_META_FILES.should_list? pn.basename.to_s
+ elsif Metafiles.list?(pn.basename.to_s)
puts pn
... | true |
Other | Homebrew | brew | fcacb25cd5ca92b12a19a92b5e1a562d82392aec.json | Eliminate FORMULA_META_FILES constant | Library/Homebrew/extend/pathname.rb | @@ -1,6 +1,7 @@
require 'pathname'
require 'mach'
require 'resource'
+require 'metafiles'
# we enhance pathname to make our code more readable
class Pathname
@@ -381,7 +382,7 @@ def install_metafiles from=nil
from.children.each do |p|
next if p.directory?
- next unless FORMULA_META_FILES.shoul... | true |
Other | Homebrew | brew | fcacb25cd5ca92b12a19a92b5e1a562d82392aec.json | Eliminate FORMULA_META_FILES constant | Library/Homebrew/global.rb | @@ -94,8 +94,6 @@ module Homebrew extend self
alias_method :failed?, :failed
end
-require 'metafiles'
-FORMULA_META_FILES = Metafiles.new
ISSUES_URL = "https://github.com/Homebrew/homebrew/wiki/troubleshooting"
HOMEBREW_PULL_OR_COMMIT_URL_REGEX = 'https:\/\/github.com\/(\w+)\/homebrew(-\w+)?\/(pull\/(\d+)|commi... | true |
Other | Homebrew | brew | fcacb25cd5ca92b12a19a92b5e1a562d82392aec.json | Eliminate FORMULA_META_FILES constant | Library/Homebrew/metafiles.rb | @@ -5,12 +5,12 @@ class Metafiles
news notes notice readme todo
]
- def should_list? file
- return false if %w[.DS_Store INSTALL_RECEIPT.json].include? file
+ def self.list?(file)
+ return false if %w[.DS_Store INSTALL_RECEIPT.json].include?(file)
!copy?(file)
end
- def should_copy?(path)
+... | true |
Other | Homebrew | brew | fef866aae4f13d2789d156de33fce1ab1e99db5f.json | metafiles: combine #should_copy? and #include? | Library/Homebrew/metafiles.rb | @@ -5,18 +5,12 @@ class Metafiles
news notes notice readme todo
]
- def should_copy? file
- include? file
- end
-
def should_list? file
return false if %w[.DS_Store INSTALL_RECEIPT.json].include? file
- not include? file
+ !copy?(file)
end
- private
-
- def include?(path)
+ def shou... | false |
Other | Homebrew | brew | 3aa75f5e18fa2cde5cf4bfe5974fb700edc63114.json | metafiles: remove unused method | Library/Homebrew/metafiles.rb | @@ -5,10 +5,6 @@ class Metafiles
news notes notice readme todo
]
- def + other
- @metafiles + other
- end
-
def should_copy? file
include? file
end | false |
Other | Homebrew | brew | 6524dfc17b95c2944829f8264300cf60d49f5250.json | metafiles: reduce pathname conversions in #include? | Library/Homebrew/metafiles.rb | @@ -22,17 +22,16 @@ def should_list? file
private
- def include? p
- p = p.to_s # Might be a pathname
- p = p.downcase
- path = Pathname.new(p)
- if @exts.include? path.extname
- p = path.basename(path.extname)
+ def include?(path)
+ path = path.to_s.downcase
+ ext = File.extname(path)
... | false |
Other | Homebrew | brew | 94a0b26fec3e640bc7f0d132a4bd36c2507f3fc8.json | Linuxbrew: Read CPU flags from /proc/cpuinfo
Closes Homebrew/homebrew#29895.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/os/linux/hardware.rb | @@ -11,30 +11,37 @@ def arch_32_bit; :i386; end
def arch_64_bit; :x86_64; end
def universal_archs; [].extend ArchitectureListExtension; end
+ def cpuinfo
+ @cpuinfo ||= File.read("/proc/cpuinfo")
+ end
+
def type
- @cpu_type ||= case `uname -m`
- when /i[3-6]86/, /x86_64/
- :intel
- ... | false |
Other | Homebrew | brew | 98e5bd8198cc3ac42173eb755b0780e477e36a1c.json | Find vim on the path
If vim is on the path, it will be used instead of `/usr/bin/vim`.
Closes Homebrew/homebrew#29885.
Signed-off-by: Jack Nagel <jacknagel@gmail.com> | Library/Homebrew/utils.rb | @@ -190,7 +190,9 @@ def which_editor
return 'mate' if which "mate"
# Find BBEdit / TextWrangler
return 'edit' if which "edit"
- # Default to vim
+ # Find vim
+ return 'vim' if which "vim"
+ # Default to standard vim
return '/usr/bin/vim'
end
| false |
Other | Homebrew | brew | 0357edcf3b50b68362dcf4c79271786b4b9b6f60.json | Remove unicode from example formula | Library/Contributions/example-formula.rb | @@ -396,10 +396,10 @@ def caveats
# Need complete control over stdin, stdout?
require "open3"
- Open3.popen3("#{bin}/example", "big5:utf-8") do |stdin, stdout, _|
- stdin.write("\263\134\245\134\273\134")
+ Open3.popen3("#{bin}/example", "argument") do |stdin, stdout, _|
+ stdin.write("some ... | false |
Other | Homebrew | brew | 212181bbc62daa2e33d6cac434ab6a20e85d9482.json | Remove non-breaking space | Library/Contributions/brew_zsh_completion.zsh | @@ -124,7 +124,7 @@ case "$words[1]" in
fi ;;
untap)
_brew_installed_taps
- _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
+ _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae exp... | false |
Other | Homebrew | brew | 7242365ff39b2184a81a7aaad40735daca0e1fbd.json | Remove stray unicode | Library/Contributions/example-formula.rb | @@ -271,7 +271,7 @@ def install
args << "--universal-binary" if build.universal?
# The `build.with?` and `build.without?` are smart enough to do the
- # right thing™ with respect to defaults defined via `:optional` and
+ # right thing with respect to defaults defined via `:optional` and
# `:recom... | false |
Other | Homebrew | brew | 62e79c8d09d978f0f9106ebc7694d4fc55fc3241.json | audit: read formula text in binmode | Library/Homebrew/cmd/audit.rb | @@ -56,7 +56,7 @@ def text
class FormulaText
def initialize path
- @text = path.open('r') { |f| f.read }
+ @text = path.open("rb", &:read)
end
def without_patch | false |
Other | Homebrew | brew | 12b5de391ed51c433a402a55afa7675d3ad823d6.json | hardware: Add Intel CPUs to OPTIMIZATION_FLAGS
Closes Homebrew/homebrew#29866.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/os/linux/hardware.rb | @@ -1,5 +1,9 @@
module LinuxCPUs
- OPTIMIZATION_FLAGS = {}.freeze
+ OPTIMIZATION_FLAGS = {
+ :penryn => '-march=core2 -msse4.1',
+ :core2 => '-march=core2',
+ :core => '-march=prescott',
+ }.freeze
def optimization_flags; OPTIMIZATION_FLAGS; end
# Linux supports x86 only, and universal archs do not... | false |
Other | Homebrew | brew | 8cb980f7befd7c797b255ac05e9df245c94eb700.json | doctor: Add check for install_name_tool
Closes Homebrew/homebrew#29593. | Library/Homebrew/cmd/doctor.rb | @@ -312,6 +312,20 @@ def check_for_stray_developer_directory
end
end
+def check_for_bad_install_name_tool
+ return if MacOS.version < 10.9
+
+ libs = `otool -L /usr/bin/install_name_tool`
+ unless libs.include? "/usr/lib/libxcselect.dylib" then <<-EOS.undent
+ You have an outdated version of /usr/bin/instal... | true |
Other | Homebrew | brew | 8cb980f7befd7c797b255ac05e9df245c94eb700.json | doctor: Add check for install_name_tool
Closes Homebrew/homebrew#29593. | Library/Homebrew/cmd/install.rb | @@ -55,6 +55,7 @@ def check_xcode
check_for_installed_developer_tools
check_xcode_license_approved
check_for_osx_gcc_installer
+ check_for_bad_install_name_tool
].each do |check|
out = checks.send(check)
opoo out unless out.nil? | true |
Other | Homebrew | brew | bd0533448718bbf323e58070fc711d662c54b855.json | test: improve docs for when using HEAD or similar flags
Closes Homebrew/homebrew#29791.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Contributions/manpages/brew.1.md | @@ -334,7 +334,8 @@ Note that these flags should only appear after a command.
A few formulae provide a test method. `brew test <formula>` runs this
test method. There is no standard output or return code, but it should
generally indicate to the user if something is wrong with the installed
- formula.
... | true |
Other | Homebrew | brew | bd0533448718bbf323e58070fc711d662c54b855.json | test: improve docs for when using HEAD or similar flags
Closes Homebrew/homebrew#29791.
Signed-off-by: Adam Vandenberg <flangy@gmail.com> | Library/Homebrew/cmd/create.rb | @@ -165,7 +165,8 @@ def install
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
- # were more thorough. Run the test with `brew test #{name}`.
+ # were more thorough. Run... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.