Module: Gergich

Includes:
Logging
Defined in:
lib/gergich.rb,
lib/gergich/capture.rb,
lib/gergich/capture/tsc_capture.rb,
lib/gergich/capture/eslint_capture.rb,
lib/gergich/capture/flake8_capture.rb,
lib/gergich/capture/rubocop_capture.rb,
lib/gergich/capture/brakeman_capture.rb,
lib/gergich/capture/yamllint_capture.rb,
lib/gergich/capture/i18nliner_capture.rb,
lib/gergich/capture/stylelint_capture.rb,
lib/gergich/capture/swiftlint_capture.rb,
lib/gergich/capture/shellcheck_capture.rb,
lib/gergich/capture/androidlint_capture.rb

Defined Under Namespace

Modules: Capture Classes: API, Commit, Draft, FileReview, Review

Class Method Summary collapse

Methods included from Logging

log_level, logger, #logger

Class Method Details

.git(args) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gergich.rb', line 21

def self.git(args)
  Dir.chdir(GERGICH_GIT_PATH) do
    raise(GergichError, "git not installed") unless system("which git > /dev/null 2>&1")

    output, error, status = Open3.capture3("git #{args}")
    if status.success?
      Logging.logger.debug "git #{args}: #{output}"
      output
    else
      Logging.logger.warn "Output: #{output}"
      Logging.logger.warn "git #{args} failed: #{error}"
      nil
    end
  end
end

.use_git?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/gergich.rb', line 17

def self.use_git?
  !git("rev-parse --show-toplevel").nil?
end