Sha256: eec58f2ea163d5936aca81d3a14fc191467eeb8ccefad8dc71061bce93d71d91

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 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

7 entries across 7 versions & 1 rubygems

Version Path
octokit-2.1.1 lib/octokit/client/gitignore.rb
octokit-2.1.0 lib/octokit/client/gitignore.rb
octokit-2.0.0 lib/octokit/client/gitignore.rb
octokit-2.0.0.rc4 lib/octokit/client/gitignore.rb
octokit-2.0.0.rc3 lib/octokit/client/gitignore.rb
octokit-2.0.0.rc2 lib/octokit/client/gitignore.rb
octokit-2.0.0.rc1 lib/octokit/client/gitignore.rb