Class: RubocopChallenger::PullRequest
- Inherits:
-
Object
- Object
- RubocopChallenger::PullRequest
- Defined in:
- lib/rubocop_challenger/pull_request.rb
Overview
Creates a pull request
Instance Method Summary collapse
-
#commit!(message) { ... } ⇒ Object
Add and commit local files to the pull request.
-
#create_regenerate_todo_pr!(before_version, after_version) ⇒ Boolean
Creates a pull request which re-generate “.rubocop_todo.yml” with new version RuboCop.
-
#create_rubocop_challenge_pr!(rule, template_file_path = nil) ⇒ Boolean
Creates a pull request for the Rubocop Challenge.
-
#initialize(user_name:, user_email:, **options) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(user_name:, user_email:, **options) ⇒ PullRequest
Returns a new instance of PullRequest.
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubocop_challenger/pull_request.rb', line 26 def initialize(user_name:, user_email:, **) # rubocop:disable Metrics/MethodLength @pr_comet = PrComet.new( base: [:base_branch], branch: "rubocop-challenge/#{}", user_name: user_name, user_email: user_email, verbose: [:verbose] ) @labels = [:labels] @dry_run = [:dry_run] @project_column_name = [:project_column_name] @project_id = [:project_id] end |
Instance Method Details
#commit!(message) { ... } ⇒ Object
Add and commit local files to the pull request
45 46 47 |
# File 'lib/rubocop_challenger/pull_request.rb', line 45 def commit!(, &block) pr_comet.commit , &block end |
#create_regenerate_todo_pr!(before_version, after_version) ⇒ Boolean
Creates a pull request which re-generate “.rubocop_todo.yml” with new version RuboCop.
75 76 77 78 79 80 |
# File 'lib/rubocop_challenger/pull_request.rb', line 75 def create_regenerate_todo_pr!(before_version, after_version) create_pull_request!( title: "Re-generate .rubocop_todo.yml with RuboCop v#{after_version}", body: generate_pull_request_body(before_version, after_version) ) end |
#create_rubocop_challenge_pr!(rule, template_file_path = nil) ⇒ Boolean
Creates a pull request for the Rubocop Challenge
57 58 59 60 61 62 |
# File 'lib/rubocop_challenger/pull_request.rb', line 57 def create_rubocop_challenge_pr!(rule, template_file_path = nil) create_pull_request!( title: "#{rule.title}-#{}", body: Github::PrTemplate.new(rule, template_file_path).generate ) end |