Sha256: e007942f246da0235f6e0a5775516643e20dd5c70d05f268882efc46c8b54ece

Contents?: true

Size: 1.38 KB

Versions: 16

Compression:

Stored size: 1.38 KB

Contents

# encoding: utf-8

module Github
  # The Repo Merging API supports merging branches in a repository. This
  # accomplishes essentially the same thing as merging one branch into another
  # in a local repository and then pushing to GitHub.
  class Client::Repos::Merging < API

    VALID_MERGE_PARAM_NAMES = %w[
      base
      head
      commit_message
    ].freeze # :nodoc:

    REQUIRED_MERGE_PARAMS = %w[ base head ].freeze # :nodoc:

    # Perform a merge
    #
    # @param [Hash] params
    # @input params [String] :base
    #   Required. The name of the base branch that the head will be merged into.
    # @input params [String] :head
    #   Required. The head to merge. This can be a branch name or a commit SHA1.
    # @input params [String] :commit_message
    #   Commit message to use for the merge commit.
    #   If omitted, a default message will be used.
    #
    # @example
    #   github = Github.new
    #   github.repos.merging.merge 'user', 'repo',
    #     base: "master",
    #     head: "cool_feature",
    #     commit_message: "Shipped cool_feature!"
    #
    # @api public
    def merge(*args)
      arguments(args, required: [:user, :repo]) do
        permit VALID_MERGE_PARAM_NAMES
        assert_required REQUIRED_MERGE_PARAMS
      end

      post_request("/repos/#{arguments.user}/#{arguments.repo}/merges", arguments.params)
    end
  end # Client::Repos::Merging
end # Github

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
github_api-0.17.0 lib/github_api/client/repos/merging.rb
github_api-0.16.0 lib/github_api/client/repos/merging.rb
github_api-0.15.0 lib/github_api/client/repos/merging.rb
github_api-0.14.5 lib/github_api/client/repos/merging.rb
github_api-0.14.4 lib/github_api/client/repos/merging.rb
github_api-0.14.3 lib/github_api/client/repos/merging.rb
github_api-0.14.2 lib/github_api/client/repos/merging.rb
github_api-0.14.1 lib/github_api/client/repos/merging.rb
github_api-0.14.0 lib/github_api/client/repos/merging.rb
github_api-0.13.1 lib/github_api/client/repos/merging.rb
github_api-0.13.0 lib/github_api/client/repos/merging.rb
github_api-0.12.4 lib/github_api/client/repos/merging.rb
github_api-0.12.3 lib/github_api/client/repos/merging.rb
github_api-0.12.2 lib/github_api/client/repos/merging.rb
github_api-0.12.1 lib/github_api/client/repos/merging.rb
github_api-0.12.0 lib/github_api/client/repos/merging.rb