class Jekyll::GitHubMetadata::MetadataDrop

Public Instance Methods

build_revision() click to toggle source
# File lib/jekyll-github-metadata/metadata_drop.rb, line 89
def build_revision
  @build_revision ||= begin
    ENV["JEKYLL_BUILD_REVISION"] || `git rev-parse HEAD`.strip
  end
end
content_methods() click to toggle source
Calls superclass method
# File lib/jekyll-github-metadata/metadata_drop.rb, line 28
def content_methods
  super - %w(to_s to_str)
end
key?(key) click to toggle source
# File lib/jekyll-github-metadata/metadata_drop.rb, line 15
def key?(key)
  return false if key.nil?
  return true if self.class.mutable? && mutations.key?(key)

  respond_to?(key) || fallback_data.key?(key)
end
keys() click to toggle source
Calls superclass method
# File lib/jekyll-github-metadata/metadata_drop.rb, line 32
def keys
  super.sort
end
to_s() click to toggle source
# File lib/jekyll-github-metadata/metadata_drop.rb, line 22
def to_s
  require "json"
  JSON.pretty_generate to_h
end
Also aliased as: to_str
to_str()
Alias for: to_s
versions() click to toggle source
# File lib/jekyll-github-metadata/metadata_drop.rb, line 78
def versions
  return @versions if defined?(@versions)

  begin
    require "github-pages"
    @versions = GitHubPages.versions
  rescue LoadError
    @versions = {}
  end
end

Private Instance Methods

fallback_data() click to toggle source

Nothing to see here.

# File lib/jekyll-github-metadata/metadata_drop.rb, line 98
def fallback_data
  @fallback_data ||= {}
end
mutations() click to toggle source
# File lib/jekyll-github-metadata/metadata_drop.rb, line 102
def mutations
  @mutations ||= {}
end