Class: MSPRelease::Git::Commit
- Inherits:
-
Object
- Object
- MSPRelease::Git::Commit
- Includes:
- Exec::Helpers
- Defined in:
- lib/msp_release/git.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(project, attributes) ⇒ Commit
constructor
A new instance of Commit.
- #release_commit? ⇒ Boolean
- #release_name ⇒ Object
- #tag ⇒ Object
Methods included from Exec::Helpers
Constructor Details
#initialize(project, attributes) ⇒ Commit
Returns a new instance of Commit.
50 51 52 53 54 55 |
# File 'lib/msp_release/git.rb', line 50 def initialize(project, attributes) @project = project attributes.each do |k, v| instance_variable_set(:"@#{k}", v) end end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
47 48 49 |
# File 'lib/msp_release/git.rb', line 47 def @author end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
48 49 50 |
# File 'lib/msp_release/git.rb', line 48 def hash @hash end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
46 47 48 |
# File 'lib/msp_release/git.rb', line 46 def @message end |
Instance Method Details
#release_commit? ⇒ Boolean
57 58 59 |
# File 'lib/msp_release/git.rb', line 57 def release_commit? !! (release_name || tag) end |
#release_name ⇒ Object
66 67 68 |
# File 'lib/msp_release/git.rb', line 66 def release_name @project.() || tag end |
#tag ⇒ Object
61 62 63 64 |
# File 'lib/msp_release/git.rb', line 61 def tag tag = exec "git tag --contains #{hash}" (m = /^release-([0-9.]*)$/.match(tag)) && m[1] end |