Sha256: b44e100b2a125195449b999e2f10164d65cb1c918ee560247271744f89db1666

Contents?: true

Size: 1.35 KB

Versions: 24

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

module Octokit
  class Client
    # Methods for the Gitignore API
    #
    # @see https://developer.github.com/v3/gitignore/
    module Gitignore
      # Listing available gitignore templates.
      #
      # These templates can be passed option when creating a repository.
      #
      # @see https://developer.github.com/v3/gitignore/#listing-available-templates
      #
      # @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 https://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

24 entries across 24 versions & 2 rubygems

Version Path
octokit-9.2.0 lib/octokit/client/gitignore.rb
octokit-9.1.0 lib/octokit/client/gitignore.rb
octokit-9.0.0 lib/octokit/client/gitignore.rb
octokit-8.1.0 lib/octokit/client/gitignore.rb
octokit-8.0.0 lib/octokit/client/gitignore.rb
octokit-7.2.0 lib/octokit/client/gitignore.rb
octokit-7.1.0 lib/octokit/client/gitignore.rb
octokit-7.0.0 lib/octokit/client/gitignore.rb
octokit-6.1.1 lib/octokit/client/gitignore.rb
octokit-6.1.0 lib/octokit/client/gitignore.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/octokit-4.25.1/lib/octokit/client/gitignore.rb
octokit-6.0.1 lib/octokit/client/gitignore.rb
octokit-6.0.0 lib/octokit/client/gitignore.rb
octokit-5.6.1 lib/octokit/client/gitignore.rb
octokit-5.6.0 lib/octokit/client/gitignore.rb
octokit-5.5.0 lib/octokit/client/gitignore.rb
octokit-5.4.0 lib/octokit/client/gitignore.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/octokit-5.3.0/lib/octokit/client/gitignore.rb
octokit-5.3.0 lib/octokit/client/gitignore.rb
octokit-5.2.0 lib/octokit/client/gitignore.rb