Class: HtmlMockup::Release::Scm::Git
- Defined in:
- lib/html_mockup/release/scm/git.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#date ⇒ Object
Date will be Time.now if it can’t be determined from GIT repository.
-
#initialize(config = {}) ⇒ Git
constructor
A new instance of Git.
- #previous ⇒ Object
-
#version ⇒ Object
Version is either: - the tagged version number (first “v” will be stripped) or - the return value of “git describe –tags HEAD” - the short SHA1 if there hasn’t been a previous tag.
Constructor Details
#initialize(config = {}) ⇒ Git
Returns a new instance of Git.
8 9 10 11 |
# File 'lib/html_mockup/release/scm/git.rb', line 8 def initialize(config={}) super(config) @config[:ref] ||= "HEAD" end |
Instance Method Details
#date ⇒ Object
Date will be Time.now if it can’t be determined from GIT repository
23 24 25 26 |
# File 'lib/html_mockup/release/scm/git.rb', line 23 def date get_scm_data if @_date.nil? @_date end |
#previous ⇒ Object
28 29 30 |
# File 'lib/html_mockup/release/scm/git.rb', line 28 def previous self.class.new(@config.dup.update(:ref => get_previous_tag_name)) end |
#version ⇒ Object
Version is either:
-
the tagged version number (first “v” will be stripped) or
-
the return value of “git describe –tags HEAD”
-
the short SHA1 if there hasn’t been a previous tag
17 18 19 20 |
# File 'lib/html_mockup/release/scm/git.rb', line 17 def version get_scm_data if @_version.nil? @_version end |