aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/mac
diff options
context:
space:
mode:
authorBrewTestBot2015-08-03 13:09:07 +0100
committerMike McQuaid2015-08-03 13:22:35 +0100
commit13d544e11e92ba8ea3788723432046f8dfe4adf9 (patch)
treee6da18436d9ce956e6fbe80e3185c67cf3b58808 /Library/Homebrew/os/mac
parent3b68215be793774fafd9ce124a2065f5968f50e5 (diff)
downloadbrew-13d544e11e92ba8ea3788723432046f8dfe4adf9.tar.bz2
Core files style updates.
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/os/mac')
-rw-r--r--Library/Homebrew/os/mac/hardware.rb38
-rw-r--r--Library/Homebrew/os/mac/version.rb20
-rw-r--r--Library/Homebrew/os/mac/xcode.rb4
-rw-r--r--Library/Homebrew/os/mac/xquartz.rb18
4 files changed, 41 insertions, 39 deletions
diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb
index 60de1eba8..11cf0142a 100644
--- a/Library/Homebrew/os/mac/hardware.rb
+++ b/Library/Homebrew/os/mac/hardware.rb
@@ -1,16 +1,18 @@
-require 'mach'
+require "mach"
module MacCPUs
OPTIMIZATION_FLAGS = {
- :penryn => '-march=core2 -msse4.1',
- :core2 => '-march=core2',
- :core => '-march=prescott',
- :g3 => '-mcpu=750',
- :g4 => '-mcpu=7400',
- :g4e => '-mcpu=7450',
- :g5 => '-mcpu=970'
+ :penryn => "-march=core2 -msse4.1",
+ :core2 => "-march=core2",
+ :core => "-march=prescott",
+ :g3 => "-mcpu=750",
+ :g4 => "-mcpu=7400",
+ :g4e => "-mcpu=7450",
+ :g5 => "-mcpu=970"
}.freeze
- def optimization_flags; OPTIMIZATION_FLAGS; end
+ def optimization_flags
+ OPTIMIZATION_FLAGS
+ end
# These methods use info spewed out by sysctl.
# Look in <mach/machine.h> for decoding info.
@@ -92,7 +94,7 @@ module MacCPUs
def universal_archs
# Building 64-bit is a no-go on Tiger, and pretty hit or miss on Leopard.
# Don't even try unless Tigerbrew's experimental 64-bit Leopard support is enabled.
- if MacOS.version <= :leopard and !MacOS.prefer_64_bit?
+ if MacOS.version <= :leopard && !MacOS.prefer_64_bit?
[arch_32_bit].extend ArchitectureListExtension
else
[arch_32_bit, arch_64_bit].extend ArchitectureListExtension
@@ -108,35 +110,35 @@ module MacCPUs
end
def aes?
- sysctl_bool('hw.optional.aes')
+ sysctl_bool("hw.optional.aes")
end
def altivec?
- sysctl_bool('hw.optional.altivec')
+ sysctl_bool("hw.optional.altivec")
end
def avx?
- sysctl_bool('hw.optional.avx1_0')
+ sysctl_bool("hw.optional.avx1_0")
end
def avx2?
- sysctl_bool('hw.optional.avx2_0')
+ sysctl_bool("hw.optional.avx2_0")
end
def sse3?
- sysctl_bool('hw.optional.sse3')
+ sysctl_bool("hw.optional.sse3")
end
def ssse3?
- sysctl_bool('hw.optional.supplementalsse3')
+ sysctl_bool("hw.optional.supplementalsse3")
end
def sse4?
- sysctl_bool('hw.optional.sse4_1')
+ sysctl_bool("hw.optional.sse4_1")
end
def sse4_2?
- sysctl_bool('hw.optional.sse4_2')
+ sysctl_bool("hw.optional.sse4_2")
end
private
diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb
index febbfd4f7..9a529df80 100644
--- a/Library/Homebrew/os/mac/version.rb
+++ b/Library/Homebrew/os/mac/version.rb
@@ -1,17 +1,17 @@
-require 'version'
+require "version"
module OS
module Mac
class Version < ::Version
SYMBOLS = {
- :el_capitan => '10.11',
- :yosemite => '10.10',
- :mavericks => '10.9',
- :mountain_lion => '10.8',
- :lion => '10.7',
- :snow_leopard => '10.6',
- :leopard => '10.5',
- :tiger => '10.4',
+ :el_capitan => "10.11",
+ :yosemite => "10.10",
+ :mavericks => "10.9",
+ :mountain_lion => "10.8",
+ :lion => "10.7",
+ :snow_leopard => "10.6",
+ :leopard => "10.5",
+ :tiger => "10.4"
}
def self.from_symbol(sym)
@@ -38,7 +38,7 @@ module OS
end
def pretty_name
- to_sym.to_s.split('_').map(&:capitalize).join(' ')
+ to_sym.to_s.split("_").map(&:capitalize).join(" ")
end
end
end
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 766443419..83ba84ff8 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -60,7 +60,7 @@ module OS
end
def installed?
- not prefix.nil?
+ !prefix.nil?
end
def version
@@ -178,7 +178,7 @@ module OS
else
version = `/usr/bin/clang --version`
end
- version = version[%r{clang-(\d+\.\d+\.\d+(\.\d+)?)}, 1] || "0"
+ version = version[/clang-(\d+\.\d+\.\d+(\.\d+)?)/, 1] || "0"
version < latest_version
end
diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb
index 9c717367e..b253ad8e0 100644
--- a/Library/Homebrew/os/mac/xquartz.rb
+++ b/Library/Homebrew/os/mac/xquartz.rb
@@ -22,7 +22,7 @@ module OS
"2.7.53" => "2.7.5_rc4",
"2.7.54" => "2.7.5",
"2.7.61" => "2.7.6",
- "2.7.73" => "2.7.7",
+ "2.7.73" => "2.7.7"
}.freeze
# This returns the version number of XQuartz, not of the upstream X.org.
@@ -69,10 +69,10 @@ module OS
# educated guess as to what version is installed.
def guess_system_version
case MacOS.version
- when '10.5' then '2.1.6'
- when '10.6' then '2.3.6'
- when '10.7' then '2.6.3'
- else 'dunno'
+ when "10.5" then "2.1.6"
+ when "10.6" then "2.3.6"
+ when "10.7" then "2.6.3"
+ else "dunno"
end
end
@@ -93,10 +93,10 @@ module OS
# remain public. New code should use MacOS::X11.bin, MacOS::X11.lib and
# MacOS::X11.include instead, as that accounts for Xcode-only systems.
def prefix
- @prefix ||= if Pathname.new('/opt/X11/lib/libpng.dylib').exist?
- Pathname.new('/opt/X11')
- elsif Pathname.new('/usr/X11/lib/libpng.dylib').exist?
- Pathname.new('/usr/X11')
+ @prefix ||= if Pathname.new("/opt/X11/lib/libpng.dylib").exist?
+ Pathname.new("/opt/X11")
+ elsif Pathname.new("/usr/X11/lib/libpng.dylib").exist?
+ Pathname.new("/usr/X11")
end
end