module LogCabin::Modules::GithubHash
Pull state from the latest GitHub commit
Public Instance Methods
load!()
click to toggle source
# File lib/prospectus/modules/github_hash.rb, line 8 def load! raise('No repo specified') unless @repo @branch ||= 'master' @state.value = @long ? hash : hash.slice(0, 7) end
Private Instance Methods
branch(value)
click to toggle source
# File lib/prospectus/modules/github_hash.rb, line 20 def branch(value) @branch = value end
hash()
click to toggle source
# File lib/prospectus/modules/github_hash.rb, line 16 def hash @hash ||= github_api.branch(@repo, @branch).commit.sha end
long()
click to toggle source
# File lib/prospectus/modules/github_hash.rb, line 24 def long @long = true end