lib/method_log/repository.rb in method_log-0.1.1 vs lib/method_log/repository.rb in method_log-0.2.0

- old
+ new

@@ -23,16 +23,17 @@ @commits << commit end end def commits(options = {}) + options[:sorting] ||= Rugged::SORT_TOPO Enumerator.new do |yielder| if @repository.ref('refs/heads/master') - @repository.walk(@repository.last_commit).with_index do |commit, index| + @repository.walk(@repository.last_commit, options[:sorting]).with_index do |commit, index| break if options[:max_count] && index >= options[:max_count] - 1 yielder << build_commit(commit.oid) end end end end end -end \ No newline at end of file +end