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 | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/extend/os/keg_relocate.rb | @@ -1 +1,5 @@
-require "extend/os/mac/keg_relocate" if OS.mac?
+if OS.mac?
+ require "extend/os/mac/keg_relocate"
+elsif OS.linux?
+ require "extend/os/linux/keg_relocate"
+end | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/extend/os/linux/keg_relocate.rb | @@ -0,0 +1,81 @@
+class Keg
+ def relocate_dynamic_linkage(relocation)
+ # Patching patchelf using itself fails with "Text file busy" or SIGBUS.
+ return if name == "patchelf"
+
+ elf_files.each do |file|
+ file.ensure_writable do
+ change_rpath(file, relocation.old_prefix, relocation.new_prefix)
... | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/formula_installer.rb | @@ -473,13 +473,15 @@ def expand_requirements
def expand_dependencies(deps)
inherited_options = Hash.new { |hash, key| hash[key] = Options.new }
+ pour_bottle = pour_bottle?
expanded_deps = Dependency.expand(formula, deps) do |dependent, dep|
inherited_options[dep.name] |= inherited_options_f... | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/keg_relocate.rb | @@ -175,6 +175,10 @@ def symlink_files
def self.file_linked_libraries(_file, _string)
[]
end
+
+ def self.relocation_formulae
+ []
+ end
end
require "extend/os/keg_relocate" | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/test/dev-cmd/bottle_spec.rb | @@ -4,6 +4,9 @@
expect { brew "install", "--build-bottle", testball }
.to be_a_success
+ setup_test_formula "patchelf"
+ (HOMEBREW_CELLAR/"patchelf/1.0/bin").mkpath
+
expect { brew "bottle", "--no-rebuild", testball }
.to output(/Formula not from core or any taps/).to_stderr
... | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/test/formula_installer_bottle_spec.rb | @@ -17,6 +17,9 @@ def temporarily_install_bottle(formula)
expect(formula).to be_bottled
expect(formula).to pour_bottle
+ stub_formula_loader formula
+ stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
+ allow(Formula["patchelf"]).to receive(:installed?).and_return(true)
described_... | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/test/formulary_spec.rb | @@ -136,20 +136,26 @@ class Wrong#{described_class.class_s(formula_name)} < Formula
end
context "with installed Formula" do
- let(:formula) { described_class.factory(formula_path) }
- let(:installer) { FormulaInstaller.new(formula) }
+ before do
+ allow(Formulary).to receive(:loader_fo... | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | @@ -157,6 +157,10 @@ def install
url "https://example.com/#{name}-1.0"
depends_on "foo"
RUBY
+ when "patchelf"
+ content = <<~RUBY
+ url "https://example.com/#{name}-1.0"
+ RUBY
end
Formulary.core_path(name).tap do |formula_path| | true |
Other | Homebrew | brew | 1b688a3a25fa4ca077de88e2177241b6cb76a5f6.json | Relocate bottles on Linux using patchelf
Ensure patchelf is installed to pour bottles and build bottles. | Library/Homebrew/utils/popen.rb | @@ -3,10 +3,22 @@ def self.popen_read(*args, **options, &block)
popen(args, "rb", options, &block)
end
+ def self.safe_popen_read(*args, **options, &block)
+ output = popen_read(*args, **options, &block)
+ raise ErrorDuringExecution, args unless $CHILD_STATUS.success?
+ output
+ end
+
def self.p... | true |
Other | Homebrew | brew | bf856117ba9776b3227106ace27493fe3fd9d16f.json | Allow unused keyword arguments. | Library/Homebrew/.rubocop.yml | @@ -31,6 +31,9 @@ Lint/NestedMethodDefinition:
Lint/ParenthesesAsGroupedExpression:
Enabled: true
+Lint/UnusedMethodArgument:
+ AllowUnusedKeywordArguments: true
+
# TODO: try to bring down all metrics maximums
Metrics/AbcSize:
Max: 250 | true |
Other | Homebrew | brew | bf856117ba9776b3227106ace27493fe3fd9d16f.json | Allow unused keyword arguments. | Library/Homebrew/style.rb | @@ -30,6 +30,10 @@ def check_style_impl(files, output_type, options = {})
args << "--parallel"
end
+ if ARGV.verbose?
+ args += ["--extra-details", "--display-cop-names"]
+ end
+
if ARGV.include?("--rspec")
Homebrew.install_gem! "rubocop-rspec"
args += %w[--re... | true |
Other | Homebrew | brew | 05cb6cda088d740e2cfa204da2ba36a68f503afc.json | Add `Installer` spec. | Library/Homebrew/test/cask/artifact/installer_spec.rb | @@ -0,0 +1,40 @@
+describe Hbc::Artifact::Installer, :cask do
+ let(:staged_path) { mktmpdir }
+ let(:cask) { instance_double("Cask", staged_path: staged_path, config: nil) }
+ subject(:installer) { described_class.new(cask, **args) }
+ let(:command) { Hbc::SystemCommand }
+
+ let(:args) { {} }
+
+ describe "#ins... | false |
Other | Homebrew | brew | 37f3a603cecb24799d3b1087b342c270b78dcc12.json | Use `env` utility instead of `with_env`. | Library/Homebrew/cask/lib/hbc/system_command.rb | @@ -47,15 +47,15 @@ def initialize(executable, args: [], sudo: false, input: [], print_stdout: false
@must_succeed = must_succeed
options.extend(HashValidator).assert_valid_keys(:chdir)
@options = options
- @env = { "PATH" => ENV["PATH"] }.merge(env)
+ @env = env
@env.keys.grep_v... | true |
Other | Homebrew | brew | 37f3a603cecb24799d3b1087b342c270b78dcc12.json | Use `env` utility instead of `with_env`. | Library/Homebrew/test/cask/system_command_spec.rb | @@ -15,10 +15,10 @@
its("run!.stdout") { is_expected.to eq("123") }
describe "the resulting command line" do
- it "does not include the given variables" do
+ it "includes the given variables explicitly" do
expect(Open3)
.to receive(:popen3)
- .with(a_hash... | true |
Other | Homebrew | brew | 37f3a603cecb24799d3b1087b342c270b78dcc12.json | Use `env` utility instead of `with_env`. | Library/Homebrew/test/support/helper/cask/fake_system_command.rb | @@ -1,5 +1,5 @@
def sudo(*args)
- ["/usr/bin/sudo", "-E", "PATH=#{ENV["PATH"]}", "--"] + args.flatten
+ ["/usr/bin/sudo", "-E", "--"] + args.flatten
end
module Hbc | true |
Other | Homebrew | brew | 37f3a603cecb24799d3b1087b342c270b78dcc12.json | Use `env` utility instead of `with_env`. | Library/Homebrew/test/support/helper/spec/shared_examples/hbc_staged.rb | @@ -80,7 +80,7 @@
allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command(
- ["/usr/bin/sudo", "-E", "PATH=#{ENV["PATH"]}", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname],
+ sudo("/usr/sbin/chown", "-R", "--", "fake_user:staff", ... | true |
Other | Homebrew | brew | 1f5311888e59562152d395d25679f22f44205965.json | Add failing spec for `SystemCommand`. | Library/Homebrew/test/cask/system_command_spec.rb | @@ -2,7 +2,7 @@
describe "#initialize" do
let(:env_args) { ["bash", "-c", 'printf "%s" "${A?}" "${B?}" "${C?}"'] }
- describe "given some environment variables" do
+ context "when given some environment variables" do
subject {
described_class.new(
"env",
@@ -26,7 +26,7 @@
... | false |
Other | Homebrew | brew | 461b61abacbafd523f007e76b39b542f04155994.json | link: fix undefined `dep_f` | Library/Homebrew/cmd/link.rb | @@ -40,7 +40,7 @@ def link
elsif (MacOS.version >= :mojave ||
MacOS::Xcode.version >= "10.0" ||
MacOS::CLT.version >= "10.0") &&
- dep_f.keg_only_reason.reason == :provided_by_macos
+ keg.to_formula.keg_only_reason.reason == :provided_by_macos
... | false |
Other | Homebrew | brew | 2f181b3f41487c0c2c4459e3dfb5a9e3d256eccb.json | link: stop unneeded force linking on Mojave/CLT 10.
People are getting in the habit of force-linking things like `zlib` to
fix linking/include issues on Mojave (which doesn't install headers to
`/usr/include` by default). This way lies madness so encourage people to
instead pass the correct compiler flags instead. | Library/Homebrew/cmd/link.rb | @@ -27,16 +27,27 @@ def link
ARGV.kegs.each do |keg|
keg_only = Formulary.keg_only?(keg.rack)
- if HOMEBREW_PREFIX.to_s == "/usr/local" && keg_only &&
- keg.name.start_with?("openssl", "libressl")
- opoo <<~EOS
- Refusing to link: #{keg.name}
- Linking keg-only #{keg.... | false |
Other | Homebrew | brew | 75d3ca8e6f89aa67dbd5b891295c4bf6d05b6beb.json | Update man pages to reflect prior change
Generate new man pages so that the docs and manpages match up | docs/Manpage.md | @@ -239,9 +239,9 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--cc=``compiler` is passed, attempt to compile using `compiler`.
`compiler` should be the name of the compiler's executable, for instance
- `gcc-8` for gcc 8, `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9... | false |
Other | Homebrew | brew | 72735aef175bf7ddb74728e75ad3a0dc5961c5f3.json | Update documentation and generate manpage
* update references in `--cc` flag, using modern gcc examples
* note that issues should not be filed if `--cc` flag is used
* remove reference to `HOMEBREW_CC` as it should not be exposed to users
* generate manpages using `brew man` with these changes | Library/Homebrew/cmd/install.rb | @@ -21,11 +21,12 @@
#:
#: If `--cc=`<compiler> is passed, attempt to compile using <compiler>.
#: <compiler> should be the name of the compiler's executable, for instance
-#: `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-provided GCC
-#: 4.9. In order to use LLVM's clang, use `llvm_clang`. T... | true |
Other | Homebrew | brew | 72735aef175bf7ddb74728e75ad3a0dc5961c5f3.json | Update documentation and generate manpage
* update references in `--cc` flag, using modern gcc examples
* note that issues should not be filed if `--cc` flag is used
* remove reference to `HOMEBREW_CC` as it should not be exposed to users
* generate manpages using `brew man` with these changes | Library/Homebrew/manpages/brew.1.md.erb | @@ -138,15 +138,6 @@ Note that environment variables must have a value set to be detected. For exampl
*Default:* `~/Library/Caches/Homebrew`.
- * `HOMEBREW_CC`:
- If set, instructs Homebrew to used the specified compiler to build a
- package from source. In order to specify the Apple-provided clang,
- ... | true |
Other | Homebrew | brew | 72735aef175bf7ddb74728e75ad3a0dc5961c5f3.json | Update documentation and generate manpage
* update references in `--cc` flag, using modern gcc examples
* note that issues should not be filed if `--cc` flag is used
* remove reference to `HOMEBREW_CC` as it should not be exposed to users
* generate manpages using `brew man` with these changes | docs/Custom-GCC-and-cross-compilers.md | @@ -14,9 +14,9 @@ Rather than merging in brews for either of these cases at this time, we're
listing them on this page. If you come up with a formula for a new version of
GCC or cross-compiler suite, please link it in here.
-* Homebrew provides a `gcc` formula for use with Xcode 4.2+ or when needing
+- Homebrew pro... | true |
Other | Homebrew | brew | 72735aef175bf7ddb74728e75ad3a0dc5961c5f3.json | Update documentation and generate manpage
* update references in `--cc` flag, using modern gcc examples
* note that issues should not be filed if `--cc` flag is used
* remove reference to `HOMEBREW_CC` as it should not be exposed to users
* generate manpages using `brew man` with these changes | docs/Manpage.md | @@ -239,11 +239,12 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--cc=``compiler` is passed, attempt to compile using `compiler`.
`compiler` should be the name of the compiler's executable, for instance
- `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-... | true |
Other | Homebrew | brew | 72735aef175bf7ddb74728e75ad3a0dc5961c5f3.json | Update documentation and generate manpage
* update references in `--cc` flag, using modern gcc examples
* note that issues should not be filed if `--cc` flag is used
* remove reference to `HOMEBREW_CC` as it should not be exposed to users
* generate manpages using `brew man` with these changes | manpages/brew.1 | @@ -227,7 +227,7 @@ If \fB\-\-ignore\-dependencies\fR is passed, skip installing any dependencies of
If \fB\-\-only\-dependencies\fR is passed, install the dependencies with specified options but do not install the specified formula\.
.
.IP
-If \fB\-\-cc=\fR\fIcompiler\fR is passed, attempt to compile using \fIcompi... | true |
Other | Homebrew | brew | d9f90deb7c7ef8de93b6b4d80ccd5be42745aa33.json | download_strategy: use tar xf.
The flags and separate `-` aren't required on 10.5 which is the oldest
version of macOS we support (and it looks nicer this way). | Library/Homebrew/download_strategy.rb | @@ -194,15 +194,7 @@ def stage
if type == :xz && DependencyCollector.tar_needs_xz_dependency?
pipe_to_tar "#{HOMEBREW_PREFIX}/opt/xz/bin/xz", unpack_dir
else
- flags = if type == :gzip
- ["-z"]
- elsif type == :bzip2
- ["-j"]
- elsif type == :xz
- [... | false |
Other | Homebrew | brew | f5fbb74aaf847c9589af82ceea2f388eae02e0f6.json | linkage: fix output of optional dependencies.
Check the runtime dependencies from the tab when outputting the
`brew linkage` declared vs. undeclared dependencies. | Library/Homebrew/formula.rb | @@ -1518,7 +1518,7 @@ def opt_or_installed_prefix_keg
# Returns a list of Dependency objects that are required at runtime.
# @private
- def runtime_dependencies(read_from_tab: true)
+ def runtime_dependencies(read_from_tab: true, undeclared: true)
if read_from_tab &&
(keg = opt_or_installed_prefi... | true |
Other | Homebrew | brew | f5fbb74aaf847c9589af82ceea2f388eae02e0f6.json | linkage: fix output of optional dependencies.
Check the runtime dependencies from the tab when outputting the
`brew linkage` declared vs. undeclared dependencies. | Library/Homebrew/linkage_checker.rb | @@ -149,7 +149,8 @@ def check_undeclared_deps
declared_deps_names = declared_deps_full_names.map do |dep|
dep.split("/").last
end
- recursive_deps = formula.declared_runtime_dependencies.map do |dep|
+ recursive_deps = formula.runtime_dependencies(undeclared: false)
+ .... | true |
Other | Homebrew | brew | 14364bbaee7de213b51abef5ac1f75b9100982f5.json | extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check. | Library/Homebrew/extend/ENV/shared.rb | @@ -147,7 +147,7 @@ def fcflags
# Outputs the current compiler.
# @return [Symbol]
- # <pre># Do something only for clang
+ # <pre># Do something only for the system clang
# if ENV.compiler == :clang
# # modify CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS in one go:
# ENV.append_to_cflags "-I ./missing/... | true |
Other | Homebrew | brew | 14364bbaee7de213b51abef5ac1f75b9100982f5.json | extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check. | Library/Homebrew/extend/ENV/std.rb | @@ -157,7 +157,7 @@ def universal_binary
append_to_cflags Hardware::CPU.universal_archs.as_arch_flags
append "LDFLAGS", Hardware::CPU.universal_archs.as_arch_flags
- return if compiler == :clang
+ return if compiler_any_clang?
return unless Hardware.is_32_bit?
# Can't mix "-march" for a 32-b... | true |
Other | Homebrew | brew | 14364bbaee7de213b51abef5ac1f75b9100982f5.json | extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check. | Library/Homebrew/extend/ENV/super.rb | @@ -276,7 +276,7 @@ def universal_binary
self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags
# GCC doesn't accept "-march" for a 32-bit CPU with "-arch x86_64"
- return if compiler == :clang
+ return if compiler_any_clang?
return unless Hardware::CPU.is_32_bit?
self["HOM... | true |
Other | Homebrew | brew | 14364bbaee7de213b51abef5ac1f75b9100982f5.json | extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check. | Library/Homebrew/test/ENV_spec.rb | @@ -156,6 +156,18 @@
expect(subject["FOO"]).to eq "bar"
end
end
+
+ describe "#compiler_any_clang?" do
+ it "returns true for llvm_clang" do
+ expect(subject.compiler_any_clang?(:llvm_clang)).to be true
+ end
+ end
+
+ describe "#compiler_with_cxx11_support?" do
+ it "returns true for gc... | true |
Other | Homebrew | brew | 5e3bc855273d73d2c67704a640d0680afe059ff4.json | Remove unnecessary `Pathname` check. | Library/Homebrew/resource.rb | @@ -118,7 +118,7 @@ def unpack(target = nil)
if block_given?
yield ResourceStageContext.new(self, staging)
elsif target
- target = Pathname.new(target) unless target.is_a? Pathname
+ target = Pathname(target)
target.install Pathname.pwd.children
end
end | false |
Other | Homebrew | brew | 7e5addfb22661814a10253648719be9f4f8041dd.json | Add version number to cask JSON option
`$ brew cask info --json=v1 <formula>` instead of `$ brew cask info --json <formula>` | Library/Homebrew/cask/lib/hbc/cli/info.rb | @@ -3,17 +3,16 @@
module Hbc
class CLI
class Info < AbstractCommand
- option "--json-v1", :json, false
+ option "--json=VERSION", :json
def initialize(*)
super
raise CaskUnspecifiedError if args.empty?
end
def run
- if json?
- json = casks.ma... | false |
Other | Homebrew | brew | 1424b20a3d59f7ba1defa5407e081a6dab55e9fa.json | config: handle HOMEBREW_TEMP being unset.
This can happen when updating from a previous version of Homebrew. | Library/Homebrew/config.rb | @@ -40,7 +40,9 @@
# Must use /tmp instead of $TMPDIR because long paths break Unix domain sockets
HOMEBREW_TEMP = begin
- tmp = Pathname.new(ENV["HOMEBREW_TEMP"])
+ # /tmp fallback is here for people auto-updating from a version where
+ # HOMEBREW_TEMP isn't set.
+ tmp = Pathname.new(ENV["HOMEBREW_TEMP"] || "/t... | false |
Other | Homebrew | brew | a185f3272edf96fc6e65eaf236a61d067270c966.json | audit: disallow unstable specs for versioned formulae | Library/Homebrew/dev-cmd/audit.rb | @@ -571,8 +571,19 @@ def audit_specs
end
end
- if @new_formula && formula.head
- new_formula_problem "Formulae should not have a HEAD spec"
+ if formula.head || formula.devel
+ unstable_spec_message = "Formulae should not have an unstable spec"
+ if @new_formula
+ ... | false |
Other | Homebrew | brew | 22b3102fbe126be7f58e4d4a70214bf62d07bc09.json | Add version number to cask json option
Old:
$ brew cask info --json <formula>
New:
$ brew cask info --json-v1 <formula> | Library/Homebrew/cask/lib/hbc/cli/info.rb | @@ -3,7 +3,7 @@
module Hbc
class CLI
class Info < AbstractCommand
- option "--json", :json, false
+ option "--json-v1", :json, false
def initialize(*)
super | false |
Other | Homebrew | brew | 0bfc6bd490d0ee12624c1c20f7b525bc1939a744.json | Improve format of git cask info --json output | Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb | @@ -26,6 +26,10 @@ def uninstall_phase(**)
abstract_phase(self.class.uninstall_dsl_key)
end
+ def summarize
+ directives.keys.map(&:to_s).join(", ")
+ end
+
private
def class_for_dsl_key(dsl_key)
@@ -37,10 +41,6 @@ def abstract_phase(dsl_key)
return if (block ... | true |
Other | Homebrew | brew | 0bfc6bd490d0ee12624c1c20f7b525bc1939a744.json | Improve format of git cask info --json output | Library/Homebrew/cask/lib/hbc/cask.rb | @@ -138,7 +138,7 @@ def to_hash
"appcast" => appcast,
"version" => version,
"sha256" => sha256,
- "artifacts" => artifacts,
+ "artifacts" => {},
"caveats" => caveats,
"depends_on" => depends_on,
"conflicts_with" => conflicts_with,
@@ -148,6 +148,12 @@ ... | true |
Other | Homebrew | brew | 27b58b6955edba830f448f04bda81c1d66105859.json | travis.yml: update xcode to 9.4 | .travis.yml | @@ -12,7 +12,7 @@ matrix:
include:
- os: osx
compiler: clang
- osx_image: xcode9.2
+ osx_image: xcode9.4
- os: linux
compiler: gcc
sudo: false | false |
Other | Homebrew | brew | 2d5ae645d9cc46af57aaaabbfe6bfb2db9f9e1bd.json | Add basic JSON option to brew cask
$ brew cask info --json <cask> | Library/Homebrew/cask/lib/hbc/cask.rb | @@ -129,5 +129,26 @@ def dumpcask
odebug "Cask instance method '#{method}':", send(method).to_yaml
end
end
+
+ def to_hash
+ hsh = {
+ "name" => name,
+ "homepage" => homepage,
+ "url" => url,
+ "appcast" => appcast,
+ "version" => version,
+ "sha25... | true |
Other | Homebrew | brew | 2d5ae645d9cc46af57aaaabbfe6bfb2db9f9e1bd.json | Add basic JSON option to brew cask
$ brew cask info --json <cask> | Library/Homebrew/cask/lib/hbc/cli/info.rb | @@ -1,15 +1,24 @@
+require "json"
+
module Hbc
class CLI
class Info < AbstractCommand
+ option "--json", :json, false
+
def initialize(*)
super
raise CaskUnspecifiedError if args.empty?
end
def run
- casks.each do |cask|
- odebug "Getting info... | true |
Other | Homebrew | brew | bde7c6b82b7794dda797124b26c8593ca034876c.json | brew.sh: Use bashisms for default values | Library/Homebrew/brew.sh | @@ -104,10 +104,7 @@ then
HOMEBREW_SYSTEM_GIT_TOO_OLD="1"
fi
- if [[ -z "$HOMEBREW_CACHE" ]]
- then
- HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
- fi
+ HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOME}/Library/Caches/Homebrew}"
HOMEBREW_TEMP="${HOMEBREW_TEMP:-/private/tmp}"
else
@@ -117,15 +114,8 @@ ... | false |
Other | Homebrew | brew | 039a4ee4b36ff34ed770af4901696c5e9d086006.json | brew.sh: Move HOMEBREW_TEMP declaration
Additionally, assign HOMEBREW_TEMP based on the host
system (/tmp for Linux, /private/tmp for macOS). | Library/Homebrew/brew.sh | @@ -108,6 +108,8 @@ then
then
HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
fi
+
+ HOMEBREW_TEMP="${HOMEBREW_TEMP:-/private/tmp}"
else
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew"
@@ -124,6 +126,8 @@ else
HOMEBREW_CACHE="$HOME/.cache/Homebrew"
fi
fi
+
+ ... | true |
Other | Homebrew | brew | 039a4ee4b36ff34ed770af4901696c5e9d086006.json | brew.sh: Move HOMEBREW_TEMP declaration
Additionally, assign HOMEBREW_TEMP based on the host
system (/tmp for Linux, /private/tmp for macOS). | bin/brew | @@ -21,7 +21,6 @@ symlink_target_directory() {
BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd -P)"
HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}"
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
-HOMEBREW_TEMP="${HOMEBREW_TEMP:-/private/tmp}"
# Default to / prefix if unset or the bin/brew file.
if [[ -z "... | true |
Other | Homebrew | brew | 71a79e7e040202c543e54198bc91539c0b7abc01.json | Ignore false RuboCop positive. | Library/Homebrew/utils/formatter.rb | @@ -110,7 +110,7 @@ def pluralize(count, singular, plural = nil, show_count: true)
end
def comma_and(*items)
- *items, last = items.map(&:to_s)
+ *items, last = items.map(&:to_s) # rubocop:disable Lint/ShadowedArgument, TODO: Remove when RuboCop 0.57.3 is released.
return last if items.empty?
... | false |
Other | Homebrew | brew | 785750ee6364b14e47dfac352372cb51a83ee9c9.json | Add `Tap#contents` methods. | Library/Homebrew/cmd/tap-info.rb | @@ -62,13 +62,11 @@ def print_tap_info(taps)
if tap.installed?
info += tap.pinned? ? "pinned" : "unpinned"
info += ", private" if tap.private?
- if (formula_count = tap.formula_files.size).positive?
- info += ", #{Formatter.pluralize(formula_count, "formula")}"
+ ... | true |
Other | Homebrew | brew | 785750ee6364b14e47dfac352372cb51a83ee9c9.json | Add `Tap#contents` methods. | Library/Homebrew/tap.rb | @@ -284,9 +284,8 @@ def install(options = {})
link_completions_and_manpages
- casks = Formatter.pluralize(cask_files.count, "cask")
- formulae = Formatter.pluralize(formula_files.count, "formula")
- puts "Tapped #{formulae} and #{casks} (#{path.abv})." unless quiet
+ formatted_contents = Formatter.... | true |
Other | Homebrew | brew | 2aa7597e70d8aa5bd529494884646797ea547cb0.json | Show tapped casks. | Library/Homebrew/tap.rb | @@ -284,8 +284,9 @@ def install(options = {})
link_completions_and_manpages
- formula_count = formula_files.size
- puts "Tapped #{Formatter.pluralize(formula_count, "formula")} (#{path.abv})" unless quiet
+ casks = Formatter.pluralize(cask_files.count, "cask")
+ formulae = Formatter.pluralize(formu... | false |
Other | Homebrew | brew | ad82cd888e9acf2fdc4c795156b3e0c0e4e88988.json | Remove unneeded RuboCop comment. | Library/Homebrew/debrew.rb | @@ -119,7 +119,7 @@ def self.debug(e)
if e.is_a?(Ignorable)
menu.choice(:irb) do
puts "When you exit this IRB session, execution will continue."
- set_trace_func proc { |event, _, _, id, binding, klass| # rubocop:disable Metrics/ParameterLists
+ set_trace... | false |
Other | Homebrew | brew | c552e6596ca381cc035128b93013ee2220c728e9.json | brew.sh: Remove trailing / from prefix in message | Library/Homebrew/brew.sh | @@ -300,7 +300,7 @@ check-prefix-is-not-tmpdir() {
odie <<EOS
Your HOMEBREW_PREFIX is in the system temporary directory, which Homebrew
uses to store downloads and builds. You can resolve this by installing Homebrew to
-either the standard prefix (/usr/local/) or to a non-standard prefix that is not
+either the ... | false |
Other | Homebrew | brew | 949c0cc47ee4fe6a3e649a0bd3f51e71d1f39735.json | brew.sh: Use realpath to calculate tmpdir | Library/Homebrew/brew.sh | @@ -295,14 +295,13 @@ EOS
check-run-command-as-root
check-prefix-is-not-tmpdir() {
- if [[ "${HOMEBREW_PREFIX}" = /tmp/* ||
- "${HOMEBREW_PREFIX}" = /private/tmp/* ]]
+ if [[ $(realpath "${HOMEBREW_PREFIX}") = /private/tmp/* ]]
then
odie <<EOS
-Your HOMEBREW_PREFIX is in one of the system temporary... | false |
Other | Homebrew | brew | ec6420229e003e785181c10b9f9ff8e98f1330fd.json | brew.sh: remove unused variable.
As of #4377 this is no longer used. | Library/Homebrew/brew.sh | @@ -101,7 +101,6 @@ then
# https://github.com/blog/2507-weak-cryptographic-standards-removed
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]]
then
- HOMEBREW_SYSTEM_GIT_TOO_OLD="1"
HOMEBREW_FORCE_BREWED_GIT="1"
fi
| false |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | Library/Homebrew/brew.sh | @@ -287,11 +287,6 @@ then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
fi
-if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
-then
- export HOMEBREW_LINKAGE_CACHE="1"
-fi
-
check-run-command-as-root() {
[[ "$(id -u)" = 0 ]] || return
| true |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | Library/Homebrew/dev-cmd/linkage.rb | @@ -1,4 +1,4 @@
-#: * `linkage` [`--test`] [`--reverse`] [`--cached`] <formula>:
+#: * `linkage` [`--test`] [`--reverse`] <formula>:
#: Checks the library links of an installed formula.
#:
#: Only works on installed formulae. An error is raised if it is run on
@@ -9,9 +9,6 @@
#:
#: If `--reverse` is pas... | true |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | Library/Homebrew/linkage_checker.rb | @@ -5,12 +5,10 @@
class LinkageChecker
attr_reader :undeclared_deps
- def initialize(keg, formula = nil, cache_db:,
- use_cache: !ENV["HOMEBREW_LINKAGE_CACHE"].nil?,
- rebuild_cache: false)
+ def initialize(keg, formula = nil, cache_db:, rebuild_cache: false)
@keg = keg
... | true |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | Library/Homebrew/test/dev-cmd/linkage_spec.rb | @@ -4,32 +4,16 @@
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
end
- context "no cache" do
- it "works when no arguments are provided" do
- expect { brew "linkage" }
- .to be_a_success
- .and not_to_output.to_stdout
- .and not_to_output.to_stderr
- end
-
- it "works when o... | true |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | docs/Manpage.md | @@ -779,7 +779,7 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--pry` is passed or HOMEBREW_PRY is set, pry will be
used instead of irb.
- * `linkage` [`--test`] [`--reverse`] [`--cached`] `formula`:
+ * `linkage` [`--test`] [`--reverse`] `formula`:
Checks the... | true |
Other | Homebrew | brew | 6f5c8b8509555f8da76967d73665cd84d9af06b5.json | linkage: enable cache by default.
This has not been causing any issues in CI or for `master` users so
let's now enable it by default for everyone. | manpages/brew.1 | @@ -795,7 +795,7 @@ Enter the interactive Homebrew Ruby shell\.
If \fB\-\-examples\fR is passed, several examples will be shown\. If \fB\-\-pry\fR is passed or HOMEBREW_PRY is set, pry will be used instead of irb\.
.
.TP
-\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] [\fB\-\-cached\fR] \fIformula\fR
+\fBlinkage... | true |
Other | Homebrew | brew | 547751d067f2a47afc92a96f97825f8b1238763d.json | Remove infinite loophole | Library/Homebrew/shims/linux/super/make | @@ -7,4 +7,20 @@ else
MAKE="make"
fi
export HOMEBREW_CCCFG="O$HOMEBREW_CCCFG"
+
+pathremove () {
+ local IFS=':'
+ local NEWPATH
+ local DIR
+ local PATHVARIABLE=${2:-PATH}
+ for DIR in ${!PATHVARIABLE} ; do
+ if [ "$DIR" != "$1" ] ; then
+ NEWPATH... | false |
Other | Homebrew | brew | e63feb79f9054c59cccb9ab4ce91a77d078cd349.json | Simplify check before git install
No need to check for both variables, because they're always set together.
Also, this harmonizes with the CURL equivalent just above. | Library/Homebrew/cmd/update.sh | @@ -384,9 +384,8 @@ EOS
fi
if ! git --version &>/dev/null ||
- [[ ( -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" ||
- -n "$HOMEBREW_FORCE_BREWED_GIT" ) &&
- ! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
+ [[ -n "$HOMEBREW_FORCE_BREWED_GIT" &&
+ ! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
then
... | false |
Other | Homebrew | brew | 512073ad388953152ab88802237dd469c799983c.json | cache_store: create HOMEBREW_CACHE when needed.
Fixes #4366. | Library/Homebrew/cache_store.rb | @@ -62,7 +62,10 @@ def created?
# @return [DBM] db
def db
# DBM::WRCREAT: Creates the database if it does not already exist
- @db ||= DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT)
+ @db ||= begin
+ HOMEBREW_CACHE.mkpath
+ DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT)
+ end
... | false |
Other | Homebrew | brew | b265d870ed30a97a1c37e9267efe648d661761c0.json | Allow searching Casks by name. | Library/Homebrew/cmd/search.rb | @@ -52,16 +52,17 @@ def search(argv = ARGV)
return
end
- if args.remaining.empty?
+ if args.remaining.empty? && !args.desc?
puts Formatter.columns(Formula.full_names.sort)
- elsif args.desc?
- query = args.remaining.join(" ")
- string_or_regex = query_regexp(query)
- Descrip... | true |
Other | Homebrew | brew | b265d870ed30a97a1c37e9267efe648d661761c0.json | Allow searching Casks by name. | Library/Homebrew/extend/os/mac/search.rb | @@ -3,24 +3,41 @@
module Homebrew
module Search
- def search_casks(string_or_regex)
- if string_or_regex.is_a?(String) && string_or_regex.match?(HOMEBREW_TAP_CASK_REGEX)
- return begin
- [Hbc::CaskLoader.load(string_or_regex).token]
- rescue Hbc::CaskUnavailableError
- []
+... | true |
Other | Homebrew | brew | b265d870ed30a97a1c37e9267efe648d661761c0.json | Allow searching Casks by name. | Library/Homebrew/search.rb | @@ -12,6 +12,11 @@ def query_regexp(query)
raise "#{query} is not a valid regex."
end
+ def search_descriptions(string_or_regex)
+ ohai "Formulae"
+ Descriptions.search(string_or_regex, :desc).print
+ end
+
def search_taps(query, silent: false)
if query.match?(Regexp.union(HOME... | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/brew.rb | @@ -16,14 +16,15 @@
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent
require "English"
-unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s)
- $LOAD_PATH.unshift(HOMEBREW_LIBRARY_PATH.to_s)
-end
unless $LOAD_PATH.include?("#{HOMEBREW_LIBRARY_PATH}/cask/lib")
$LOAD_PATH.unshift("#{HOMEBREW_LIB... | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/config.rb | @@ -47,4 +47,7 @@
end
# Load path used by standalone scripts to access the Homebrew code base
-HOMEBREW_LOAD_PATH = HOMEBREW_LIBRARY_PATH
+HOMEBREW_LOAD_PATH = [
+ HOMEBREW_LIBRARY_PATH,
+ HOMEBREW_LIBRARY_PATH/"cask/lib",
+].join(File::PATH_SEPARATOR) | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/dev-cmd/ruby.rb | @@ -8,6 +8,6 @@ module Homebrew
module_function
def ruby
- exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rdev-cmd/irb", *ARGV
+ exec ENV["HOMEBREW_RUBY_PATH"], "-I", HOMEBREW_LOAD_PATH, "-rglobal", "-rdev-cmd/irb", *ARGV
end
end | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/test/spec_helper.rb | @@ -14,8 +14,8 @@
require "rubocop/rspec/support"
require "find"
-$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew"))
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/cask/lib"))
+$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew"))
$LOAD_PATH... | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | @@ -83,9 +83,7 @@ def brew(*args)
@ruby_args ||= begin
ruby_args = [
"-W0",
- "-I", "#{HOMEBREW_LIBRARY_PATH}/test/support/lib",
- "-I", HOMEBREW_LIBRARY_PATH.to_s,
- "-I", "#{HOMEBREW_LIBRARY_PATH}/cask/lib",
+ "-I", HOMEBREW_LOAD_PATH,
"-rconfig"
]
... | true |
Other | Homebrew | brew | 18e46b3ec2068310a133f183564f41d183995346.json | Fix usage of `HOMEBREW_LOAD_PATH`. | Library/Homebrew/test/support/lib/config.rb | @@ -15,7 +15,11 @@
# Paths pointing into the Homebrew code base that persist across test runs
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __dir__))
HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
-HOMEBREW_LOAD_PATH = [File.expand_path(__dir__), HOMEBREW_LIBRARY_PATH... | true |
Other | Homebrew | brew | a8bfe09c499d725972543c1857365768d5739329.json | Remove tests for `brew cask search`. | Library/Homebrew/test/cask/cli/search_spec.rb | @@ -1,123 +0,0 @@
-require_relative "shared_examples/invalid_option"
-
-describe Hbc::CLI::Search, :cask do
- before do
- allow(Tty).to receive(:width).and_return(0)
- end
-
- it_behaves_like "a command that handles invalid options"
-
- it "lists the available Casks that match the search term" do
- allow(GitH... | false |
Other | Homebrew | brew | 97c12b4bbfa5a4e2d4ff0a1e59788b12503a698c.json | brew audit: avoid error on head-only formulae | Library/Homebrew/dev-cmd/audit.rb | @@ -584,6 +584,7 @@ def audit_specs
]
throttled.each_slice(2).to_a.map do |a, b|
+ next if formula.stable.nil?
version = formula.stable.version.to_s.split(".").last.to_i
if @strict && a.include?(formula.name) && version.modulo(b.to_i).nonzero?
problem "should only be ... | false |
Other | Homebrew | brew | e5212d74a6166b1c84bcc32910705da89cc1a95b.json | Diagnostic: require CLT headers on 10.14 | Library/Homebrew/extend/os/mac/diagnostic.rb | @@ -20,6 +20,7 @@ def fatal_development_tools_checks
check_xcode_minimum_version
check_clt_minimum_version
check_if_xcode_needs_clt_installed
+ check_if_clt_needs_headers_installed
].freeze
end
@@ -135,6 +136,17 @@ def check_if_xcode_needs_clt_installed
... | true |
Other | Homebrew | brew | e5212d74a6166b1c84bcc32910705da89cc1a95b.json | Diagnostic: require CLT headers on 10.14 | Library/Homebrew/test/os/mac/diagnostic_spec.rb | @@ -32,6 +32,19 @@
.to match("Xcode alone is not sufficient on El Capitan")
end
+ specify "#check_if_clt_needs_headers_installed" do
+ allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.14"))
+ allow(MacOS::CLT).to receive(:installed?).and_return(true)
+ allow(MacOS::CLT).to rec... | true |
Other | Homebrew | brew | 296f3c309ed4a44a550e454fc18a306749f06e86.json | CLT: add checks for the header package | Library/Homebrew/os/mac/xcode.rb | @@ -196,16 +196,32 @@ module CLT
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo".freeze
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI".freeze
- MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables".freeze
+ # EXECUTABLE_PKG_ID now means two things:
+ # 1. The original Mav... | false |
Other | Homebrew | brew | abb917f3819bbb2681a18ad5d2ddd30dd9c311dd.json | rubocop: exclude .simplecov under vendor | Library/Homebrew/.rubocop.yml | @@ -3,7 +3,7 @@ inherit_from:
AllCops:
Include:
- - '**/.simplecov'
+ - 'Library/Homebrew/.simplecov'
Exclude:
- 'bin/*'
- '**/Casks/**/*' | false |
Other | Homebrew | brew | 34ae75d511b2ff696ece406826eb2b0aff01ce6b.json | brew.sh: enable linkage cache for developers.
This seems stable on CI so I think we can expose it to more people. | Library/Homebrew/brew.sh | @@ -277,6 +277,11 @@ then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
fi
+if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
+then
+ export HOMEBREW_LINKAGE_CACHE="1"
+fi
+
check-run-command-as-root() {
[[ "$(id -u)" = 0 ]] || return
| true |
Other | Homebrew | brew | 34ae75d511b2ff696ece406826eb2b0aff01ce6b.json | brew.sh: enable linkage cache for developers.
This seems stable on CI so I think we can expose it to more people. | Library/Homebrew/dev-cmd/tests.rb | @@ -38,7 +38,6 @@ def tests
ENV.delete("VERBOSE")
ENV.delete("HOMEBREW_CASK_OPTS")
ENV.delete("HOMEBREW_TEMP")
- ENV.delete("HOMEBREW_LINKAGE_CACHE")
ENV.delete("HOMEBREW_NO_GITHUB_API")
ENV.delete("HOMEBREW_NO_EMOJI")
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" | true |
Other | Homebrew | brew | c68526ac09261f29bf261b530a5d449544380ecb.json | audit: remove appcast checkpoints | Library/Homebrew/cask/lib/hbc/audit.rb | @@ -26,7 +26,7 @@ def run!
check_version_and_checksum
check_version
check_sha256
- check_appcast
+ check_appcast_checkpoint
check_url
check_generic_artifacts
check_token_conflicts
@@ -185,58 +185,11 @@ def check_sha256_invalid(sha256: cask.sha256, stanza: "sha256")
... | true |
Other | Homebrew | brew | c68526ac09261f29bf261b530a5d449544380ecb.json | audit: remove appcast checkpoints | Library/Homebrew/test/cask/audit_spec.rb | @@ -317,124 +317,19 @@ def include_msg?(messages, msg)
end
end
- describe "appcast checks" do
- context "when appcast has no sha256" do
- let(:cask_token) { "appcast-missing-checkpoint" }
+ describe "appcast checkpoint check" do
+ let(:error_msg) { "Appcast checkpoints have been rem... | true |
Other | Homebrew | brew | c68526ac09261f29bf261b530a5d449544380ecb.json | audit: remove appcast checkpoints | Library/Homebrew/test/support/fixtures/cask/Casks/appcast-with-checkpoint.rb | @@ -1,4 +1,4 @@
-cask 'appcast-valid-checkpoint' do
+cask 'appcast-with-checkpoint' do
appcast 'http://localhost/appcast.xml',
checkpoint: 'd5b2dfbef7ea28c25f7a77cd7fa14d013d82b626db1d82e00e25822464ba19e2'
end | true |
Other | Homebrew | brew | fdb2406b2044d74fb28ea7844b0987c8fb9feb20.json | Add failing spec for `DependencyOrder` cop. | Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb | @@ -28,6 +28,18 @@ class Foo < Formula
RUBY
end
+ it "supports requirement constants" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ homepage "http://example.com"
+ url "http://example.com/foo-1.0.tgz"
+ depends_on FooRequirement
+ depends_on "bar"
... | false |
Other | Homebrew | brew | aaddce4743dd67f569703daba27d72b5bbfbfadf.json | Add `stderr` output to exception. | Library/Homebrew/style.rb | @@ -76,14 +76,14 @@ def check_style_impl(files, output_type, options = {})
system(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_", *args)
!$CHILD_STATUS.success?
when :json
- json, _, status = Open3.capture3(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_", "--format", "json",... | false |
Other | Homebrew | brew | 3329a9f6d8d7aa6f9e37c33f6d4cc650ab6ea117.json | text_cop: require cargo to use `install` instead of `build` | Library/Homebrew/rubocops/text_cop.rb | @@ -53,6 +53,10 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
next if parameters_passed?(d, /vendor-only/)
problem "use \"dep\", \"ensure\", \"-vendor-only\""
end
+
+ find_method_with_args(body_node, :system, "cargo", "build") do
+ probl... | true |
Other | Homebrew | brew | 3329a9f6d8d7aa6f9e37c33f6d4cc650ab6ea117.json | text_cop: require cargo to use `install` instead of `build` | Library/Homebrew/test/rubocops/text_cop_spec.rb | @@ -191,5 +191,19 @@ def install
end
RUBY
end
+
+ it "When cargo build is executed" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ url "http://example.com/foo-1.0.tgz"
+ homepage "http://example.com"
+
+ def install
+ system "cargo", "build... | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/cask/lib/hbc.rb | @@ -28,7 +28,6 @@
module Hbc
def self.init
- Cache.ensure_cache_exists
Caskroom.ensure_caskroom_exists
end
end | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/cask/lib/hbc/cache.rb | @@ -5,12 +5,5 @@ module Cache
def path
@path ||= HOMEBREW_CACHE.join("Cask")
end
-
- def ensure_cache_exists
- return if path.exist?
-
- odebug "Creating Cache at #{path}"
- path.mkpath
- end
end
end | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/cask/lib/hbc/cli/cleanup.rb | @@ -8,10 +8,6 @@ def self.help
"cleans up cached downloads and tracker symlinks"
end
- def self.needs_init?
- true
- end
-
attr_reader :cache_location
def initialize(*args, cache_location: Cache.path)
@@ -24,7 +20,7 @@ def run
end
def cache_files
- ... | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/cask/lib/hbc/cli/fetch.rb | @@ -17,10 +17,6 @@ def run
end
end
- def self.needs_init?
- true
- end
-
def self.help
"downloads remote application files to local cache"
end | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/cask/lib/hbc/download_strategy.rb | @@ -95,6 +95,8 @@ def _fetch
end
def fetch
+ tarball_path.dirname.mkpath
+
ohai "Downloading #{@url}"
if tarball_path.exist?
puts "Already downloaded: #{tarball_path}"
@@ -193,6 +195,8 @@ def repo_url
# super does not provide checks for already-existing downloads
def ... | true |
Other | Homebrew | brew | b2f67c6d776170b64a2963e175f96f23eef4646e.json | Remove the need for `ensure_cache_exists`. | Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb | @@ -23,7 +23,7 @@
begin
HOMEBREW_CASK_DIRS.values.each(&:mkpath)
- [Hbc::Config.global.binarydir, Hbc::Caskroom.path, Hbc::Cache.path].each(&:mkpath)
+ [Hbc::Config.global.binarydir, Hbc::Caskroom.path].each(&:mkpath)
Tap.default_cask_tap.tap do |tap|
FileUtils.mkdir_p tap.path... | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/cache.rb | @@ -2,11 +2,15 @@ module Hbc
module Cache
module_function
+ def path
+ @path ||= HOMEBREW_CACHE.join("Cask")
+ end
+
def ensure_cache_exists
- return if Hbc.cache.exist?
+ return if path.exist?
- odebug "Creating Cache at #{Hbc.cache}"
- Hbc.cache.mkpath
+ odebug "Cr... | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/cask_loader.rb | @@ -78,7 +78,7 @@ def self.can_load?(ref)
def initialize(url)
@url = URI(url)
- super Hbc.cache/File.basename(@url.path)
+ super Cache.path/File.basename(@url.path)
end
def load | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/caskroom.rb | @@ -2,22 +2,26 @@ module Hbc
module Caskroom
module_function
+ def path
+ @path ||= HOMEBREW_PREFIX.join("Caskroom")
+ end
+
def ensure_caskroom_exists
- return if Hbc.caskroom.exist?
+ return if path.exist?
- ohai "Creating Caskroom at #{Hbc.caskroom}" if $stdout.tty?
- ... | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/cli/cleanup.rb | @@ -14,7 +14,7 @@ def self.needs_init?
attr_reader :cache_location
- def initialize(*args, cache_location: Hbc.cache)
+ def initialize(*args, cache_location: Cache.path)
super(*args)
@cache_location = Pathname.new(cache_location)
end | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/cli/doctor.rb | @@ -60,7 +60,7 @@ def check_install_location
def check_staging_location
ohai "Homebrew-Cask Staging Location"
- path = Pathname.new(user_tilde(Hbc.caskroom.to_s))
+ path = Pathname.new(user_tilde(Caskroom.path.to_s))
if !path.exist?
add_error "The staging path #{pat... | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/download_strategy.rb | @@ -36,7 +36,7 @@ class HbVCSDownloadStrategy < AbstractDownloadStrategy
def initialize(*args, **options)
super(*args, **options)
@ref_type, @ref = extract_ref
- @clone = Hbc.cache.join(cache_filename)
+ @clone = Cache.path.join(cache_filename)
end
def extract_ref
@@ -65,7 +65,7... | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/dsl.rb | @@ -220,7 +220,7 @@ def artifacts
end
def caskroom_path
- @caskroom_path ||= Hbc.caskroom.join(token)
+ @caskroom_path ||= Caskroom.path.join(token)
end
def staged_path | true |
Other | Homebrew | brew | 3d423b0587d54029cc60616d506318425c22e7a4.json | Add `path` method to `Caskroom` and `Cache`. | Library/Homebrew/cask/lib/hbc/locations.rb | @@ -6,14 +6,6 @@ def self.included(base)
end
module ClassMethods
- def caskroom
- @caskroom ||= HOMEBREW_PREFIX.join("Caskroom")
- end
-
- def cache
- @cache ||= HOMEBREW_CACHE.join("Cask")
- end
-
attr_writer :default_tap
def default_tap | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.