Sha256: 00f82914924395191d3d1f1270fb17ccf80618f21bafff14f5fac4340ecc847a

Contents?: true

Size: 810 Bytes

Versions: 386

Compression:

Stored size: 810 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Sync < ApiCommand
      description "triggers a new sync with GitHub"

      on '-c', '--check',      'only check the sync status'
      on '-b', '--background', 'will trigger sync but not block until sync is done'
      on '-f', '--force',      'will force sync, even if one is already running'

      def run
        authenticate

        if check?
          say "#{"not " unless user.syncing?}syncing", "#{user.login} is currently %s"
        elsif user.syncing? and not force?
          error "user is already syncing"
        elsif background?
          say "starting synchronization"
          sync(false)
        else
          say "synchronizing: "
          sync
          say color(" done", :success)
        end
      end
    end
  end
end

Version data entries

386 entries across 386 versions & 3 rubygems

Version Path
travis-1.8.11.travis.1010.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1009.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1008.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1007.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1004.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1003.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1002.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1001.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.1000.9 lib/travis/cli/sync.rb
travis-1.8.11.travis.998.9 lib/travis/cli/sync.rb
travis-1.8.10.travis.997.9 lib/travis/cli/sync.rb
travis-1.8.10 lib/travis/cli/sync.rb
travis-1.8.10.travis.994.9 lib/travis/cli/sync.rb
travis-1.8.10.travis.953.11 lib/travis/cli/sync.rb
travis-akerl-1.8.9.1 lib/travis/cli/sync.rb
travis-akerl-1.8.9 lib/travis/cli/sync.rb
travis-1.8.10.travis.950.11 lib/travis/cli/sync.rb
travis-1.8.10.travis.948.11 lib/travis/cli/sync.rb
travis-1.8.10.travis.946.11 lib/travis/cli/sync.rb
travis-1.8.10.travis.944.11 lib/travis/cli/sync.rb