Class: CodeUnion::Command::Main

Inherits:
Base
  • Object
show all
Defined in:
lib/codeunion/command/main.rb

Overview

The built-in main ‘codeunion` command

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CodeUnion::Command::Base

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/codeunion/command/main.rb', line 16

def exist?
  File.which(executable_name)
end

#runObject



8
9
10
11
12
13
14
# File 'lib/codeunion/command/main.rb', line 8

def run
  if exist?
    exec(executable_name, *command_args)
  else
    fail CommandNotFound, "Unknown command `#{command_name}`."
  end
end