diff options
| author | Viktor Szakats | 2017-08-27 17:52:26 +0000 |
|---|---|---|
| committer | Viktor Szakats | 2017-08-27 17:52:26 +0000 |
| commit | 11b267a7cfb3411c74c4fc21732463d543fc4fb3 (patch) | |
| tree | c3eace78187a54b613af0eec6ee9c00e4151cbc3 /Library/Homebrew/dev-cmd | |
| parent | 923c84d4f7c4e0cf09bfb417deb83bff2364c199 (diff) | |
| download | brew-11b267a7cfb3411c74c4fc21732463d543fc4fb3.tar.bz2 | |
try addressing style issues
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 4fadae1a4..97fc93db9 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -240,26 +240,25 @@ class FormulaAuditor return "The URL #{url} could use HTTPS rather than HTTP" end - if type == "homepage" + return if type != "homepage" - details[:file] = details[:file].gsub(/https?:\\?\/\\?\//, '/') - secure_details[:file] = secure_details[:file].gsub(/https?:\\?\/\\?\//, '/') + details[:file] = details[:file].gsub(%r{https?:\\?\/\\?\/}, "/") + secure_details[:file] = secure_details[:file].gsub(%r{https?:\\?\/\\?\/}, "/") - # Same content after normalization - if details[:file] == secure_details[:file] - return "The URL #{url} could use HTTPS rather than HTTP" - end + # Same content after normalization + if details[:file] == secure_details[:file] + return "The URL #{url} could use HTTPS rather than HTTP" + end - # Same size, different content after normalization - # (typical causes: Generated ID, Timestamp, Unix time) - if details[:file].length == secure_details[:file].length - return "The URL #{url} could use HTTPS rather than HTTP" - end + # Same size, different content after normalization + # (typical causes: Generated ID, Timestamp, Unix time) + if details[:file].length == secure_details[:file].length + return "The URL #{url} could use HTTPS rather than HTTP" + end - lenratio = (100 * secure_details[:file].length / details[:file].length).to_i - if lenratio >= 90 && lenratio <= 120 - return "The URL #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser." - end + lenratio = (100 * secure_details[:file].length / details[:file].length).to_i + if lenratio >= 90 && lenratio <= 120 + return "The URL #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser." end end |
