Class: GitFeats::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/git-feats/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Runner

Creates a new Runner

args - The args to be run with git



7
8
9
10
11
# File 'lib/git-feats/runner.rb', line 7

def initialize(*args)
  @args = Args.new(args)
  # parse args for feats
  Checker.check(@args)
end

Class Method Details

.run(*args) ⇒ Object

Run shortcut



14
15
16
# File 'lib/git-feats/runner.rb', line 14

def self.run(*args)
  new(*args).run
end

Instance Method Details

#runObject

Run the args as one of the following:

  • Pure git-feats command

  • Overridden git command

  • Pure git command



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/git-feats/runner.rb', line 22

def run
  # Pure git-feats command
  case @args[0]
  when "feats"
    run_feats_cmd

  # Overriden git command
  when "version" || "--version"
    version

  # Pure git command
  else
    exec_args
  end
end