class GemHadar
def master_push_task
The tasks utilize the git_remotes method to determine which remotes are
all remotes.
remote push tasks, enabling a single command to push the master branch to
- It also defines a top-level :master:push task that depends on all the individual
remote, allowing individual pushes to specific remotes.
- It creates subtasks in the :master:push namespace for each configured Git
This method sets up a hierarchical task structure under the :master namespace:
branch to configured Git remotes.
The master_push_task method defines Rake tasks for pushing the master
def master_push_task namespace :master do git_remotes.each do |gr| namespace gr.to_sym do desc "Push master to git remote #{gr}" task :push do sh "git push #{gr} master" end end end desc "Push master #{version} to all git remotes: #{git_remotes * ' '}" task :push => git_remotes.map { |gr| :"master:#{gr}:push" } end end