Class: RubocopPr::CLI::ProcessCop
- Inherits:
-
Object
- Object
- RubocopPr::CLI::ProcessCop
- Defined in:
- lib/rubocop_pr/cli/process_cop.rb
Overview
Cop processor
Instance Attribute Summary collapse
-
#cop ⇒ Object
readonly
Returns the value of attribute cop.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(git:, repository:, cop:, options:) ⇒ ProcessCop
constructor
A new instance of ProcessCop.
Constructor Details
#initialize(git:, repository:, cop:, options:) ⇒ ProcessCop
Returns a new instance of ProcessCop.
7 8 9 10 11 12 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 7 def initialize(git:, repository:, cop:, options:) @git = git @repository = repository @cop = cop = end |
Instance Attribute Details
#cop ⇒ Object (readonly)
Returns the value of attribute cop.
5 6 7 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 5 def cop @cop end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
5 6 7 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 5 def git @git end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 5 def end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
5 6 7 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 5 def repository @repository end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rubocop_pr/cli/process_cop.rb', line 14 def call return false if exit_early? checkout_to_target_branch_throw_master_branch git.commit_all(issue.title) git.push create_pr end |