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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b95b6e44f2b82266c1ed53d026ecf64556de31765455312d733a1c6dfa3514f5
4
- data.tar.gz: 6260679fd435d1233952a10a77a3ea5a81e328d4f7d79361aea8198a4c238d3b
3
+ metadata.gz: 6be7a8ad6e9d910f0a302a6f91f09111b4a466197565310417b1cc322b04b638
4
+ data.tar.gz: 5a3b7e2e17b159770fd088411cf830a299aa9e326983340a1044d1f71d7279de
5
5
  SHA512:
6
- metadata.gz: c46c31874b6b9787d5c79fdedc8cc45159664b177fbff5ca0daf8a2c246831925e78e89b89617acd9528435320474eabcac8a4bcc9e4a47b636cf0fabb5dbf1d
7
- data.tar.gz: 40e56e0914565a69690bdb5ab08d59e0ff5bbc84b19d4d3273156e49eb99eb085d713fc90fcdb343b1c81883e134e17a86d854357cb8903b27318806ef12a2de
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
@@ -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[:url]),
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(base_pullrequest_url)
50
- <<~DESCRIPTION
51
- PR: #{base_pullrequest_url}
52
- Auto generated by [PR daikou](https://rubygems.org/gems/pr-daikou)
53
- DESCRIPTION
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
@@ -11,13 +11,13 @@ module PRDaikou
11
11
 
12
12
  def initialize
13
13
  @options = {
14
- commit: ':robot: PR daikou',
15
- title: 'PR daikou',
16
- email: 'pr_daikou@example.com',
17
- name: 'pr_daikou',
18
- base: 'master',
19
- topic: 'ci/pr-daikou',
20
- url: nil
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
@@ -1,3 +1,3 @@
1
1
  module PRDaikou
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
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.1
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: 2017-12-31 00:00:00.000000000 Z
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.4
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