Sha256: cdb46bd6440909ff36df48df8db55432ab240c568045cc5d98d3ba98b71021cc

Contents?: true

Size: 775 Bytes

Versions: 9

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

require_relative '../helpers/os_helper'
require_relative '../helpers/services_workflow_helper'

module Geet
  module Services
    # Add a comment to the PR for the current branch.
    #
    class CommentPr
      include Geet::Helpers::OsHelper
      include Geet::Helpers::ServicesWorkflowHelper

      DEFAULT_GIT_CLIENT = Geet::Utils::GitClient.new

      def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT)
        @repository = repository
        @out = out
        @git_client = git_client
      end

      def execute(comment, no_open_pr: nil)
        pr = checked_find_branch_pr
        pr.comment(comment)
        open_file_with_default_application(pr.link) unless no_open_pr
        pr
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
geet-0.10.0 lib/geet/services/comment_pr.rb
geet-0.9.0 lib/geet/services/comment_pr.rb
geet-0.8.0 lib/geet/services/comment_pr.rb
geet-0.7.0 lib/geet/services/comment_pr.rb
geet-0.6.0 lib/geet/services/comment_pr.rb
geet-0.5.0 lib/geet/services/comment_pr.rb
geet-0.4.4 lib/geet/services/comment_pr.rb
geet-0.4.3 lib/geet/services/comment_pr.rb
geet-0.4.2 lib/geet/services/comment_pr.rb