easy-auto 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy_auto/pull_request.rb +10 -1
- data/lib/easy_auto/version.rb +1 -1
- data/test/lib/easy_auto/pull_request_test.rb +16 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f55997dc56725a7217d173f539f1d21598655337
|
4
|
+
data.tar.gz: 48612c7f6935555d20a9bae77dc9441efb116e22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab39e092b62e1c0ff1aacc977ffdfc82ca692a4904fcf718fa1bbcca96a8676c1610aa4bf59be6ba1bf0fdcd1922b6cb2c29749147b3fa9fad4605b3b984f2d8
|
7
|
+
data.tar.gz: bdcf1e613fedc911768d25c34f6cf8ca1684535e44e51fa97c4ce2d801fcd9912a8d4be814f288f52c9618a8c136f44425fd64901a993b09a0f9ae9fff1c614c
|
@@ -50,7 +50,7 @@ module EasyAuto
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def repo_owner
|
53
|
-
|
53
|
+
(origin_owner || any_owner)[1]
|
54
54
|
end
|
55
55
|
|
56
56
|
def repo_path
|
@@ -64,5 +64,14 @@ module EasyAuto
|
|
64
64
|
def remote_paths
|
65
65
|
git.perform "remote -v"
|
66
66
|
end
|
67
|
+
|
68
|
+
private
|
69
|
+
def any_owner
|
70
|
+
remote_paths.match(/:(.+)\//)
|
71
|
+
end
|
72
|
+
|
73
|
+
def origin_owner
|
74
|
+
remote_paths.match(/origin.+:(.+)\//)
|
75
|
+
end
|
67
76
|
end
|
68
77
|
end
|
data/lib/easy_auto/version.rb
CHANGED
@@ -12,7 +12,7 @@ class PRMock < EasyAuto::PullRequest
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def remote_paths
|
15
|
-
"
|
15
|
+
"my_copy\tgit@github.com:stuartnelson3/easy-auto.git (fetch)\nmy_copy\tgit@github.com:stuartnelson3/easy-auto.git (push)\norigin\tgit@github.com:repo_owner/easy-auto.git (fetch)\norigin\tgit@github.com:repo_owner/easy-auto.git (push)\n"
|
16
16
|
end
|
17
17
|
|
18
18
|
def head
|
@@ -24,6 +24,12 @@ class PRMock < EasyAuto::PullRequest
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
DblMock = Class.new(PRMock) do
|
28
|
+
def remote_paths
|
29
|
+
"my_copy\tgit@github.com:stuartnelson3/easy-auto.git (fetch)\nmy_copy\tgit@github.com:stuartnelson3/easy-auto.git (push)"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
27
33
|
describe EasyAuto::PullRequest do
|
28
34
|
before do
|
29
35
|
@mock = MiniTest::Mock.new
|
@@ -66,6 +72,15 @@ describe EasyAuto::PullRequest do
|
|
66
72
|
subject.repo_owner.must_equal 'repo_owner'
|
67
73
|
end
|
68
74
|
|
75
|
+
it 'finds the repo name attached to the origin endpoint if it exists' do
|
76
|
+
subject.repo_owner.must_equal 'repo_owner'
|
77
|
+
end
|
78
|
+
|
79
|
+
it "finds the repo name if origin is not present" do
|
80
|
+
dblmock = DblMock.new @mock
|
81
|
+
dblmock.repo_owner.must_equal 'stuartnelson3'
|
82
|
+
end
|
83
|
+
|
69
84
|
it 'returns the right repo_path' do
|
70
85
|
subject.repo_path.must_equal 'repo_owner/easy-auto'
|
71
86
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-auto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: octokit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: general_store
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Easy access to git commands
|
@@ -78,7 +78,7 @@ executables:
|
|
78
78
|
extensions: []
|
79
79
|
extra_rdoc_files: []
|
80
80
|
files:
|
81
|
-
- .gitignore
|
81
|
+
- ".gitignore"
|
82
82
|
- Gemfile
|
83
83
|
- LICENSE.txt
|
84
84
|
- README.md
|
@@ -125,17 +125,17 @@ require_paths:
|
|
125
125
|
- lib
|
126
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- -
|
133
|
+
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.1
|
138
|
+
rubygems_version: 2.2.1
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Use the command line to simplify interacting with git
|