diff --git a/Gemfile b/Gemfile index d924a13..d07ccb8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,7 @@ # A sample Gemfile source "https://rubygems.org" +# gem "pry" + # Specify your gem's dependencies in timecost.gemspec gemspec diff --git a/lib/timecost/cli.rb b/lib/timecost/cli.rb index c2e96c3..3830fe1 100644 --- a/lib/timecost/cli.rb +++ b/lib/timecost/cli.rb @@ -174,12 +174,18 @@ module TimeCost def analyze_dumps #read ranges - @rangelist = RangeList.new @config[:input_dump].each do |filename| - rangelist = YAML::load(File.open(filename,"r")) - rangelist.each do |range| - @rangelist.add range + filelists = YAML::load(File.open(filename,"r")) + # require 'pry' + # binding.pry + filelists.each do |author, rangelist| + # create list if author is new + @rangelist[author] ||= RangeList.new + + rangelist.each do |range| + @rangelist[author].add range + end end end end