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.
@@ -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,15 +45,23 @@ namespace :doc do
namespace :view do
desc 'open yard docs'
task :api do
+ 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
+ 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
# deprecated
task "api_doc" => "doc:api"
