class RuboCop::Git::PseudoPullRequest

ref. github.com/thoughtbot/hound/blob/d2f3933/app/models/pull_request.rb

Constants

HOUND_CONFIG_FILE

Public Class Methods

new(files, options) click to toggle source
# File lib/rubocop/git/pseudo_pull_request.rb, line 7
def initialize(files, options)
  @files = files
  @options = options
end

Public Instance Methods

config() click to toggle source
# File lib/rubocop/git/pseudo_pull_request.rb, line 18
def config
  return unless @options.hound
  File.read(HOUND_CONFIG_FILE)
rescue Errno::ENOENT
  nil
end
pull_request_files() click to toggle source
# File lib/rubocop/git/pseudo_pull_request.rb, line 12
def pull_request_files
  @files.map do |file|
    build_commit_file(file)
  end
end

Private Instance Methods

build_commit_file(file) click to toggle source
# File lib/rubocop/git/pseudo_pull_request.rb, line 27
def build_commit_file(file)
  CommitFile.new(file, head_commit)
end
head_commit() click to toggle source
# File lib/rubocop/git/pseudo_pull_request.rb, line 31
def head_commit
  @head_commit ||= Commit.new(@options)
end