lib/todidnt.rb in todidnt-0.3.1 vs lib/todidnt.rb in todidnt-0.4.1

- old
+ new

@@ -3,10 +3,12 @@ require 'todidnt/git_command' require 'todidnt/todo_line' require 'todidnt/git_history' require 'todidnt/html_generator' +require 'todidnt/version' + require 'chronic' require 'launchy' module Todidnt class CLI @@ -21,13 +23,13 @@ $stderr.puts("Sorry, `#{command}` is not a valid command.") exit end end - def self.generate(options) - GitRepo.new(options[:path]).run do |path| - history = GitHistory.new + def self.generate(opts) + GitRepo.new(opts[:path]).run do |path| + history = GitHistory.new(opts) buckets, authors = history.timeline! lines = TodoLine.all(["TODO"]) lines.each do |todo| blames = history.blames[todo.raw_content] @@ -45,10 +47,10 @@ file_path = HTMLGenerator.generate(:history, :data => {:history => buckets.map {|h| h[:authors].merge('Date' => h[:timestamp]) }, :authors => authors.to_a}) Launchy.open("file://#{file_path}") end end - def self.clear(options) + def self.clear(opts) puts "Deleting cache..." Cache.clear! puts "Done!" end end