Class: GitWaybackMachine::History::Entry
- Inherits:
-
Struct
- Object
- Struct
- GitWaybackMachine::History::Entry
- Defined in:
- lib/git_wayback_machine/history.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment
10 11 12 |
# File 'lib/git_wayback_machine/history.rb', line 10 def comment @comment end |
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/git_wayback_machine/history.rb', line 10 def name @name end |
#sha ⇒ Object
Returns the value of attribute sha
10 11 12 |
# File 'lib/git_wayback_machine/history.rb', line 10 def sha @sha end |
#time ⇒ Object
Returns the value of attribute time
10 11 12 |
# File 'lib/git_wayback_machine/history.rb', line 10 def time @time end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/git_wayback_machine/history.rb', line 11 def to_s = "\e[33m#{sha}\e[37m | \e[35m#{name.ljust(17)} \e[36m(#{time})\e[37m - " size_so_far = .gsub(/\e\[\d+m/, "").size terminal_width = `tput cols`.to_i cut_comment = comment.slice(0, terminal_width - size_so_far - 3) cut_comment << "…" if comment.size > cut_comment.size "#{meta}#{cut_comment}\e[0m" end |