travis 1.8.1.travis.713.4 → 1.8.1.travis.717.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDVmZDgzOWQ0YTg5MDM5ZDg2YTZhNzY4NzBjMDhiYjc0ODMyZmYwZg==
4
+ ZDJlYjIwZDc3NzJkZWViOTdlNGU4NzJmNjE2MmI1Njc0MGFjN2VjOA==
5
5
  data.tar.gz: !binary |-
6
- ZDU0NDUzYTdiNzljNGM3NTQ3M2YxMzFjNTU2YmUzN2Y0MmFjZDc4Mg==
6
+ MzQ3MGZiOGFlYjhhZWFlMjUwMDMzNDNmZjU3ZGFmMjVhNTExMWRhOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTM0NmYzYmY4MzFjNzkzZjA3ZWQ2N2MxYmM2MDViMzliZjM5NmRiOTM2Y2E4
10
- ZjM2YTQ2NWNkODM0MmNkMzRhODZkMTkxNzdjZTAzYTIxODE3M2JkNzVlYWU1
11
- MzcyZWU1M2Y0Mjc1MjUyMjllOWU3NjliZTM0NjI1MWVmM2FjNWE=
9
+ YjAyNTk5YjZhYTA5NzU2YmU2NmVjMjVmNjZmOTRjYTdhNzc5ZDM1YWYxMTEx
10
+ YTYxMmEzNGQ3ODM5MjVkNGQxNGFmNjgwNTIwZDMwMGExYWE4N2QzYzcxODAw
11
+ YjczMjZhYzk3ZDAwYThkYzI3ZGI3NGI5N2RhYTJjZGYzMmMxYjY=
12
12
  data.tar.gz: !binary |-
13
- M2NhY2MyMDQwNzBmMWFiNGM2YjVhNDcyNjQxNmQyM2Q0ODAxYzc4NDk0YmE0
14
- NWIzMTFjYzQyMGRjZDViYTE1NWEzOWMyOGQzNDJiNGQ3Y2QwYmE3ZDA1YTRh
15
- ZDk1YTc5MmRlZTA3YmQ4NjhkZjBlNjEyYmFiMjU3Yjc3MzYzMzM=
13
+ NTllODljZWI5NTljOWY1NjYyNzMxODU1OGJjMGM5MjQ5NmFiMmU3M2JlYTEz
14
+ NmI0NjdmM2E2OTFhN2E0NzFkYTM1N2E1ZTVhZjE5YWFkNzkwOGY0OTgzNmI0
15
+ NjBmOTdmYTE4NmViMTIzZjMwN2UwMjkyNjk4NDAxZjEzYWYxYzk=
@@ -1,6 +1,5 @@
1
1
  require 'travis/cli'
2
2
  require 'yaml'
3
- require "addressable/uri"
4
3
 
5
4
  module Travis
6
5
  module CLI
@@ -68,7 +67,7 @@ module Travis
68
67
  git_remote = 'origin' if git_remote.empty?
69
68
  git_info = `git ls-remote --get-url #{git_remote} 2>#{IO::NULL}`.chomp
70
69
 
71
- if Addressable::URI.parse(git_info).path =~ GIT_REGEX
70
+ if parse_remote(git_info) =~ GIT_REGEX
72
71
  detectected_slug = $1
73
72
  if interactive?
74
73
  if agree("Detected repository as #{color(detectected_slug, :info)}, is this correct? ") { |q| q.default = 'yes' }
@@ -83,6 +82,16 @@ module Travis
83
82
  end
84
83
  end
85
84
 
85
+ def parse_remote(url)
86
+ if url =~ /^git@[^:]+:/
87
+ path = url.split(':').last
88
+ path = "/#{path}" unless path.start_with?('/')
89
+ path
90
+ else
91
+ URI.parse(url).path
92
+ end
93
+ end
94
+
86
95
  def load_slug
87
96
  stored = `git config --get travis.slug`.chomp
88
97
  stored unless stored.empty?
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+ require 'uri'
3
+
4
+ describe Travis::CLI::RepoCommand do
5
+ describe '#parse_remote' do
6
+ it 'handles git@github.com URIs' do
7
+ path = subject.send(:parse_remote, 'git@github.com:travis-ci/travis.rb.git')
8
+ path.should be == '/travis-ci/travis.rb.git'
9
+ end
10
+
11
+ it 'handles GitHub Enterprise URIS' do
12
+ path = subject.send(:parse_remote, 'git@example.com:travis-ci/travis.rb.git')
13
+ path.should be == '/travis-ci/travis.rb.git'
14
+ end
15
+
16
+ it 'handles HTTPS URIs' do
17
+ path = subject.send(:parse_remote, 'https://github.com/travis-ci/travis.rb.git')
18
+ path.should be == '/travis-ci/travis.rb.git'
19
+ end
20
+
21
+ it 'raises URI::InvalidURIError for invalid URIs' do
22
+ expect { subject.send(:parse_remote, "foo@example.com:baz/bar.git") }.to raise_error(URI::InvalidURIError)
23
+ end
24
+ end
25
+ end
data/travis.gemspec CHANGED
@@ -260,6 +260,7 @@ Gem::Specification.new do |s|
260
260
  "spec/cli/login_spec.rb",
261
261
  "spec/cli/logs_spec.rb",
262
262
  "spec/cli/open_spec.rb",
263
+ "spec/cli/repo_command_spec.rb",
263
264
  "spec/cli/restart_spec.rb",
264
265
  "spec/cli/setup_spec.rb",
265
266
  "spec/cli/show_spec.rb",
@@ -299,7 +300,6 @@ Gem::Specification.new do |s|
299
300
  s.add_dependency "launchy", "~> 2.1"
300
301
  s.add_dependency "typhoeus", "~> 0.6", ">= 0.6.8"
301
302
  s.add_dependency "pusher-client", "~> 0.4"
302
- s.add_dependency "addressable", "~> 2.3"
303
303
  s.add_development_dependency "rspec", "~> 2.12"
304
304
  s.add_development_dependency "sinatra", "~> 1.3"
305
305
  s.add_development_dependency "rack-test", "~> 0.6"
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.8.1.travis.713.4
4
+ version: 1.8.1.travis.717.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -50,7 +50,7 @@ authors:
50
50
  autorequire:
51
51
  bindir: bin
52
52
  cert_chain: []
53
- date: 2015-12-29 00:00:00.000000000 Z
53
+ date: 2016-01-06 00:00:00.000000000 Z
54
54
  dependencies:
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: faraday
@@ -176,20 +176,6 @@ dependencies:
176
176
  - - ~>
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0.4'
179
- - !ruby/object:Gem::Dependency
180
- name: addressable
181
- requirement: !ruby/object:Gem::Requirement
182
- requirements:
183
- - - ~>
184
- - !ruby/object:Gem::Version
185
- version: '2.3'
186
- type: :runtime
187
- prerelease: false
188
- version_requirements: !ruby/object:Gem::Requirement
189
- requirements:
190
- - - ~>
191
- - !ruby/object:Gem::Version
192
- version: '2.3'
193
179
  - !ruby/object:Gem::Dependency
194
180
  name: rspec
195
181
  requirement: !ruby/object:Gem::Requirement
@@ -437,6 +423,7 @@ files:
437
423
  - spec/cli/login_spec.rb
438
424
  - spec/cli/logs_spec.rb
439
425
  - spec/cli/open_spec.rb
426
+ - spec/cli/repo_command_spec.rb
440
427
  - spec/cli/restart_spec.rb
441
428
  - spec/cli/setup_spec.rb
442
429
  - spec/cli/show_spec.rb