Sha256: 6ab30bd392564a6881afa3461a6b7f1d1ce8270f3cee0ecc9907b7d65669effa

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

# encoding: utf-8

module Github
  # The Pages API retrieves information about your GitHub Pages configuration,
  # and the statuses of your builds. Information about the site and the builds
  # can only be accessed by authenticated owners, even though the websites
  # are public.
  class Client::Repos::Pages < API

    # List Pages builds
    #
    # @example
    #  github = Github.new
    #  github.repos.pages.list owner: 'owner-name', repo: 'repo-name'
    #
    #  github = Github.new
    #  github.repos.pages.list :latest, owner: 'owner-name', repo: 'repo-name'
    # @api public
    def list(*args)
      arguments(args, required: [:owner, :repo])

      response = if args.map(&:to_s).include?('latest')
        get_request("/repos/#{arguments.owner}/#{arguments.repo}/pages/builds/latest", arguments.params)
      else
        get_request("/repos/#{arguments.owner}/#{arguments.repo}/pages/builds", arguments.params)
      end
      return response unless block_given?
      response.each { |el| yield el }
    end
    alias :all :list

    # Get information about a Pages site
    #
    # @example
    #  github = Github.new
    #  github.repos.pages.get owner: 'owner-name', repo: 'repo-name'
    #
    # @api public
    def get(*args)
      arguments(args, required: [:owner, :repo])

      get_request("/repos/#{arguments.owner}/#{arguments.repo}/pages", arguments.params)
    end
    alias :find :get
  end # Client::Repos::Pages
end # Github

Version data entries

16 entries across 16 versions & 1 rubygems

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