cp8_cli 4.1.3 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/cp8 +5 -0
- data/lib/cp8_cli/branch.rb +13 -1
- data/lib/cp8_cli/main.rb +10 -0
- data/lib/cp8_cli/pull_request.rb +11 -4
- data/lib/cp8_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256100625c3c7f06417bd59536d4c12d9b89397c
|
4
|
+
data.tar.gz: 7998d37f7925632ef5df017d87c96cbed3641b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51daaba203995014fe5f2158860c8bc26812d762461eb1f4c161b6ddc9205b61d705d1d9992dc17f0fe9240b634b225c2d96107e1af031a5626ce71c2f3a2e0
|
7
|
+
data.tar.gz: 554fe042832d538069b6e21f1bea5121d7328fc58016f4a7e7277a9ca0e74143c6565265813afc174c22f71825f48257570dff7bdbda24ad4f9d5a4543f802b3
|
data/exe/cp8
CHANGED
data/lib/cp8_cli/branch.rb
CHANGED
@@ -27,7 +27,7 @@ module Cp8Cli
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def open_pull_request(options = {})
|
30
|
-
pr = PullRequest.new options.
|
30
|
+
pr = PullRequest.new options.reverse_merge(story: current_story, from: name, target: target)
|
31
31
|
pr.open
|
32
32
|
end
|
33
33
|
|
@@ -47,6 +47,18 @@ module Cp8Cli
|
|
47
47
|
name_parts[2] || name
|
48
48
|
end
|
49
49
|
|
50
|
+
def reset
|
51
|
+
if Command.read("git status --porcelain")
|
52
|
+
Command.error "Dirty working directory, not resetting."
|
53
|
+
else
|
54
|
+
Command.run("git reset --hard origin/#{name}")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_s
|
59
|
+
name
|
60
|
+
end
|
61
|
+
|
50
62
|
private
|
51
63
|
|
52
64
|
attr_reader :name
|
data/lib/cp8_cli/main.rb
CHANGED
@@ -36,6 +36,16 @@ module Cp8Cli
|
|
36
36
|
Branch.current.open_ci
|
37
37
|
end
|
38
38
|
|
39
|
+
def suggest
|
40
|
+
original_branch = Branch.current
|
41
|
+
suggestion_branch = Branch.new("suggestion-#{SecureRandom.hex(8)}")
|
42
|
+
suggestion_branch.checkout
|
43
|
+
suggestion_branch.push
|
44
|
+
suggestion_branch.open_pull_request(target: original_branch, expand: false)
|
45
|
+
original_branch.checkout
|
46
|
+
original_branch.reset
|
47
|
+
end
|
48
|
+
|
39
49
|
def cleanup
|
40
50
|
Cleanup.new(Branch.current.target).run
|
41
51
|
end
|
data/lib/cp8_cli/pull_request.rb
CHANGED
@@ -2,10 +2,11 @@ require "cp8_cli/repo"
|
|
2
2
|
|
3
3
|
module Cp8Cli
|
4
4
|
class PullRequest
|
5
|
-
def initialize(from:, target:, story: nil, **options)
|
5
|
+
def initialize(from:, target:, story: nil, expand: true, **options)
|
6
6
|
@story = story
|
7
7
|
@from = from
|
8
|
-
@target = target
|
8
|
+
@target = target.to_s
|
9
|
+
@expand = expand
|
9
10
|
@options = options
|
10
11
|
end
|
11
12
|
|
@@ -15,10 +16,16 @@ module Cp8Cli
|
|
15
16
|
|
16
17
|
private
|
17
18
|
|
18
|
-
attr_reader :story, :from, :target, :options
|
19
|
+
attr_reader :story, :from, :target, :expand, :options
|
19
20
|
|
20
21
|
def url
|
21
|
-
repo.url + "/compare/#{target}...#{escape from}?
|
22
|
+
repo.url + "/compare/#{target}...#{escape from}?title=#{escape title_with_prefixes}&body=#{escape body}#{expand_query}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def expand_query
|
26
|
+
if expand
|
27
|
+
"&expand=1"
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
31
|
def title
|
data/lib/cp8_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cp8_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|