travis 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 818e03546d337ed230e406b1a939209b072a82f9
4
- data.tar.gz: 32cb32ab8f1daeebeb9bb08206fbbc3ec654622d
3
+ metadata.gz: bf0bedc3ebeb0308526c8df70e1961f840b499a3
4
+ data.tar.gz: 42789765d91dc5975f884cc8f34468be355bf020
5
5
  SHA512:
6
- metadata.gz: f8130d7c469792cbceee1e74b89c6e38ad711b01373602d93685714f938c9049cea784861977809b15aede3f2b0224f5887f448780cbd6ac7c0ad2a02792e66a
7
- data.tar.gz: 6ca11f1d309263bf1caabeaebabc987a1861b5018f27d48758c028419ada2d20cb29c687196be4698936518456f66e3abbe1f259eb8a2a95df41202a2009d167
6
+ metadata.gz: 6e57f58c84db9bbe82efac4f7f35a4111730ac1fdb1c9ae9546c3d43f98353507bef69564382e126d71dfe10885428757af12a02be6dfbe6be66fc64308bb03e
7
+ data.tar.gz: 45aa4e29b71736c48bccb28e63d59609b75a0106749e8c53362108fd1e014a2b19041ac29d0179ca79fc1181bd5bfc837d97998e55e6f1663cce465059644df4
data/README.md CHANGED
@@ -424,11 +424,17 @@ Outputs the public key for a repository.
424
424
  $ travis pubkey
425
425
  Public key for travis-ci/travis:
426
426
 
427
+ ssh-rsa ...
428
+ $ travis pubkey -r rails/rails > rails.key
429
+
430
+ The `--pem` flag will print out the key PEM encoded:
431
+
432
+ $ travis pubkey --pem
433
+ Public key for travis-ci/travis:
434
+
427
435
  -----BEGIN PUBLIC KEY-----
428
436
  ...
429
437
  -----END PUBLIC KEY-----
430
-
431
- $ travis pubkey -r rails/rails > rails.key
432
438
 
433
439
  #### `restart`
434
440
 
@@ -902,6 +908,12 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
902
908
 
903
909
  ## Version History
904
910
 
911
+ **1.2.8** (July 19, 2013)
912
+
913
+ * Make pubkey print out key in ssh encoding, add --pem flag for old format
914
+ * Fix more encoding issues
915
+ * Fix edge cases that broke history view
916
+
905
917
  **1.2.7** (July 15, 2013)
906
918
 
907
919
  * Add pubkey command
data/bin/travis CHANGED
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
+
4
+ # :(
5
+ Encoding.default_external = Encoding::UTF_8 if defined? Encoding
6
+
3
7
  require 'travis/cli'
4
8
  Travis::CLI.run(ARGV)
@@ -147,6 +147,8 @@ module Travis
147
147
  style ||= :important
148
148
  data = format % color(data, style) if format and interactive?
149
149
  data = data.gsub(/<\[\[/, '<%=').gsub(/\]\]>/, '%>')
150
+ data.encode! 'utf-8' if data.respond_to? :encode!
151
+ data
150
152
  end
151
153
 
152
154
  def template(*args)
@@ -36,7 +36,7 @@ module Travis
36
36
  color("##{build.number} #{build.state}:".ljust(16), [build.color, :bold]),
37
37
  color("#{build.branch_info} ", :info),
38
38
  build.commit.subject
39
- ].join.strip
39
+ ].join.strip + "\n"
40
40
  end
41
41
  end
42
42
  end
@@ -4,6 +4,8 @@ require 'travis/cli'
4
4
  module Travis
5
5
  module CLI
6
6
  class Pubkey < RepoCommand
7
+ on('-p', '--[no-]pem', 'encode in format used by pem')
8
+
7
9
  def run
8
10
  say key, "Public key for #{color(repository.slug, :info)}:\n\n%s", :bold
9
11
  end
@@ -11,7 +13,8 @@ module Travis
11
13
  private
12
14
 
13
15
  def key
14
- repository.public_key.to_rsa.to_s
16
+ key = repository.public_key
17
+ pem? ? key.to_s : key.to_ssh
15
18
  end
16
19
  end
17
20
  end
@@ -17,6 +17,10 @@ module Travis
17
17
  Base64.encode64(encrypted).gsub(/\s+/, "")
18
18
  end
19
19
 
20
+ def to_ssh
21
+ ['ssh-rsa ', "\0\0\0\assh-rsa#{sized_bytes(to_rsa.e)}#{sized_bytes(to_rsa.n)}"].pack('a*m').gsub("\n", '')
22
+ end
23
+
20
24
  def to_rsa
21
25
  @to_rsa ||= OpenSSL::PKey::RSA.new(to_s)
22
26
  rescue OpenSSL::PKey::RSAError
@@ -27,6 +31,18 @@ module Travis
27
31
  def ==(other)
28
32
  other.to_s == self
29
33
  end
34
+
35
+ private
36
+
37
+ def sized_bytes(value)
38
+ bytes = to_byte_array(value.to_i)
39
+ [bytes.size, *bytes].pack('NC*')
40
+ end
41
+
42
+ def to_byte_array(num, *significant)
43
+ return significant if num.between?(-1, 0) and significant[0][7] == num[7]
44
+ to_byte_array(*num.divmod(256)) + significant
45
+ end
30
46
  end
31
47
 
32
48
  include States
@@ -1,3 +1,3 @@
1
1
  module Travis
2
- VERSION = '1.2.7'
2
+ VERSION = '1.2.8'
3
3
  end
data/travis.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  # general infos
4
4
  s.name = "travis"
5
- s.version = "1.2.7"
5
+ s.version = "1.2.8"
6
6
  s.description = "CLI and Ruby client library for Travis CI"
7
7
  s.homepage = "https://github.com/travis-ci/travis"
8
8
  s.summary = "Travis CI client"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2013-07-15 00:00:00.000000000 Z
19
+ date: 2013-07-19 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: faraday