pull-request 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/exe/pr +4 -4
  4. data/pullrequest.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ec03a95ae507e21ea594a9be05dfd322c9398d2bd79c24880d8bd3436a6a1e4
4
- data.tar.gz: dab00856279d92ccc0f28147651a62ace011c97fb2d9305043550bfa6ac1f664
3
+ metadata.gz: 06e6773c068432f0d4a3d1c7197098868ac2c518795281c9ed05993b9f4c9b8a
4
+ data.tar.gz: 871f2deff84489e3fb02982f774b1c5c62bac854c0c0795e0f9f89b263a6aed8
5
5
  SHA512:
6
- metadata.gz: 70b786ae43c19db210e9f69dcbc1967b6368e55977b1eca71dd7ec94fbbf552dca60a54afb9c2ecf099b81d8a2c9d16f3ebef03dc765dfa2f9a0ec22a3d1a57b
7
- data.tar.gz: a73cb6dcf1c81121a254dd8506053b69b69d20d80dc7f0324518893d5622eaf44db2948d607e865f36718f2f9033f92fe98c4e565b5e1287940ca890f68fbd56
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 '#{commit_message}' --allow-empty"
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
- ENV["PR_BODY"] = body_lines.join("\n")
87
- sh "gh pr create --draft --title '#{title}' --body \"$PR_BODY\" --base #{base_branch}"
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
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "pull-request"
4
- spec.version = "0.6.1"
4
+ spec.version = "0.6.2"
5
5
  spec.authors = ["Jens Ravens", "David Dufour-Boivin"]
6
6
  spec.email = ["jens@nerdgeschoss.de", "david@nerdgeschoss.de"]
7
7
 
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.1
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-06-14 00:00:00.000000000 Z
12
+ date: 2023-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport