Class: Hotspots::Repository::Parser::Git
- Inherits:
-
Object
- Object
- Hotspots::Repository::Parser::Git
- Defined in:
- lib/hotspots/repository/parser/git.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#message_filters ⇒ Object
readonly
Returns the value of attribute message_filters.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#files ⇒ Object
TODO : replace with each_line.
-
#filtered_commit_hashes ⇒ Object
TODO : replace with each_line.
-
#initialize(driver, options) ⇒ Git
constructor
A new instance of Git.
Constructor Details
#initialize(driver, options) ⇒ Git
Returns a new instance of Git.
7 8 9 10 11 |
# File 'lib/hotspots/repository/parser/git.rb', line 7 def initialize(driver, ) @driver = driver @time = [:time] @message_filters = [:message_filters] end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
5 6 7 |
# File 'lib/hotspots/repository/parser/git.rb', line 5 def driver @driver end |
#message_filters ⇒ Object (readonly)
Returns the value of attribute message_filters.
5 6 7 |
# File 'lib/hotspots/repository/parser/git.rb', line 5 def @message_filters end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/hotspots/repository/parser/git.rb', line 5 def time @time end |
Instance Method Details
#files ⇒ Object
TODO : replace with each_line
14 15 16 17 18 19 20 21 |
# File 'lib/hotspots/repository/parser/git.rb', line 14 def files filtered_commit_hashes.map do |commit_hash| driver.show_one_line_names(:commit_hash => commit_hash). gsub("\r\n", "\n"). gsub("\r", "\n"). split("\n")[1..-1] end.flatten end |
#filtered_commit_hashes ⇒ Object
TODO : replace with each_line
24 25 26 27 28 29 30 31 |
# File 'lib/hotspots/repository/parser/git.rb', line 24 def filtered_commit_hashes .map do |filter| driver.pretty_log(:since_days => time, :message_filter => filter). gsub("\r\n", "\n"). gsub("\r", "\n"). split("\n") end.flatten.uniq end |