Class: CIQuantum::Commit
- Inherits:
-
Struct
- Object
- Struct
- CIQuantum::Commit
- Defined in:
- lib/ciquantum/commit.rb
Instance Attribute Summary collapse
-
#project_path ⇒ Object
Returns the value of attribute project_path.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #author ⇒ Object
- #committed_at ⇒ Object
- #get_url!(adapter) ⇒ Object
- #message ⇒ Object
- #raw_commit ⇒ Object
- #raw_commit_lines ⇒ Object
Instance Attribute Details
#project_path ⇒ Object
Returns the value of attribute project_path
2 3 4 |
# File 'lib/ciquantum/commit.rb', line 2 def project_path @project_path end |
#sha ⇒ Object
Returns the value of attribute sha
2 3 4 |
# File 'lib/ciquantum/commit.rb', line 2 def sha @sha end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/ciquantum/commit.rb', line 4 def url @url end |
Instance Method Details
#author ⇒ Object
10 11 12 |
# File 'lib/ciquantum/commit.rb', line 10 def raw_commit_lines.grep(/Author:/).first.split(':', 2)[-1] end |
#committed_at ⇒ Object
14 15 16 |
# File 'lib/ciquantum/commit.rb', line 14 def committed_at raw_commit_lines.grep(/Date:/).first.split(':', 2)[-1] end |
#get_url!(adapter) ⇒ Object
6 7 8 |
# File 'lib/ciquantum/commit.rb', line 6 def get_url! adapter @url = adapter.commit_url self end |
#message ⇒ Object
18 19 20 |
# File 'lib/ciquantum/commit.rb', line 18 def raw_commit.split("\n\n", 3)[1].to_s.strip end |
#raw_commit ⇒ Object
22 23 24 |
# File 'lib/ciquantum/commit.rb', line 22 def raw_commit @raw_commit ||= `cd #{project_path} && git show #{sha}`.chomp end |
#raw_commit_lines ⇒ Object
26 27 28 |
# File 'lib/ciquantum/commit.rb', line 26 def raw_commit_lines @raw_commit_lines ||= raw_commit.split("\n") end |