Module: DataKitten::Hosts::Github

Defined in:
lib/data_kitten/hosts/github.rb

Overview

GitHub host module. Automatically mixed into Dataset for datasets that are loaded from GitHub.

See Also:

Instance Method Summary collapse

Instance Method Details

#github_path(path = '') ⇒ String

Helper for generating GitHub URLs

Examples:

dataset = Dataset.new('git://github.com/theodi/dataset-metadata-survey.git')
dataset.github_path           # => 'https://github.com/theodi/dataset-metadata-survey/'
dataset.github_path('issues') # => 'https://github.com/theodi/dataset-metadata-survey/issues'

Parameters:

  • path (String) (defaults to: '')

    The path to append to the GitHub base URL.

Returns:

  • (String)

    The supplied path with the GitHub base URL prepended



36
37
38
# File 'lib/data_kitten/hosts/github.rb', line 36

def github_path(path = '')
  "https://github.com/#{github_user_name}/#{github_repository_name}/#{path}"
end

#hostSymbol

Where the dataset is hosted.

Returns:

  • (Symbol)

    :github

See Also:



22
23
24
# File 'lib/data_kitten/hosts/github.rb', line 22

def host
  :github
end