Class: RubocopPr::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_pr/repository.rb

Overview

abstract repository class

Direct Known Subclasses

RubocopPr::Repositories::Github

Class Method Summary collapse

Class Method Details

.allObject



5
6
7
# File 'lib/rubocop_pr/repository.rb', line 5

def all
  @all ||= ::ActiveSupport::HashWithIndifferentAccess.new
end

.checksObject

Array of Class which respond_to ::call and raise if check do not pass



14
15
16
# File 'lib/rubocop_pr/repository.rb', line 14

def checks
  []
end

.create_issueObject

return Integer issue number

Raises:

  • (NotImplemented)


19
20
21
# File 'lib/rubocop_pr/repository.rb', line 19

def create_issue(*)
  raise NotImplemented, 'should be implemented on sub-class'
end

.create_pull_requestObject

return Integer pull_request number

Raises:

  • (NotImplemented)


24
25
26
# File 'lib/rubocop_pr/repository.rb', line 24

def create_pull_request(*)
  raise NotImplemented, 'should be implemented on sub-class'
end

.inherited(base) ⇒ Object



9
10
11
# File 'lib/rubocop_pr/repository.rb', line 9

def inherited(base)
  all[base.name.demodulize.underscore] = base
end