Add language method to OS::Mac.
This commit is contained in:
parent
f37d004ab5
commit
0243e1f9a7
@ -41,6 +41,10 @@ module OS
|
||||
version.to_sym
|
||||
end
|
||||
|
||||
def language
|
||||
@language ||= Utils.popen_read("defaults", "read", ".GlobalPreferences", "AppleLanguages").delete(" \n\"()").sub(/,.*/, "")
|
||||
end
|
||||
|
||||
# Locates a (working) copy of install_name_tool, guaranteed to function
|
||||
# whether the user has developer tools installed or not.
|
||||
def install_name_tool
|
||||
|
||||
8
Library/Homebrew/test/test_os_mac_language.rb
Normal file
8
Library/Homebrew/test/test_os_mac_language.rb
Normal file
@ -0,0 +1,8 @@
|
||||
require "testing_env"
|
||||
require "os/mac"
|
||||
|
||||
class OSMacLanguageTests < Homebrew::TestCase
|
||||
def test_language_format
|
||||
assert_match %r{\A[a-z]{2}(-[A-Z]{2})?\Z}, OS::Mac.language
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user