Sha256: 2227dffeb3b41e643cdc675a9f583d2f1af9288abc4a1a71852d148a5434163e

Contents?: true

Size: 1.37 KB

Versions: 11

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

11 entries across 11 versions & 1 rubygems

Version Path
octokit-2.6.3 lib/octokit/client/gitignore.rb
octokit-2.6.2 lib/octokit/client/gitignore.rb
octokit-2.6.1 lib/octokit/client/gitignore.rb
octokit-2.6.0 lib/octokit/client/gitignore.rb
octokit-2.5.1 lib/octokit/client/gitignore.rb
octokit-2.5.0 lib/octokit/client/gitignore.rb
octokit-2.4.0 lib/octokit/client/gitignore.rb
octokit-2.3.1 lib/octokit/client/gitignore.rb
octokit-2.3.0 lib/octokit/client/gitignore.rb
octokit-2.2.0 lib/octokit/client/gitignore.rb
octokit-2.1.2 lib/octokit/client/gitignore.rb