Sha256: 77e5848744537e02278224a6de925902a9ad9accc1606f0abaf0ca15dcefc3df

Contents?: true

Size: 814 Bytes

Versions: 15

Compression:

Stored size: 814 Bytes

Contents

# encoding: utf-8
require 'travis/cli'

module Travis
  module CLI
    class Pubkey < RepoCommand
      attr_accessor :key_format
      description "prints out a repository's public key"
      on('-p', '--pem', 'encode in format used by pem') { |c,_| c.key_format = :pem }
      on('-f', '--fingerprint', 'display fingerprint')  { |c,_| c.key_format = :fingerprint }

      def run
        say key, "Public key for #{color(repository.slug, :info)}:\n\n%s", :bold
      end

      private

        def key
          key = repository.public_key
          case self.key_format ||= :ssh
          when :fingerprint then key.fingerprint
          when :pem         then key.to_s
          when :ssh         then key.to_ssh
          else raise "unknown format #{key_format}"
          end
        end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
travis-1.7.2.travis.633.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.632.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.630.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.627.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.626.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.625.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.623.5 lib/travis/cli/pubkey.rb
travis-1.7.2.travis.621.5 lib/travis/cli/pubkey.rb
travis-1.7.1 lib/travis/cli/pubkey.rb
travis-1.7.1.travis.613.5 lib/travis/cli/pubkey.rb
travis-1.7.0 lib/travis/cli/pubkey.rb
travis-1.6.18.travis.612.5 lib/travis/cli/pubkey.rb
travis-1.6.18.travis.611.5 lib/travis/cli/pubkey.rb
travis-1.6.18.travis.610.5 lib/travis/cli/pubkey.rb
travis-1.6.18.travis.609.5 lib/travis/cli/pubkey.rb