Class: Jekyll::GitHubMetadata::MetadataDrop
- Inherits:
-
Drops::Drop
- Object
- Drops::Drop
- Jekyll::GitHubMetadata::MetadataDrop
- Extended by:
- Forwardable
- Defined in:
- lib/jekyll-github-metadata/metadata_drop.rb
Instance Method Summary collapse
- #build_revision ⇒ Object
- #content_methods ⇒ Object
- #key?(key) ⇒ Boolean
- #keys ⇒ Object
- #to_s ⇒ Object (also: #to_str)
- #versions ⇒ Object
Instance Method Details
#build_revision ⇒ Object
89 90 91 92 93 |
# 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 ⇒ Object
28 29 30 |
# File 'lib/jekyll-github-metadata/metadata_drop.rb', line 28 def content_methods super - %w(to_s to_str) end |
#key?(key) ⇒ Boolean
15 16 17 18 19 20 |
# 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 ⇒ Object
32 33 34 |
# File 'lib/jekyll-github-metadata/metadata_drop.rb', line 32 def keys super.sort end |
#to_s ⇒ Object Also known as: to_str
22 23 24 25 |
# File 'lib/jekyll-github-metadata/metadata_drop.rb', line 22 def to_s require "json" JSON.pretty_generate to_h end |
#versions ⇒ Object
78 79 80 81 82 83 84 85 86 87 |
# 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 |