dude-cli 2.1.0.alpha5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/verify.yml +2 -2
- data/.gitignore +2 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +15 -9
- data/README.md +1 -0
- data/lib/dude.rb +1 -0
- data/lib/dude/code_management/github/create_pull_request.rb +1 -1
- data/lib/dude/commands.rb +2 -0
- data/lib/dude/commands/commit.rb +23 -0
- data/lib/dude/git.rb +1 -0
- data/lib/dude/git/commit.rb +20 -0
- data/lib/dude/project_management/jira/fetch_current_task.rb +1 -1
- data/lib/dude/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8791dfac3c2ed7f7c58a7a6fef335d4abdb924a504ff09eb3a8dabbd1a882682
|
4
|
+
data.tar.gz: 61d08e0ed19364bc034d093fae732858a6b0c912bbdfc22bb27f32206496119b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea06c3268ae65e384114ee39bddc9eae6b4141fe84a00f32c88967ce906361cbff4f5a6f8127871c35db0b65951e5ace54a44472a4ded0c9918ea4217a367d1
|
7
|
+
data.tar.gz: e63eab6fcde90c458b235072772991624813d31523737671cfcb99ca068e3a98b9a0159e5306141e3418e95e49c4aa1f21d84823ad265d04be3caa7c34c10135
|
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
- uses: actions/checkout@v2
|
11
11
|
- uses: ruby/setup-ruby@v1
|
12
12
|
with:
|
13
|
-
ruby-version: 2.
|
13
|
+
ruby-version: 2.7 # Not needed with a .ruby-version file
|
14
14
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
15
15
|
- name: Run Rubocop
|
16
16
|
run: bundle exec rubocop
|
@@ -21,7 +21,7 @@ jobs:
|
|
21
21
|
- uses: actions/checkout@v2
|
22
22
|
- uses: ruby/setup-ruby@v1
|
23
23
|
with:
|
24
|
-
ruby-version: 2.
|
24
|
+
ruby-version: 2.7 # Not needed with a .ruby-version file
|
25
25
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
26
26
|
- name: Run RSpec
|
27
27
|
run: COVERAGE=true bundle exec rspec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dude-cli (2.1.0
|
4
|
+
dude-cli (2.1.0)
|
5
5
|
colorize (~> 0.8.1)
|
6
6
|
dry-cli (~> 0.6)
|
7
7
|
faraday (~> 1.1)
|
@@ -26,19 +26,25 @@ GEM
|
|
26
26
|
diff-lcs (1.4.4)
|
27
27
|
docile (1.3.5)
|
28
28
|
dry-cli (0.7.0)
|
29
|
-
faraday (1.
|
29
|
+
faraday (1.7.0)
|
30
30
|
faraday-em_http (~> 1.0)
|
31
31
|
faraday-em_synchrony (~> 1.0)
|
32
32
|
faraday-excon (~> 1.1)
|
33
|
+
faraday-httpclient (~> 1.0.1)
|
33
34
|
faraday-net_http (~> 1.0)
|
34
35
|
faraday-net_http_persistent (~> 1.1)
|
36
|
+
faraday-patron (~> 1.0)
|
37
|
+
faraday-rack (~> 1.0)
|
35
38
|
multipart-post (>= 1.2, < 3)
|
36
39
|
ruby2_keywords (>= 0.0.4)
|
37
40
|
faraday-em_http (1.0.0)
|
38
41
|
faraday-em_synchrony (1.0.0)
|
39
42
|
faraday-excon (1.1.0)
|
43
|
+
faraday-httpclient (1.0.1)
|
40
44
|
faraday-net_http (1.0.1)
|
41
|
-
faraday-net_http_persistent (1.
|
45
|
+
faraday-net_http_persistent (1.2.0)
|
46
|
+
faraday-patron (1.0.0)
|
47
|
+
faraday-rack (1.0.0)
|
42
48
|
i18n (1.8.10)
|
43
49
|
concurrent-ruby (~> 1.0)
|
44
50
|
jira-ruby (2.1.5)
|
@@ -52,7 +58,7 @@ GEM
|
|
52
58
|
multipart-post (2.1.1)
|
53
59
|
oauth (0.5.6)
|
54
60
|
parallel (1.20.1)
|
55
|
-
parser (3.0.
|
61
|
+
parser (3.0.2.0)
|
56
62
|
ast (~> 2.4.1)
|
57
63
|
pastel (0.8.0)
|
58
64
|
tty-color (~> 0.5)
|
@@ -60,7 +66,7 @@ GEM
|
|
60
66
|
coderay (~> 1.1)
|
61
67
|
method_source (~> 1.0)
|
62
68
|
rainbow (3.0.0)
|
63
|
-
rake (13.0.
|
69
|
+
rake (13.0.6)
|
64
70
|
regexp_parser (2.1.1)
|
65
71
|
rexml (3.2.5)
|
66
72
|
rspec (3.10.0)
|
@@ -76,19 +82,19 @@ GEM
|
|
76
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
77
83
|
rspec-support (~> 3.10.0)
|
78
84
|
rspec-support (3.10.2)
|
79
|
-
rubocop (1.
|
85
|
+
rubocop (1.19.1)
|
80
86
|
parallel (~> 1.10)
|
81
87
|
parser (>= 3.0.0.0)
|
82
88
|
rainbow (>= 2.2.2, < 4.0)
|
83
89
|
regexp_parser (>= 1.8, < 3.0)
|
84
90
|
rexml
|
85
|
-
rubocop-ast (>= 1.
|
91
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
86
92
|
ruby-progressbar (~> 1.7)
|
87
93
|
unicode-display_width (>= 1.4.0, < 3.0)
|
88
|
-
rubocop-ast (1.
|
94
|
+
rubocop-ast (1.10.0)
|
89
95
|
parser (>= 3.0.1.1)
|
90
96
|
ruby-progressbar (1.11.0)
|
91
|
-
ruby2_keywords (0.0.
|
97
|
+
ruby2_keywords (0.0.5)
|
92
98
|
simplecov (0.21.2)
|
93
99
|
docile (~> 1.1)
|
94
100
|
simplecov-html (~> 0.11)
|
data/README.md
CHANGED
@@ -89,6 +89,7 @@ alias dude="rvm 2.7.2 do dude"
|
|
89
89
|
| dude checkout | ISSUE_ID | - | Checkout to branch with name "ID-issue-title" |
|
90
90
|
| dude track | ISSUE_ID | - | Start time entry in Toggl with issue project, title and id |
|
91
91
|
| dude tasks | - | - | Show all issues in current project (For current sprint) |
|
92
|
+
| dude commit | ISSUE_ID | - | Create commit with the ID and title of current story |
|
92
93
|
| dude stop | - | - | Stop current time entry in Toggl |
|
93
94
|
| dude start | ISSUE_ID | - | Do `checkout`, `track` and `move` actions |
|
94
95
|
| dude move | ISSUE_ID | --list=NAME | Move issue to another column (Will provide options if called without --list parameter) |
|
data/lib/dude.rb
CHANGED
@@ -17,7 +17,7 @@ module Dude
|
|
17
17
|
response = client.post("https://api.github.com/repos/#{owner}/#{repo}/pulls", body.to_json)
|
18
18
|
res = JSON.parse(response.body)
|
19
19
|
|
20
|
-
return github_error
|
20
|
+
return github_error if res['errors'] && !res['errors'].empty?
|
21
21
|
|
22
22
|
url = res['html_url']
|
23
23
|
puts "Pull request has been created: #{url}"
|
data/lib/dude/commands.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative './commands/version'
|
|
5
5
|
require_relative './commands/tasks'
|
6
6
|
require_relative './commands/move'
|
7
7
|
require_relative './commands/checkout'
|
8
|
+
require_relative './commands/commit'
|
8
9
|
require_relative './commands/start'
|
9
10
|
require_relative './commands/track'
|
10
11
|
require_relative './commands/stop'
|
@@ -21,6 +22,7 @@ module Dude
|
|
21
22
|
register 'tasks', Dude::Commands::Tasks, aliases: ['t', '-t', '--tasks']
|
22
23
|
register 'move', Dude::Commands::Move, aliases: ['m', '-m', '--move']
|
23
24
|
register 'checkout', Dude::Commands::Checkout, aliases: ['co']
|
25
|
+
register 'commit', Dude::Commands::Commit
|
24
26
|
register 'track', Dude::Commands::Track, aliases: ['tr']
|
25
27
|
register 'stop', Dude::Commands::Stop
|
26
28
|
register 'start', Dude::Commands::Start, aliases: ['st']
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dude
|
4
|
+
module Commands
|
5
|
+
class Commit < Dry::CLI::Command
|
6
|
+
desc 'Create a commit with id and title of current story'
|
7
|
+
|
8
|
+
argument :id, required: true, desc: 'The card short ID'
|
9
|
+
|
10
|
+
def call(id:)
|
11
|
+
Dude::Git::Commit.new.call(commit_name(id))
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def commit_name(id)
|
17
|
+
client = ProjectManagement::Client.new
|
18
|
+
issue_title = client.get_task_name_by_id(id)
|
19
|
+
"[#{id}] #{issue_title}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/dude/git.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dude
|
4
|
+
module Git
|
5
|
+
class Commit
|
6
|
+
def call(commit_name)
|
7
|
+
@commit_name = commit_name
|
8
|
+
create_commit
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
attr_reader :commit_name
|
14
|
+
|
15
|
+
def create_commit
|
16
|
+
`git commit -m "#{commit_name}"`
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -28,7 +28,7 @@ module Dude
|
|
28
28
|
description: issue.description,
|
29
29
|
status: issue.status.name,
|
30
30
|
assignee: issue&.assignee&.displayName,
|
31
|
-
url: "#{Dude::SETTINGS.dig(:
|
31
|
+
url: "#{Dude::SETTINGS.dig(:jira, :project, :url)}/browse/#{issue.key}"
|
32
32
|
)
|
33
33
|
end
|
34
34
|
end
|
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
|
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-
|
11
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/dude/code_management/github/create_pull_request.rb
|
198
198
|
- lib/dude/commands.rb
|
199
199
|
- lib/dude/commands/checkout.rb
|
200
|
+
- lib/dude/commands/commit.rb
|
200
201
|
- lib/dude/commands/health_check.rb
|
201
202
|
- lib/dude/commands/install.rb
|
202
203
|
- lib/dude/commands/move.rb
|
@@ -211,6 +212,7 @@ files:
|
|
211
212
|
- lib/dude/config.rb
|
212
213
|
- lib/dude/git.rb
|
213
214
|
- lib/dude/git/checkout.rb
|
215
|
+
- lib/dude/git/commit.rb
|
214
216
|
- lib/dude/git/current_branch_name.rb
|
215
217
|
- lib/dude/git/remote_name.rb
|
216
218
|
- lib/dude/health_check.rb
|
@@ -258,9 +260,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
258
260
|
version: 2.7.0
|
259
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
262
|
requirements:
|
261
|
-
- - "
|
263
|
+
- - ">="
|
262
264
|
- !ruby/object:Gem::Version
|
263
|
-
version:
|
265
|
+
version: '0'
|
264
266
|
requirements: []
|
265
267
|
rubygems_version: 3.1.4
|
266
268
|
signing_key:
|