Sha256: 20120481f0238c18e6f54cd6782ab8781b68a77f7c1f14199ea3064c3c24c313

Contents?: true

Size: 757 Bytes

Versions: 19

Compression:

Stored size: 757 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Sync < ApiCommand
      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

19 entries across 19 versions & 1 rubygems

Version Path
travis-1.5.2 lib/travis/cli/sync.rb
travis-1.5.1 lib/travis/cli/sync.rb
travis-1.5.0 lib/travis/cli/sync.rb
travis-1.4.0 lib/travis/cli/sync.rb
travis-1.3.1 lib/travis/cli/sync.rb
travis-1.3.0 lib/travis/cli/sync.rb
travis-1.2.8 lib/travis/cli/sync.rb
travis-1.2.7 lib/travis/cli/sync.rb
travis-1.2.6 lib/travis/cli/sync.rb
travis-1.2.5 lib/travis/cli/sync.rb
travis-1.2.4 lib/travis/cli/sync.rb
travis-1.2.3 lib/travis/cli/sync.rb
travis-1.2.2 lib/travis/cli/sync.rb
travis-1.2.1 lib/travis/cli/sync.rb
travis-1.2.0 lib/travis/cli/sync.rb
travis-1.1.3 lib/travis/cli/sync.rb
travis-1.1.2 lib/travis/cli/sync.rb
travis-1.1.1 lib/travis/cli/sync.rb
travis-1.1.0 lib/travis/cli/sync.rb