class GemHadar
def version_diff_task
- A :diff task that calculates the version range, displays a colored diff
and outputs the sorted list of versions.
- A :list task that fetches all git tags, ensures the operation succeeds,
This method sets up two subtasks under the :version namespace:
git version differences.
The version_diff_task method defines Rake tasks for listing and displaying
def version_diff_task namespace :version do desc "List all versions in order" task :list do system 'git fetch --tags' $?.success? or exit $?.exitstatus puts versions end desc "Displaying the diff from env var VERSION to the next version or HEAD" task :diff do start_version, end_version = determine_version_range puts color(172) { "Showing diff from version %s to %s:" % [ start_version, end_version ] } puts `git diff --color=always #{start_version}..#{end_version}` end end end