lib/doing/changelog/changes.rb in doing-2.1.28 vs lib/doing/changelog/changes.rb in doing-2.1.29

- old
+ new

@@ -23,9 +23,24 @@ else @changes[0].to_s.force_encoding('utf-8') end end + def versions + @changes.select { |change| change.entries&.count > 0 }.map { |change| change.version } + end + + def interactive + Doing::Prompt.choose_from(versions, + prompt: 'Select a version to see its changelog', + sorted: false, + fzf_args: [ + %(--preview='doing changes --render -l {1}'), + '--disabled', + '--preview-window="right,70%"' + ]) + end + def to_s if @changes_only @changes.map(&:changes_only).join().force_encoding('utf-8') else @changes.map(&:to_s).join("\n\n").force_encoding('utf-8')