Module: MacIosInfo
- Defined in:
- lib/mac_ios_info.rb,
lib/mac_ios_info/version.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.macos_build_to_macos_version(build_number:) ⇒ Object
Change macOS build number to macOS version.
-
.macos_version_to_os_name(version:) ⇒ Object
Change version to macOS Name.
Class Method Details
.macos_build_to_macos_version(build_number:) ⇒ Object
Change macOS build number to macOS version
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/mac_ios_info.rb', line 9 def self.macos_build_to_macos_version(build_number:) case build_number # macOS Big Sur when "20D80" then "11.2.2" when "20D74", "20D75" then "11.2.1" when "20D64" then "11.2" when "20C69" then "11.1" when "20B29", "20B50" then "11.0.1" when "20A2411" then "11.0.0" # macOS Catalina when "19H2", "19H15" then "10.15.7" when "19G73", "19G2021" then "10.15.6" when "19F101", "19F96" then "10.15.5" when "19E266" then "10.15.4" when "19D76" then "10.15.3" when "19C57" then "10.15.2" when "19B88" then "10.15.1" when "19A583", "19A602", "19A603" then "10.15" # macOS Mojave when "18G84", "18G103", "18G1012", "18G95" then "10.14.6" when "18F132", "18F203" then "10.14.5" when "18E226", "18E227" then "10.14.4" when "18D42", "18D43", "18D109" then "10.14.3" when "18C54" then "10.14.2" when "18B75", "18B2107", "18B3094" then "10.14.1" when "18A391" then "10.14" # macOS High Sierra when "17G65", "17G6029" then "10.13.6" when "17F77" then "10.13.5" when "17E199", "17E201", "17E202" then "10.13.4" when "17D47", "17D102", "17D2047", "17D2102" then "10.13.3" when "17C88", "17C89", "17C205", "17C2205" then "10.13.2" when "17B48", "17B1002", "17B1003" then "10.13.1" when "17A365", "17A405" then "10.13" else "UnKnown" end end |
.macos_version_to_os_name(version:) ⇒ Object
Change version to macOS Name
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mac_ios_info.rb', line 79 def self.macos_version_to_os_name(version:) major_version = version.split(".")[0].to_i minor_version = version.split(".")[1].to_i # reference https://support.apple.com/ja-jp/HT201260 case major_version when 11 return "macOS Big Sur" end case minor_version when 15 "macOS Catalina" when 14 "macOS Mojave" when 13 "macOS High Sierra" when 12 "macOS Sierra" else "UnKnown" end end |