From 95676d30fccfacc0215edd9820a45c094d9edfc8 Mon Sep 17 00:00:00 2001 From: Piotr Usewicz Date: Wed, 22 Apr 2020 10:45:50 +0200 Subject: Execute uname once --- lib/ruby2d/font.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ruby2d/font.rb b/lib/ruby2d/font.rb index 08f6b17..d83b315 100644 --- a/lib/ruby2d/font.rb +++ b/lib/ruby2d/font.rb @@ -63,11 +63,12 @@ module Ruby2D end # If MRuby else - if `uname`.include? 'Darwin' # macOS + uname = `uname` + if uname.include? 'Darwin' # macOS macos_font_path - elsif `uname`.include? 'Linux' + elsif uname.include? 'Linux' linux_font_path - elsif `uname`.include? 'MINGW' + elsif uname.include? 'MINGW' windows_font_path end end -- cgit v1.2.3