Sha256: 2f84174cc651851fc48597d44a71cc6df2f404763e6dfe3030c50ff5100020d8

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

module Octokit
  class Client

    # Methods for the Gitignore API
    #
    # @see http://developer.github.com/v3/gitignore/
    module Gitignore

      # Listing available gitignore templates.
      #
      # These templates can be passed option when creating a repository.
      #
      # @see http://developer.github.com/v3/gitignore/#listing-available-templates
      # @see http://developer.github.com/v3/repos/#create
      #
      # @return [Array<String>] List of templates.
      #
      # @example Git all the gitignore templates
      #   @client.gitignore_templates
      def gitignore_templates(options={})
        get "gitignore/templates", options
      end

      # Get a gitignore template.
      #
      # Use the raw {http://developer.github.com/v3/media/ media type} to get
      # the raw contents.
      #
      # @param template_name [String] Name of the template. Template names are
      #   case sensitive, make sure to use a valid name from the 
      #   .gitignore_templates list.
      #
      # @see http://developer.github.com/v3/gitignore/#get-a-single-template
      #
      # @return [Sawyer::Resource] Gitignore template
      #
      # @example Get the Ruby gitignore template
      #   @client.gitignore_template('Ruby')
      def gitignore_template(template_name, options={})
        get "gitignore/templates/#{template_name}", options
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octokit-2.0.0.pre lib/octokit/client/gitignore.rb