diff options
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) |
