Class: Simp::Cli::Commands::Doc

Inherits:
Simp::Cli show all
Defined in:
lib/simp/cli/commands/doc.rb

Constant Summary

Constants inherited from Simp::Cli

VERSION

Class Method Summary collapse

Methods inherited from Simp::Cli

menu

Class Method Details

.helpObject



11
12
13
# File 'lib/simp/cli/commands/doc.rb', line 11

def self.help
  puts "Show SIMP documentation in elinks"
end

.run(args = Array.new) ⇒ Object



4
5
6
7
8
9
# File 'lib/simp/cli/commands/doc.rb', line 4

def self.run(args = Array.new)
  raise "Package 'simp-doc' is not installed, cannot continue" unless system("rpm -q --quiet simp-doc")
  pupdoc = %x{rpm -ql simp-doc | grep html/index.html$ | head -1}.strip.chomp
  raise "Could not find the SIMP documentation. Please ensure that you can access '#{pupdoc}'." unless File.exists?(pupdoc)
  exec("links #{pupdoc}")
end