pr-daikou 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/pr-daikou.rb +10 -6
- data/lib/pr-daikou/cli.rb +8 -8
- data/lib/pr-daikou/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be7a8ad6e9d910f0a302a6f91f09111b4a466197565310417b1cc322b04b638
|
4
|
+
data.tar.gz: 5a3b7e2e17b159770fd088411cf830a299aa9e326983340a1044d1f71d7279de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d45fb6bcef48183a9e834d658b0adb632cf72f0acd934e306a9bc116dda8b682f99e8cbb0f18ad8c60c3e017cd9165330fe1fca2d62069f0691467d7c316fc6
|
7
|
+
data.tar.gz: fa287c5454ecb29ffb24bae2004cb920c578f06a340b0e26c68d9fe0114d380c93fb6034e722239bc3655dfd5ac76e55a5f1d8c4b07c417fa63769b5d757bb1d
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# pr-daikou
|
2
2
|
|
3
|
+
[![CircleCI](https://circleci.com/gh/rvillage/pr-daikou/tree/master.svg?style=svg)](https://circleci.com/gh/rvillage/pr-daikou/tree/master)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/pr-daikou.svg)](https://badge.fury.io/rb/pr-daikou)
|
5
|
+
|
3
6
|
`pr-daikou` is agency script for Create Pull Request.
|
4
7
|
|
5
8
|
By requesting a build to CI service (e.g. CircleCI) to execute this script, Automatic code correction (e.g. `rubocop --auto-correct`, `bundle update`) is invoked, then commit changes and create pull request to GitHub repository if there some changes exist.
|
@@ -75,10 +78,10 @@ Usage: pr-daikou [options]
|
|
75
78
|
--email EMAIL git committed user email, default: pr_daikou@example.com
|
76
79
|
--name NAME git committed user name, default: pr_daikou
|
77
80
|
-T, --title TITLE pull request title, default: PR daikou [at Mon Jan 1 12:34:56 UTC 2017]
|
81
|
+
--description DESC pull request description, default: ""
|
78
82
|
-m, --commit MESSAGE add git commit message, default: :robot: PR daikou
|
79
83
|
-b, --base BRANCH pull request base branch, default: master
|
80
84
|
-t, --topic BRANCH create new branch, default: ci/pr-daikou_[20170101123456.000]
|
81
|
-
-u, --pullrequest URL add new pull request description, default: nil
|
82
85
|
```
|
83
86
|
|
84
87
|
## Contributing
|
data/lib/pr-daikou.rb
CHANGED
@@ -22,7 +22,7 @@ module PRDaikou
|
|
22
22
|
)
|
23
23
|
PRDaikou::Host::Github.create_pullrequest(
|
24
24
|
pullrequest_title(options[:title]),
|
25
|
-
pullrequest_description(options[:
|
25
|
+
pullrequest_description(options[:description]),
|
26
26
|
options[:base],
|
27
27
|
topic_branch(options[:topic], current_time)
|
28
28
|
)
|
@@ -46,10 +46,14 @@ module PRDaikou
|
|
46
46
|
"#{title} at #{`echo -n $(date)`}"
|
47
47
|
end
|
48
48
|
|
49
|
-
def pullrequest_description(
|
50
|
-
|
51
|
-
PR
|
52
|
-
|
53
|
-
|
49
|
+
def pullrequest_description(description)
|
50
|
+
if description == ''
|
51
|
+
'Auto generated by [PR daikou](https://rubygems.org/gems/pr-daikou)'
|
52
|
+
else
|
53
|
+
<<~DESCRIPTION
|
54
|
+
#{description}
|
55
|
+
Auto generated by [PR daikou](https://rubygems.org/gems/pr-daikou)
|
56
|
+
DESCRIPTION
|
57
|
+
end
|
54
58
|
end
|
55
59
|
end
|
data/lib/pr-daikou/cli.rb
CHANGED
@@ -11,13 +11,13 @@ module PRDaikou
|
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
@options = {
|
14
|
-
commit:
|
15
|
-
title:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
commit: ':robot: PR daikou',
|
15
|
+
title: 'PR daikou',
|
16
|
+
description: '',
|
17
|
+
email: 'pr_daikou@example.com',
|
18
|
+
name: 'pr_daikou',
|
19
|
+
base: 'master',
|
20
|
+
topic: 'ci/pr-daikou'
|
21
21
|
}
|
22
22
|
end
|
23
23
|
|
@@ -35,10 +35,10 @@ module PRDaikou
|
|
35
35
|
opt.on('--email EMAIL', "git committed user email, default: #{@options[:email]}") {|v| @options[:email] = v }
|
36
36
|
opt.on('--name NAME', "git committed user name, default: #{@options[:name]}") {|v| @options[:name] = v }
|
37
37
|
opt.on('-T', '--title TITLE', "pull request title, default: #{@options[:title]} [at Mon Jan 1 12:34:56 UTC 2017]") {|v| @options[:title] = v }
|
38
|
+
opt.on('--description DESC', "pull request description, default: #{@options[:description]}") {|v| @options[:description] = v }
|
38
39
|
opt.on('-m', '--commit MESSAGE', "add git commit message, default: #{@options[:commit]}") {|v| @options[:commit] = v }
|
39
40
|
opt.on('-b', '--base BRANCH', "pull request base branch, default: #{@options[:base]}") {|v| @options[:base] = v }
|
40
41
|
opt.on('-t', '--topic BRANCH', "create new branch, default: #{@options[:topic]}_[20170101123456.000]") {|v| @options[:topic] = v }
|
41
|
-
opt.on('-u', '--pullrequest URL', 'add new pull request description, default: nil') {|v| @options[:url] = v }
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/pr-daikou/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pr-daikou
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rvillage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.7.
|
63
|
+
rubygems_version: 2.7.6
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: Create GitHub PullRequest of code changes in CI Service
|