diff options
| author | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
| commit | e767fd3df9d179fca0445cc0bc0fdc061ad857d6 (patch) | |
| tree | 93e9db33313b36eebe7d7fb3aedf0f92cc2c3918 /Library/Homebrew/utils | |
| parent | 7fc241765e3654718235791c32e5638bf7f8e15a (diff) | |
| parent | 232078df57418004bb9bf7abef877e734fcf7005 (diff) | |
| download | brew-e767fd3df9d179fca0445cc0bc0fdc061ad857d6.tar.bz2 | |
Merge branch 'master' into mkdir_with_intermediates
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/git.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/utils/github.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/utils/json.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils/popen.rb | 7 |
4 files changed, 6 insertions, 10 deletions
diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index 837cc22e4..dfe47f890 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -22,9 +22,7 @@ module Utils return if git_available? # we cannot install brewed git if homebrew/core is unavailable. - unless CoreTap.instance.installed? - raise "Git is unavailable" - end + raise "Git is unavailable" unless CoreTap.instance.installed? begin oh1 "Installing git" diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 654272363..b7ec538f9 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -2,7 +2,8 @@ require "uri" require "tempfile" module GitHub - extend self + module_function + ISSUES_URI = URI.parse("https://api.github.com/search/issues") Error = Class.new(RuntimeError) diff --git a/Library/Homebrew/utils/json.rb b/Library/Homebrew/utils/json.rb index 8a8cb6847..19d32a1e1 100644 --- a/Library/Homebrew/utils/json.rb +++ b/Library/Homebrew/utils/json.rb @@ -2,7 +2,7 @@ require "vendor/okjson" module Utils module JSON - extend self + module_function Error = Class.new(StandardError) diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb index 76e67b3a9..350d9a09f 100644 --- a/Library/Homebrew/utils/popen.rb +++ b/Library/Homebrew/utils/popen.rb @@ -14,11 +14,8 @@ module Utils def self.popen(args, mode) IO.popen("-", mode) do |pipe| if pipe - if block_given? - yield pipe - else - return pipe.read - end + return pipe.read unless block_given? + yield pipe else $stderr.reopen("/dev/null", "w") exec(*args) |
