Class: RuboCop::Git::PseudoPullRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/git/pseudo_pull_request.rb

Overview

Constant Summary collapse

HOUND_CONFIG_FILE =
'.hound.yml'

Instance Method Summary collapse

Constructor Details

#initialize(files, options) ⇒ PseudoPullRequest

Returns a new instance of PseudoPullRequest.



7
8
9
10
# File 'lib/rubocop/git/pseudo_pull_request.rb', line 7

def initialize(files, options)
  @files = files
  @options = options
end

Instance Method Details

#configObject



18
19
20
21
22
23
# 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_filesObject



12
13
14
15
16
# File 'lib/rubocop/git/pseudo_pull_request.rb', line 12

def pull_request_files
  @files.map do |file|
    build_commit_file(file)
  end
end