Class: POChange
- Includes:
- FromHash
- Defined in:
- lib/transparent_git/repo.rb
Instance Attribute Summary collapse
-
#commit_hash ⇒ Object
Returns the value of attribute commit_hash.
-
#curr ⇒ Object
Returns the value of attribute curr.
-
#name ⇒ Object
Returns the value of attribute name.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#time ⇒ Object
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#commit_hash ⇒ Object
Returns the value of attribute commit_hash.
16 17 18 |
# File 'lib/transparent_git/repo.rb', line 16 def commit_hash @commit_hash end |
#curr ⇒ Object
Returns the value of attribute curr.
16 17 18 |
# File 'lib/transparent_git/repo.rb', line 16 def curr @curr end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/transparent_git/repo.rb', line 16 def name @name end |
#prev ⇒ Object
Returns the value of attribute prev.
16 17 18 |
# File 'lib/transparent_git/repo.rb', line 16 def prev @prev end |
#time ⇒ Object
Returns the value of attribute time.
16 17 18 |
# File 'lib/transparent_git/repo.rb', line 16 def time @time end |
Class Method Details
.from_diff(commit, diff) ⇒ Object
23 24 25 26 |
# File 'lib/transparent_git/repo.rb', line 23 def self.from_diff(commit,diff) new(:curr => diff.b_blob.andand.data.andand.stripped_chars, :prev => diff.a_blob.andand.data.andand.stripped_chars, :name => diff.a_path, :time => commit.committed_date, :commit_hash => commit.id) end |
Instance Method Details
#to_json ⇒ Object
20 21 22 |
# File 'lib/transparent_git/repo.rb', line 20 def to_json {:curr => curr.andand.strip, :prev => prev.andand.strip, :file => name, :time => time, :commit_hash => commit_hash} end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/transparent_git/repo.rb', line 17 def to_s "#{name}: #{prev.andand.strip}|#{curr.andand.strip}" end |