dude-cli 2.1.0.alpha4 → 2.1.0.alpha5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +1 -1
- data/dude.gemspec +1 -1
- data/lib/dude.rb +1 -0
- data/lib/dude/code_management/github/create_pull_request.rb +16 -6
- data/lib/dude/commands/pr/remove.rb +1 -1
- data/lib/dude/project_management/jira/client.rb +8 -10
- data/lib/dude/project_management/jira/fetch_current_task.rb +2 -0
- data/lib/dude/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: 5a9d94fda51194e817efc77f7d46cf2cf7f8e94351c7cb989f7dd0512637e16f
|
4
|
+
data.tar.gz: 842f71093238abc9e102594629dc20ea6dc4677968c526dc6d0695ffd99a61d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ff9e01d64edc716ec55b366a03774eeb29819061e9ff52d4075f68780eb5f9f3fdb8249b5f31dc032e24d859dac341badda6cb19a074f58e55becefeafd32ca
|
7
|
+
data.tar.gz: 1739d16b3db6b32d57d0f186ea918c6358c2ff6e026cb1a5daf29e9c9e0b8e09d509bc034cfc94030bdf2c4169e312b527870f01271512bdf36451bc0ab4467b
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/dude.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
DESC
|
17
17
|
spec.homepage = 'https://github.com/npupko/dude'
|
18
18
|
spec.license = 'MIT'
|
19
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
|
20
20
|
|
21
21
|
spec.metadata['homepage_uri'] = spec.homepage
|
22
22
|
spec.metadata['source_code_uri'] = 'https://github.com/npupko/dude'
|
data/lib/dude.rb
CHANGED
@@ -12,8 +12,13 @@ module Dude
|
|
12
12
|
@repo = repo
|
13
13
|
@params = params
|
14
14
|
|
15
|
+
return unless issue
|
16
|
+
|
15
17
|
response = client.post("https://api.github.com/repos/#{owner}/#{repo}/pulls", body.to_json)
|
16
18
|
res = JSON.parse(response.body)
|
19
|
+
|
20
|
+
return github_error unless res['errors'] && res['errors'].empty?
|
21
|
+
|
17
22
|
url = res['html_url']
|
18
23
|
puts "Pull request has been created: #{url}"
|
19
24
|
end
|
@@ -22,20 +27,25 @@ module Dude
|
|
22
27
|
|
23
28
|
attr_reader :issue, :owner, :repo, :params
|
24
29
|
|
30
|
+
def github_error
|
31
|
+
puts <<~HEREDOC
|
32
|
+
#{'Error:'.red.bold} GitHub cannot create new Pull Request from #{params[:head].bold} branch. Try to push your branch and try again
|
33
|
+
HEREDOC
|
34
|
+
end
|
35
|
+
|
25
36
|
def body
|
26
37
|
{
|
27
|
-
title: params[:title] || template[
|
28
|
-
body: params[:body] || template[
|
38
|
+
title: params[:title] || template[:title],
|
39
|
+
body: params[:body] || template[:body],
|
29
40
|
head: params[:head],
|
30
41
|
base: params[:base]
|
31
42
|
}
|
32
43
|
end
|
33
44
|
|
34
45
|
def template
|
35
|
-
|
36
|
-
|
37
|
-
template[
|
38
|
-
template['body'] = fill_variables(template['body'])
|
46
|
+
Dude::SETTINGS.dig(:github, :pr_template).tap do |template|
|
47
|
+
template[:title] = fill_variables(template[:title])
|
48
|
+
template[:body] = fill_variables(template[:body])
|
39
49
|
end
|
40
50
|
end
|
41
51
|
|
@@ -12,16 +12,14 @@ module Dude
|
|
12
12
|
class Client
|
13
13
|
attr_reader :client, :project
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
24
|
-
end
|
15
|
+
def options
|
16
|
+
{
|
17
|
+
username: Dude::SETTINGS.dig(:jira, :email),
|
18
|
+
password: Dude::SETTINGS.dig(:jira, :token),
|
19
|
+
site: Dude::SETTINGS.dig(:jira, :project, :url),
|
20
|
+
context_path: '',
|
21
|
+
auth_type: :basic
|
22
|
+
}
|
25
23
|
end
|
26
24
|
|
27
25
|
def initialize
|
data/lib/dude/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dude-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.alpha5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Pupko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
255
|
requirements:
|
256
256
|
- - ">="
|
257
257
|
- !ruby/object:Gem::Version
|
258
|
-
version: 2.
|
258
|
+
version: 2.7.0
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
requirements:
|
261
261
|
- - ">"
|