Method: Maximus::CLI#git

Defined in:
lib/maximus/cli.rb

#gitObject

Since:

  • 0.1.0



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/maximus/cli.rb', line 57

def git
  all_tasks = ['frontend', 'backend', 'statistics']
  # If all flag is enabled, run everything
  return all_tasks.each { |a| send(a) } if options[:all]
  # Lint by category unless all flags are blank
  return all_tasks.each { |a| check_option(a) } unless options[:frontend].blank? && options[:backend].blank? && options[:statistics].blank?
  # If include flag is enabled, run based on what's included
  return options[:include].each { |i| send(i) } unless options[:include].blank?
  # If all flag is not enabled, lint working copy as it's supposed to be
  @config.settings[:commit] = options[:git]
  Maximus::GitControl.new({config: @config}).lints_and_stats(true)
  @config.destroy_temp
end