travis 1.2.2 → 1.2.3

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: cda21789737990f798f8234501d7973bdf75c90f
4
- data.tar.gz: 86ea0816fb1f70c7784c4f5628e111639e5bb72f
3
+ metadata.gz: 48deae66d8cddd6d3015269e3d04d9db0ac4470a
4
+ data.tar.gz: c76f9311f82f3c3c40ec64e2521f22ec8f319615
5
5
  SHA512:
6
- metadata.gz: 24524107e5fe9b919e8a40dfb1734780fe06abcefc9342493e56fc300d00a103f1c6fa9b802b22a20597fc8ac09fcf19fb614fa75b5659cfa171dd72bf585f41
7
- data.tar.gz: dc95bcb8417bfcbd86a3ed237d214a8546c4a5ea05212cf3f961cfbb74ddfbdd718d3657471e91a39d4695c06db7255cefc7ee5a73f83adbb096aaaefa6c6b4d
6
+ metadata.gz: 4910ef336c5c19a0de0cc87c064e17faeef0fd750656231cde021694972ce455e178e43b78c61cf2470e2af8691178b15bb54aff1428cfbc9c83d6bc8593f759
7
+ data.tar.gz: 67709d0f457ceb41511fb8172ce0137faee7f986f843495829717b01a3bc408caff46fe3ecbe28ee07c0429ec9be16bdaf6a7962ae8647d183413f15c3503712
data/README.md CHANGED
@@ -255,7 +255,7 @@ Again, like most other commands, goes well with shell scripting:
255
255
 
256
256
  Repository commands have all the options [General API Commands](#general-api-commands) have.
257
257
 
258
- Additionally, you can specify the Repository to talk to by providing `--repo owner/name`. However, if you invoke the command inside a clone of the project, the client will figure out this option on its own. Note that it uses the [git remote](http://www.kernel.org/pub/software/scm/git/docs/git-remote.html) "origin" to do so.
258
+ Additionally, you can specify the Repository to talk to by providing `--repo owner/name`. However, if you invoke the command inside a clone of the project, the client will figure out this option on its own. Note that it uses the tracked [git remote](http://www.kernel.org/pub/software/scm/git/docs/git-remote.html) for the current branch (and defaults to 'origin' if no tracking is set) to do so.
259
259
 
260
260
  It will also automatically pick [Travis Pro](https://travis-ci.com) if it is a private project. You can of course override this decission with `--pro`, `--org` or `--api-endpoint URL`
261
261
 
@@ -10,6 +10,7 @@ module Travis
10
10
  on('-e', '--api-endpoint URL', 'Travis API server to talk to')
11
11
  on('--pro', "short-cut for --api-endpoint '#{Travis::Client::PRO_URI}'") { |c,_| c.api_endpoint = Travis::Client::PRO_URI }
12
12
  on('--org', "short-cut for --api-endpoint '#{Travis::Client::ORG_URI}'") { |c,_| c.api_endpoint = Travis::Client::ORG_URI }
13
+ on('--staging', 'talks to staging system') { |c,_| c.api_endpoint = c.api_endpoint.gsub(/api/, 'api-staging') }
13
14
  on('-t', '--token [ACCESS_TOKEN]', 'access token to use') { |c, t| c.access_token = t }
14
15
 
15
16
  on('--debug', 'show API requests') do |c,_|
@@ -43,7 +43,11 @@ module Travis
43
43
  end
44
44
 
45
45
  def find_slug
46
- git_info = `git config --get remote.origin.url 2>&1`
46
+ git_head = `git name-rev --name-only HEAD 2>&1`.chomp
47
+ git_remote = `git config --get branch.#{git_head}.remote 2>&1`.chomp
48
+ # Default to 'origin' if no tracking is set
49
+ git_remote = 'origin' if git_remote.empty?
50
+ git_info = `git config --get remote.#{git_remote}.url 2>&1`.chomp
47
51
  $1 if git_info =~ GIT_REGEX
48
52
  end
49
53
 
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'travis/client'
2
3
 
3
4
  module Travis
@@ -9,8 +10,13 @@ module Travis
9
10
  # @!parse attr_reader :job
10
11
  has :job
11
12
 
13
+ def encoded_body
14
+ return body unless body.respond_to? :encode
15
+ body.encode 'utf-8'
16
+ end
17
+
12
18
  def colorized_body
13
- attributes['colorized_body'] ||= body.gsub(/[^[:print:]\e\n]/, '')
19
+ attributes['colorized_body'] ||= encoded_body.gsub(/[^[:print:]\e\n]/, '')
14
20
  end
15
21
 
16
22
  def clean_body
@@ -31,6 +31,14 @@ module Travis
31
31
  alias find find_one
32
32
  alias find_all find_many
33
33
 
34
+ def clear_cache
35
+ session.clear_cache
36
+ end
37
+
38
+ def clear_cache!
39
+ session.clear_cache!
40
+ end
41
+
34
42
  private
35
43
 
36
44
  def session
@@ -1,3 +1,3 @@
1
1
  module Travis
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
@@ -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.2"
5
+ s.version = "1.2.3"
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"
@@ -15,8 +15,9 @@ Gem::Specification.new do |s|
15
15
  "Henrik Hodne",
16
16
  "Max Barnash",
17
17
  "Mario Visic",
18
- "Adrien Brault",
19
18
  "Piotr Sarnacki",
19
+ "Adrien Brault",
20
+ "Rapha0353l Pinson",
20
21
  "Justin Lambert",
21
22
  "Laurent Petit"
22
23
  ]
@@ -26,8 +27,9 @@ Gem::Specification.new do |s|
26
27
  "konstantin.mailinglists@googlemail.com",
27
28
  "me@henrikhodne.com",
28
29
  "i.am@anhero.ru",
29
- "adrien.brault@gmail.com",
30
30
  "drogus@gmail.com",
31
+ "adrien.brault@gmail.com",
32
+ "raphael.pinson@camptocamp.com",
31
33
  "jlambert@eml.cc",
32
34
  "laurent.petit@gmail.com",
33
35
  "mario@mariovisic.com"
metadata CHANGED
@@ -1,21 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  - Henrik Hodne
9
9
  - Max Barnash
10
10
  - Mario Visic
11
- - Adrien Brault
12
11
  - Piotr Sarnacki
12
+ - Adrien Brault
13
+ - Rapha0353l Pinson
13
14
  - Justin Lambert
14
15
  - Laurent Petit
15
16
  autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
- date: 2013-05-24 00:00:00.000000000 Z
19
+ date: 2013-06-27 00:00:00.000000000 Z
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: faraday
@@ -190,8 +191,9 @@ email:
190
191
  - konstantin.mailinglists@googlemail.com
191
192
  - me@henrikhodne.com
192
193
  - i.am@anhero.ru
193
- - adrien.brault@gmail.com
194
194
  - drogus@gmail.com
195
+ - adrien.brault@gmail.com
196
+ - raphael.pinson@camptocamp.com
195
197
  - jlambert@eml.cc
196
198
  - laurent.petit@gmail.com
197
199
  - mario@mariovisic.com