module Builderator::Control::Version::SCM
Generic SCM
interface
Public Class Methods
history()
click to toggle source
# File lib/builderator/control/version/scm.rb, line 48 def history provider.history end
provider()
click to toggle source
Find a version provider for this build
# File lib/builderator/control/version/scm.rb, line 74 def provider providers.find(&:supported?).tap do |found| fail 'Builderator::Control::Version: '\ 'Unsupported SCM' if found.nil? end end
providers()
click to toggle source
# File lib/builderator/control/version/scm.rb, line 69 def providers @providers ||= [] end
register(klass)
click to toggle source
# File lib/builderator/control/version/scm.rb, line 56 def register(klass) fail 'Provider module must extend '\ 'Builderator::Control::Version::SCM' unless klass.singleton_class.include?(SCM) ## Make newer providers override those with the same capability providers.unshift(klass) end
unregister(klass)
click to toggle source
# File lib/builderator/control/version/scm.rb, line 65 def unregister(klass) providers.delete(klass) end
Public Instance Methods
_history()
click to toggle source
history()
click to toggle source
Fetch and cache history for the current HEAD/TIP
# File lib/builderator/control/version/scm.rb, line 9 def history @history ||= _history.map { |commit| Commit.new(commit) } end
supported?()
click to toggle source
OVERRIDE: Return true if this provider will work for `path`
# File lib/builderator/control/version/scm.rb, line 24 def supported? fail 'Method `supported?` must be implemented in SCM providers!' end