Class: Hotspots::Repository::GitParser
- Inherits:
-
Object
- Object
- Hotspots::Repository::GitParser
- Defined in:
- lib/hotspots/repository/git_parser.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
- #filtered_commit_hashes ⇒ Object
-
#initialize(driver, options) ⇒ GitParser
constructor
A new instance of GitParser.
Constructor Details
#initialize(driver, options) ⇒ GitParser
Returns a new instance of GitParser.
6 7 8 9 10 |
# File 'lib/hotspots/repository/git_parser.rb', line 6 def initialize(driver, ) @driver = driver @time = [:time] @message_filters = [:message_filters] end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
4 5 6 |
# File 'lib/hotspots/repository/git_parser.rb', line 4 def driver @driver end |
#message_filters ⇒ Object (readonly)
Returns the value of attribute message_filters.
4 5 6 |
# File 'lib/hotspots/repository/git_parser.rb', line 4 def @message_filters end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/hotspots/repository/git_parser.rb', line 4 def time @time end |
Instance Method Details
#files ⇒ Object
12 13 14 15 16 |
# File 'lib/hotspots/repository/git_parser.rb', line 12 def files filtered_commit_hashes.reduce([]) do |acc, commit_hash| acc + driver.show_one_line_names({:commit_hash => commit_hash}).lines.map(&:strip)[1..-1] end end |
#filtered_commit_hashes ⇒ Object
18 19 20 21 22 |
# File 'lib/hotspots/repository/git_parser.rb', line 18 def filtered_commit_hashes .reduce([]) do |acc, filter| acc + driver.pretty_log({:since_days => time, :message_filter => filter}).lines.map(&:strip) end.uniq end |