pull-request 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/exe/pr +4 -4
- data/pullrequest.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e6773c068432f0d4a3d1c7197098868ac2c518795281c9ed05993b9f4c9b8a
|
4
|
+
data.tar.gz: 871f2deff84489e3fb02982f774b1c5c62bac854c0c0795e0f9f89b263a6aed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 385eaf3a4b15ef66c674843937e47c7697494151606d2b3abc6378ee2f0a7bde616e31abebd75d52dbde8a0cb519f5341c648b04b57b4eb233f7697aba5c8089
|
7
|
+
data.tar.gz: 76dc4fd0e5bf18e65d07735c8d63250443bb8238ee01b3d718ef94f2e7487ca3dab2fd7a04c2efd2eda567a4d893a9b4e4ddaa9b42a952f058dc1b8393f79239
|
data/README.md
CHANGED
@@ -69,6 +69,17 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
69
69
|
|
70
70
|
Bug reports and pull requests are welcome on GitHub at https://github.com/Jens Ravens/pullrequest. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
71
71
|
|
72
|
+
## Troubleshooting
|
73
|
+
|
74
|
+
**No such file or directory**
|
75
|
+
|
76
|
+
```
|
77
|
+
pr -i 210
|
78
|
+
pr: cannot open 210, No such file or directory
|
79
|
+
```
|
80
|
+
|
81
|
+
`pr` is already a command on the OS, until we override it with our GEM. If encountering this error it means that the gem has not been installed successfully for this Ruby version.
|
82
|
+
|
72
83
|
## License
|
73
84
|
|
74
85
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/exe/pr
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require "optionparser"
|
3
3
|
require "active_support"
|
4
4
|
require "active_support/all"
|
5
|
+
require "shellwords"
|
5
6
|
|
6
7
|
@simulate = false
|
7
8
|
@issue_number = nil
|
@@ -64,7 +65,6 @@ body_lines = []
|
|
64
65
|
path = ".github/pull_request_template.md"
|
65
66
|
body_lines.push File.read(path) if File.exist?(path)
|
66
67
|
body_lines.push "fixes ##{@issue_number}" if @issue_number
|
67
|
-
body = body_lines.join("\n\n")
|
68
68
|
|
69
69
|
base_branch = current_branch
|
70
70
|
exit 1 unless ["master", "main", "develop"].include?(base_branch) || confirm("Your base branch #{base_branch} doesn't seem to be a common base branch name. Do you want to continue?")
|
@@ -77,11 +77,11 @@ sh "git checkout -b #{branch}"
|
|
77
77
|
puts "Creating empty commit"
|
78
78
|
commit_message = "initial commit for #{title}"
|
79
79
|
commit_message += ", fixes ##{@issue_number}" if @issue_number
|
80
|
-
sh "git commit -m
|
80
|
+
sh "git commit -m #{Shellwords.escape(commit_message)} --allow-empty"
|
81
81
|
|
82
82
|
puts "Pushing to origin"
|
83
83
|
sh "git push -u origin #{branch}"
|
84
84
|
|
85
85
|
puts "Creating pull request"
|
86
|
-
|
87
|
-
sh "gh pr create --draft --title
|
86
|
+
|
87
|
+
sh "gh pr create --draft --title #{Shellwords.escape(title)} --body #{Shellwords.escape(body_lines.join("\n"))} --base #{base_branch}"
|
data/pullrequest.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pull-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ravens
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|