Sha256: 1cfd492ac0132adb6f3f90ae7d2879b73d7bbe7ddd94814b8a2ea8ba705e67d1
Contents?: true
Size: 883 Bytes
Versions: 12
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true module Groundskeeper # Wraps an interface to GitHub. class GitHub attr_reader :opener, :username, :repository_name COMMAND = "open" URL_BASE = "https://github.com/" # Wraps the "open" shell command. class Executable def execute(arguments) `#{COMMAND} #{arguments}` end end def self.build(username:, repository_name:) new( opener: Executable.new, username: username, repository_name: repository_name ) end def initialize(opener:, username:, repository_name:) @opener = opener @username = username @repository_name = repository_name end def open_pull_request_page(branch_name) url = "#{URL_BASE}#{username}/#{repository_name}/compare/" \ "#{branch_name}?expand=1" opener.execute(url) end end end
Version data entries
12 entries across 12 versions & 1 rubygems