From 1bf9ed196cf3091e1232ab7e5a91b22c4086997b Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 26 Oct 2022 15:39:03 +1000 Subject: [PATCH] tasks: enable rake docs to open on macOS The `xdg-open` command is not available on macOS. macOS uses the `open` command. Add info to install doxygen on macOS with Homebrew. https://formulae.brew.sh/formula/doxygen --- tasks/doc.rake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tasks/doc.rake b/tasks/doc.rake index 8a9108f1a..353c42d9d 100644 --- a/tasks/doc.rake +++ b/tasks/doc.rake @@ -22,6 +22,8 @@ namespace :doc do puts " $ sudo apt-get install doxygen" puts "On RHEL-based systems:" puts " $ sudo dnf install doxygen" + puts "On macOS-based systems:" + puts " $ brew install doxygen" end end @@ -43,12 +45,20 @@ namespace :doc do namespace :view do desc 'open yard docs' task :api do - sh 'xdg-open doc/api/index.html' + if RUBY_PLATFORM.include?('darwin') + sh 'open doc/api/index.html' + else + sh 'xdg-open doc/api/index.html' + end end desc 'open doxygen docs' task :capi do - sh 'xdg-open doc/capi/html/index.html' + if RUBY_PLATFORM.include?('darwin') + sh 'open doc/capi/html/index.html' + else + sh 'xdg-open doc/capi/html/index.html' + end end end end