Class: HgBlameGame
- Inherits:
-
Object
- Object
- HgBlameGame
- Defined in:
- lib/hg-blame-game/hg_blame_game.rb
Instance Method Summary collapse
-
#initialize(path_to_file, opts = {}) ⇒ HgBlameGame
constructor
A new instance of HgBlameGame.
- #run ⇒ Object
Constructor Details
#initialize(path_to_file, opts = {}) ⇒ HgBlameGame
Returns a new instance of HgBlameGame.
2 3 4 5 |
# File 'lib/hg-blame-game/hg_blame_game.rb', line 2 def initialize(path_to_file, opts={}) @path_to_file = path_to_file @changeset_id = !opts[:changeset_id].nil? ? opts[:changeset_id] : 'tip' end |
Instance Method Details
#run ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hg-blame-game/hg_blame_game.rb', line 7 def run loop do p_flush("\n") changeset_id_to_show = show_hg_blame_and_prompt_for_changeset_id p_flush("\n") files_changed = sys("hg status --change #{changeset_id_to_show}").split("\n").map { |g| g.split(' ').last } @path_to_file = prompt_for_file(files_changed, changeset_id_to_show) @changeset_id = "#{changeset_id_to_show}^" end end |