class Gitomator::Task::EnableDisableCI

Abstract parent class

Public Class Methods

new(context, repos, opts={}) click to toggle source

@param context - Has a `ci` method that returns a Gitomator::Service::CI @param repos [Array<String>] - Names of the repos to enable/disable CI on. @param opts [Hash<Symbol,Object>] - Task options @option opts [Boolean] :sync - Indicate whether we should start by sync'ing the CI service.

Calls superclass method Gitomator::Task::BaseReposTask::new
# File lib/gitomator/task/enable_disable_ci.rb, line 17
def initialize(context, repos, opts={})
  super(context, repos)

  if opts[:sync]
    before_processing_any_repos do
      logger.info "Syncing CI service (this may take a little while) ..."
      ci.sync()
      while ci.syncing?
        print "."
        sleep 1
      end
      puts ""
      logger.info "CI service synchronized"
    end
  end
end