Sha256: b7fc7eeedfbde03846beab193164a96d2ae7d69e025638d7b4c018d6414d46a8
Contents?: true
Size: 816 Bytes
Versions: 20
Compression:
Stored size: 816 Bytes
Contents
# frozen_string_literal: true module BoxtRubyStyleGuide # Returns a list of files that have changed, as detected by `git-diff` # # TODO: Write tests for this to ensure we're pulling the desired diff files # see: https://github.com/ruby-git/ruby-git class GitDiff require "git" ## # List of Git statuses we should test # See: https://git-scm.com/docs/git-status#_short_format TEST_STATUSES = %w[M A U].freeze attr_reader :base def initialize(base:) @base = base end ## # A list of the local file paths of Ruby files with committed changes. # # Returns Array def all @all ||= git.diff(base).name_status.select { |_, stat| TEST_STATUSES.include?(stat) }.keys end private def git @git ||= Git.open(".") end end end
Version data entries
20 entries across 20 versions & 1 rubygems