diff options
| author | Markus Reiter | 2016-09-24 17:38:49 +0200 |
|---|---|---|
| committer | GitHub | 2016-09-24 17:38:49 +0200 |
| commit | e2c7509065d8cd6fd76cd631f5c8d1068df49cad (patch) | |
| tree | 03eee4f10d15a33674735be36d0939da964ab60c /Library/Homebrew/patch.rb | |
| parent | eb3b94d94a7329d92171b75ea163f139cbf71aa6 (diff) | |
| parent | 58e36c73193befb57d351344cea2a4a33fef850d (diff) | |
| download | brew-e2c7509065d8cd6fd76cd631f5c8d1068df49cad.tar.bz2 | |
Merge pull request #1113 from reitermarkus/rubocop-guardclause
RuboCop: Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/patch.rb')
| -rw-r--r-- | Library/Homebrew/patch.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 74e58e526..1b7751ba3 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -130,14 +130,13 @@ class ExternalPatch patch_dir = Pathname.pwd if patch_files.empty? children = patch_dir.children - if children.length == 1 && children.first.file? - patch_files << children.first.basename - else + if children.length != 1 || !children.first.file? raise MissingApplyError, <<-EOS.undent There should be exactly one patch file in the staging directory unless the "apply" method was used one or more times in the patch-do block. EOS end + patch_files << children.first.basename end dir.cd do patch_files.each do |patch_file| |
