Class: Certs::Command
- Inherits:
-
Object
- Object
- Certs::Command
- Defined in:
- lib/cert-help/command.rb
Overview
Provides terminal access to the ruby api
Deligates commands based on user input, displaying version, help, and listing certificates based on searches
Class Method Summary collapse
-
.deligate(major, minor) ⇒ Object
Decides which command to execute based on major, minor.
-
.execute(*args) ⇒ Object
Terns ARGV to marjor, minor commands.
-
.help ⇒ Object
Informs the user how to use this program.
-
.version ⇒ Object
Shows the user which version is being used.
Class Method Details
.deligate(major, minor) ⇒ Object
Decides which command to execute based on major, minor
25 26 27 28 29 30 31 32 |
# File 'lib/cert-help/command.rb', line 25 def deligate(major, minor) return version if ['-v', '--version'].include?(major) return Certs::Apple.execute(minor) if major == 'apple' return Certs::Search.execute(minor) if major == 'search' help end |
.execute(*args) ⇒ Object
Terns ARGV to marjor, minor commands
15 16 17 18 19 20 21 22 |
# File 'lib/cert-help/command.rb', line 15 def execute(*args) major = args.shift minor = args.shift deligate(major, minor) end |
.help ⇒ Object
Informs the user how to use this program
35 36 37 38 39 40 41 |
# File 'lib/cert-help/command.rb', line 35 def help puts "#{Certs::COMMAND} <command>" puts "\t-h --help prints this help screen" puts "\t-v --version show the current version" puts "\tsearch <term> search for a certificate" puts "\tapple <method> find apple certificates" end |