Class: Hotspots::Repository::Command::Git::Log
- Inherits:
-
Object
- Object
- Hotspots::Repository::Command::Git::Log
- Defined in:
- lib/hotspots/repository/command/git.rb
Instance Attribute Summary collapse
-
#message_filter ⇒ Object
readonly
Returns the value of attribute message_filter.
-
#since_days ⇒ Object
readonly
Returns the value of attribute since_days.
Instance Method Summary collapse
- #build ⇒ Object
- #grep_clause ⇒ Object
-
#initialize(options) ⇒ Log
constructor
A new instance of Log.
- #since_clause ⇒ Object
Constructor Details
#initialize(options) ⇒ Log
Returns a new instance of Log.
8 9 10 11 |
# File 'lib/hotspots/repository/command/git.rb', line 8 def initialize() @since_days = [:since_days] @message_filter = [:message_filter].to_s end |
Instance Attribute Details
#message_filter ⇒ Object (readonly)
Returns the value of attribute message_filter.
6 7 8 |
# File 'lib/hotspots/repository/command/git.rb', line 6 def @message_filter end |
#since_days ⇒ Object (readonly)
Returns the value of attribute since_days.
6 7 8 |
# File 'lib/hotspots/repository/command/git.rb', line 6 def since_days @since_days end |
Instance Method Details
#build ⇒ Object
13 14 15 |
# File 'lib/hotspots/repository/command/git.rb', line 13 def build "git log --pretty=\"%H\" #{since_clause}#{grep_clause}" end |
#grep_clause ⇒ Object
21 22 23 |
# File 'lib/hotspots/repository/command/git.rb', line 21 def grep_clause .empty? ? "" : " --grep \"#{}\"" end |
#since_clause ⇒ Object
17 18 19 |
# File 'lib/hotspots/repository/command/git.rb', line 17 def since_clause "--since=\"#{since_days} days ago\"" end |