dude-cli 2.0.2 → 2.0.7
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 +32 -0
- data/.rubocop.yml +9 -0
- data/CHANGELOG.md +7 -3
- data/Gemfile +3 -1
- data/Gemfile.lock +38 -6
- data/LICENCE +20 -0
- data/README.md +21 -4
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/bin/dude +2 -2
- data/dude.gemspec +27 -19
- data/lib/dude.rb +8 -10
- data/lib/dude/commands.rb +19 -17
- data/lib/dude/commands/checkout.rb +4 -2
- data/lib/dude/commands/install.rb +7 -5
- data/lib/dude/commands/move.rb +5 -3
- data/lib/dude/commands/start.rb +4 -2
- data/lib/dude/commands/stop.rb +4 -2
- data/lib/dude/commands/tasks.rb +6 -3
- data/lib/dude/commands/track.rb +5 -3
- data/lib/dude/commands/version.rb +3 -1
- data/lib/dude/git.rb +2 -0
- data/lib/dude/git/checkout.rb +20 -1
- data/lib/dude/git/current_branch_name.rb +3 -1
- data/lib/dude/project_management/client.rb +6 -4
- data/lib/dude/project_management/entities/board.rb +2 -1
- data/lib/dude/project_management/entities/issue.rb +3 -1
- data/lib/dude/project_management/jira.rb +2 -1
- data/lib/dude/project_management/jira/client.rb +9 -7
- data/lib/dude/project_management/jira/fetch_current_tasks.rb +47 -0
- data/lib/dude/project_management/jira/get_task_name_by_id.rb +1 -1
- data/lib/dude/project_management/jira/move_task_to_list.rb +15 -13
- data/lib/dude/settings.rb +3 -0
- data/lib/dude/time_trackers/toggl.rb +2 -0
- data/lib/dude/time_trackers/toggl/base.rb +4 -0
- data/lib/dude/time_trackers/toggl/start_time_entry.rb +3 -2
- data/lib/dude/time_trackers/toggl/stop_time_entry.rb +3 -1
- data/lib/dude/version.rb +3 -1
- metadata +63 -21
- data/lib/dude/project_management/jira/get_current_tasks.rb +0 -40
- data/lib/dude/project_management/trello.rb +0 -6
- data/lib/dude/project_management/trello/checkout.rb +0 -4
- data/lib/dude/project_management/trello/client.rb +0 -33
- data/lib/dude/project_management/trello/get_current_tasks.rb +0 -24
- data/lib/dude/project_management/trello/get_lists.rb +0 -15
- data/lib/dude/project_management/trello/move_tasks_to_list.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f193ac190cdcd95628911cd674828269e6dfbbc7cc1e5fc0a60d5369ba6dd00e
|
4
|
+
data.tar.gz: 9b0ee32f4a20cbc7016fe7b6db792b2af4d9447ebc0356e124a97d0c1b8fee16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7153c965ca0222b34f7cc5dc14ee1e21d77303932b0c27f224a935ea3940ef088f5c907e60871f256080e31771914ab69b883b0bb6549c6731dc10a1d50237d
|
7
|
+
data.tar.gz: 1c42491aca9dd9d44d80ee46a08b0babf816bac4dd6c129de45975e0b9923939ae5b3f852a4aeccbb2263b7e1bd7d87817fe3502fda998ff17ccbd19456d6616
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Put this in the file: .github/workflows/verify.yml
|
2
|
+
|
3
|
+
name: Verify
|
4
|
+
on: [push, pull_request]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
rubocop:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 2.6 # Not needed with a .ruby-version file
|
14
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
15
|
+
- name: Run Rubocop
|
16
|
+
run: bundle exec rubocop
|
17
|
+
|
18
|
+
rspec:
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: 2.6 # Not needed with a .ruby-version file
|
25
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
26
|
+
- name: Run RSpec
|
27
|
+
run: COVERAGE=true bundle exec rspec
|
28
|
+
- name: Run codacy-coverage-reporter
|
29
|
+
uses: codacy/codacy-coverage-reporter-action@master
|
30
|
+
with:
|
31
|
+
project-token: "8c564cf8054e4575b20b580d47020f52"
|
32
|
+
coverage-reports: coverage/coverage.xml
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [2.0.7] - 2021-04-02
|
4
4
|
|
5
5
|
### Added
|
6
|
-
|
7
|
-
-
|
6
|
+
- RSpec and coverage
|
7
|
+
- Rubocop style changes
|
8
|
+
- Fixed #15
|
9
|
+
- Fixed README errors
|
10
|
+
- Changed requires to relatives
|
8
11
|
|
9
12
|
## [2.0.0] - 2021-03-10
|
10
13
|
|
@@ -23,3 +26,4 @@
|
|
23
26
|
|
24
27
|
[2.0.0]: https://github.com/npupko/dude/releases/tag/2.0.0
|
25
28
|
[1.0.2]: https://github.com/npupko/dude/releases/tag/1.0.2
|
29
|
+
[1.0.6]: https://github.com/npupko/dude/releases/tag/1.0.6
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dude-cli (2.0.
|
4
|
+
dude-cli (2.0.6)
|
5
5
|
colorize (~> 0.8.1)
|
6
6
|
dry-cli (~> 0.6)
|
7
7
|
faraday (~> 1.1)
|
@@ -16,12 +16,14 @@ GEM
|
|
16
16
|
minitest (>= 5.1)
|
17
17
|
tzinfo (~> 2.0)
|
18
18
|
zeitwerk (~> 2.3)
|
19
|
+
ast (2.4.2)
|
19
20
|
atlassian-jwt (0.2.0)
|
20
21
|
jwt (~> 2.1.0)
|
21
22
|
coderay (1.1.3)
|
22
23
|
colorize (0.8.1)
|
23
24
|
concurrent-ruby (1.1.8)
|
24
25
|
diff-lcs (1.4.4)
|
26
|
+
docile (1.3.5)
|
25
27
|
dry-cli (0.6.0)
|
26
28
|
concurrent-ruby (~> 1.0)
|
27
29
|
faraday (1.3.0)
|
@@ -41,26 +43,53 @@ GEM
|
|
41
43
|
minitest (5.14.4)
|
42
44
|
multipart-post (2.1.1)
|
43
45
|
oauth (0.5.5)
|
46
|
+
parallel (1.20.1)
|
47
|
+
parser (3.0.0.0)
|
48
|
+
ast (~> 2.4.1)
|
44
49
|
pry (0.14.0)
|
45
50
|
coderay (~> 1.1)
|
46
51
|
method_source (~> 1.0)
|
47
|
-
|
52
|
+
rainbow (3.0.0)
|
53
|
+
rake (13.0.3)
|
54
|
+
regexp_parser (2.1.1)
|
55
|
+
rexml (3.2.4)
|
48
56
|
rspec (3.10.0)
|
49
57
|
rspec-core (~> 3.10.0)
|
50
58
|
rspec-expectations (~> 3.10.0)
|
51
59
|
rspec-mocks (~> 3.10.0)
|
52
|
-
rspec-core (3.10.
|
60
|
+
rspec-core (3.10.1)
|
53
61
|
rspec-support (~> 3.10.0)
|
54
|
-
rspec-expectations (3.10.
|
62
|
+
rspec-expectations (3.10.1)
|
55
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
64
|
rspec-support (~> 3.10.0)
|
57
|
-
rspec-mocks (3.10.
|
65
|
+
rspec-mocks (3.10.2)
|
58
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
67
|
rspec-support (~> 3.10.0)
|
60
|
-
rspec-support (3.10.
|
68
|
+
rspec-support (3.10.2)
|
69
|
+
rubocop (1.12.0)
|
70
|
+
parallel (~> 1.10)
|
71
|
+
parser (>= 3.0.0.0)
|
72
|
+
rainbow (>= 2.2.2, < 4.0)
|
73
|
+
regexp_parser (>= 1.8, < 3.0)
|
74
|
+
rexml
|
75
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
76
|
+
ruby-progressbar (~> 1.7)
|
77
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
78
|
+
rubocop-ast (1.4.1)
|
79
|
+
parser (>= 2.7.1.5)
|
80
|
+
ruby-progressbar (1.11.0)
|
61
81
|
ruby2_keywords (0.0.4)
|
82
|
+
simplecov (0.21.2)
|
83
|
+
docile (~> 1.1)
|
84
|
+
simplecov-html (~> 0.11)
|
85
|
+
simplecov_json_formatter (~> 0.1)
|
86
|
+
simplecov-cobertura (1.4.2)
|
87
|
+
simplecov (~> 0.8)
|
88
|
+
simplecov-html (0.12.3)
|
89
|
+
simplecov_json_formatter (0.1.2)
|
62
90
|
tzinfo (2.0.4)
|
63
91
|
concurrent-ruby (~> 1.0)
|
92
|
+
unicode-display_width (2.0.0)
|
64
93
|
zeitwerk (2.4.2)
|
65
94
|
|
66
95
|
PLATFORMS
|
@@ -71,6 +100,9 @@ DEPENDENCIES
|
|
71
100
|
pry (~> 0.14.0)
|
72
101
|
rake (~> 13.0)
|
73
102
|
rspec (~> 3.0)
|
103
|
+
rubocop (~> 1.12)
|
104
|
+
simplecov (~> 0.21.2)
|
105
|
+
simplecov-cobertura (~> 1.4)
|
74
106
|
|
75
107
|
BUNDLED WITH
|
76
108
|
2.1.4
|
data/LICENCE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020-2021 Nikita Pupko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
# Dude
|
1
|
+
# Dude
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/dude-cli.svg)](https://badge.fury.io/rb/dude-cli)
|
4
|
+
![Codacy coverage](https://img.shields.io/codacy/coverage/8c564cf8054e4575b20b580d47020f52)
|
5
|
+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a02f0a87f88542c89ac5bf62d1a7d0f7)](https://www.codacy.com/gh/npupko/dude/dashboard?utm_source=github.com&utm_medium=referral&utm_content=npupko/dude&utm_campaign=Badge_Grade)
|
6
|
+
![Gem](https://img.shields.io/gem/dv/dude-cli/stable)
|
7
|
+
![GitHub](https://img.shields.io/github/license/npupko/dude)
|
2
8
|
|
3
9
|
A daily assistant in the hard work of a programmer
|
4
10
|
|
@@ -62,14 +68,23 @@ DONE_LIST_NAME=Done
|
|
62
68
|
|
63
69
|
## Usage
|
64
70
|
|
71
|
+
#### Using RVM
|
72
|
+
|
73
|
+
To run gem in any folder using RVM just install gem to the global default ruby version and add alias to ~/.bashrc or ~/.zshrc
|
74
|
+
(Replace 2.7.2 to your ruby version and/or gemset)
|
75
|
+
|
76
|
+
```bash
|
77
|
+
alias dude="rvm 2.7.2 do dude"
|
78
|
+
```
|
79
|
+
|
65
80
|
| Command | Required parameters | Optional parameters | Description |
|
66
81
|
|:-------------:|:-------------------|:-------------------|:--------------------------------------------------------------------------------------|
|
67
82
|
| dude install | - | - | Create .duderc file in your home directory |
|
68
83
|
| dude checkout | ISSUE_ID | - | Checkout to branch with name "ID-issue-title" |
|
69
84
|
| dude track | ISSUE_ID | - | Start time entry in Toggl with issue project, title and id |
|
70
|
-
| dude tasks |
|
85
|
+
| dude tasks | - | - | Show all issues in current project (For current sprint) |
|
71
86
|
| dude stop | - | - | Stop current time entry in Toggl |
|
72
|
-
| dude start |
|
87
|
+
| dude start | ISSUE_ID | - | Do `checkout`, `track` and `move` actions |
|
73
88
|
| dude move | ISSUE_ID | --list=NAME | Move issue to another column (Will provide options if called without --list parameter) |
|
74
89
|
| dude version | - | - | Display gem version |
|
75
90
|
|
@@ -83,4 +98,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/npupko
|
|
83
98
|
|
84
99
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
85
100
|
|
86
|
-
##
|
101
|
+
## Changelog
|
102
|
+
|
103
|
+
https://github.com/npupko/dude/blob/master/CHANGELOG.md
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'dude'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "dude"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/bin/dude
CHANGED
data/dude.gemspec
CHANGED
@@ -1,34 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
1
5
|
require_relative 'lib/dude/version'
|
2
6
|
|
3
7
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name =
|
8
|
+
spec.name = 'dude-cli'
|
5
9
|
spec.version = Dude::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
10
|
+
spec.authors = ['Nikita Pupko']
|
11
|
+
spec.email = ['work.pupko@gmail.com']
|
8
12
|
|
9
|
-
spec.summary =
|
10
|
-
spec.description =
|
11
|
-
|
12
|
-
|
13
|
+
spec.summary = 'A daily assistant in the hard work of a programmer.'
|
14
|
+
spec.description = <<~DESC
|
15
|
+
This program helps to combine such services as Jira, Toggl and git and replace most routine activities with one simple CLI utility.
|
16
|
+
DESC
|
17
|
+
spec.homepage = 'https://github.com/npupko/dude'
|
18
|
+
spec.license = 'MIT'
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
13
20
|
|
14
|
-
spec.metadata[
|
15
|
-
spec.metadata[
|
16
|
-
spec.metadata[
|
21
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
22
|
+
spec.metadata['source_code_uri'] = 'https://github.com/npupko/dude'
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/npupko/dude/blob/master/CHANGELOG.md'
|
17
24
|
|
18
|
-
spec.files =
|
19
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
end
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
26
|
|
22
|
-
spec.bindir =
|
23
|
-
spec.executables = [
|
24
|
-
spec.require_paths = [
|
27
|
+
spec.bindir = 'bin'
|
28
|
+
spec.executables = ['dude']
|
29
|
+
spec.require_paths = ['lib']
|
25
30
|
|
31
|
+
spec.add_runtime_dependency 'colorize', '~> 0.8.1'
|
26
32
|
spec.add_runtime_dependency 'dry-cli', '~> 0.6'
|
27
|
-
spec.add_runtime_dependency
|
28
|
-
spec.add_runtime_dependency
|
29
|
-
spec.add_runtime_dependency "jira-ruby", "~> 2.1"
|
33
|
+
spec.add_runtime_dependency 'faraday', '~> 1.1'
|
34
|
+
spec.add_runtime_dependency 'jira-ruby', '~> 2.1'
|
30
35
|
|
31
36
|
spec.add_development_dependency 'pry', '~> 0.14.0'
|
32
37
|
spec.add_development_dependency 'rake', '~> 13.0'
|
33
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
+
spec.add_development_dependency 'rubocop', '~> 1.12'
|
40
|
+
spec.add_development_dependency 'simplecov', '~> 0.21.2'
|
41
|
+
spec.add_development_dependency 'simplecov-cobertura', '~> 1.4'
|
34
42
|
end
|
data/lib/dude.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
|
2
|
-
require "colorize"
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require "dude/time_trackers/toggl"
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
require_relative './dude/settings'
|
6
|
+
require_relative './dude/version'
|
7
|
+
require_relative './dude/commands'
|
8
|
+
require_relative './dude/git'
|
11
9
|
|
12
10
|
module Dude
|
13
11
|
class ToBeImplementedError < StandardError; end
|
14
12
|
|
15
|
-
LIST_OF_AVAILABLE_PROJECT_MANAGEMENT_TOOLS = %w[jira]
|
13
|
+
LIST_OF_AVAILABLE_PROJECT_MANAGEMENT_TOOLS = %w[jira].freeze
|
16
14
|
end
|
data/lib/dude/commands.rb
CHANGED
@@ -1,24 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'dry/cli'
|
4
|
+
require_relative './commands/version'
|
5
|
+
require_relative './commands/tasks'
|
6
|
+
require_relative './commands/move'
|
7
|
+
require_relative './commands/checkout'
|
8
|
+
require_relative './commands/start'
|
9
|
+
require_relative './commands/track'
|
10
|
+
require_relative './commands/stop'
|
11
|
+
require_relative './commands/install'
|
10
12
|
|
11
13
|
module Dude
|
12
14
|
module Commands
|
13
15
|
extend Dry::CLI::Registry
|
14
16
|
|
15
|
-
register
|
16
|
-
register
|
17
|
-
register
|
18
|
-
register
|
19
|
-
register
|
20
|
-
register
|
21
|
-
register
|
22
|
-
register
|
17
|
+
register 'install', Dude::Commands::Install, aliases: ['install']
|
18
|
+
register 'version', Dude::Commands::Version, aliases: ['v', '-v', '--version']
|
19
|
+
register 'tasks', Dude::Commands::Tasks, aliases: ['t', '-t', '--tasks']
|
20
|
+
register 'move', Dude::Commands::Move, aliases: ['m', '-m', '--move']
|
21
|
+
register 'checkout', Dude::Commands::Checkout, aliases: ['co']
|
22
|
+
register 'track', Dude::Commands::Track, aliases: ['tr']
|
23
|
+
register 'stop', Dude::Commands::Stop
|
24
|
+
register 'start', Dude::Commands::Start, aliases: ['st']
|
23
25
|
end
|
24
26
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module Commands
|
3
5
|
class Checkout < Dry::CLI::Command
|
4
|
-
desc
|
6
|
+
desc 'Checkout to branch named as current issue'
|
5
7
|
|
6
|
-
argument :id, required: true, desc:
|
8
|
+
argument :id, required: true, desc: 'The card short ID'
|
7
9
|
|
8
10
|
def call(id:)
|
9
11
|
client = ProjectManagement::Client.new
|
@@ -1,17 +1,19 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../settings'
|
2
4
|
|
3
5
|
module Dude
|
4
6
|
module Commands
|
5
7
|
class Install < Dry::CLI::Command
|
6
|
-
desc
|
8
|
+
desc 'Creates .duderc for future configuration'
|
7
9
|
|
8
10
|
def call
|
9
11
|
path = File.join(Dir.home, Settings::CONFIG_FILE)
|
10
12
|
if File.exist?(path)
|
11
|
-
puts
|
13
|
+
puts 'Config file already exists'
|
12
14
|
else
|
13
|
-
File.open(path, 'w') {|f| f.write(duderc_file_content) }
|
14
|
-
puts
|
15
|
+
File.open(path, 'w') { |f| f.write(duderc_file_content) }
|
16
|
+
puts '.duderc created in your HOME directory'
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
data/lib/dude/commands/move.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module Commands
|
3
5
|
class Move < Dry::CLI::Command
|
4
|
-
desc
|
6
|
+
desc 'Move task between board columns'
|
5
7
|
|
6
|
-
argument :id, required: true, desc:
|
7
|
-
option :list, desc:
|
8
|
+
argument :id, required: true, desc: 'The card short ID'
|
9
|
+
option :list, desc: 'List name for moving card'
|
8
10
|
|
9
11
|
def call(id:, **options)
|
10
12
|
client = ProjectManagement::Client.new
|
data/lib/dude/commands/start.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module Commands
|
3
5
|
class Start < Dry::CLI::Command
|
4
6
|
include Settings
|
5
7
|
|
6
|
-
desc
|
8
|
+
desc 'Start task (Do checkout, track and move actions)'
|
7
9
|
|
8
|
-
argument :id, required: true, desc:
|
10
|
+
argument :id, required: true, desc: 'The card short ID'
|
9
11
|
|
10
12
|
def call(id:)
|
11
13
|
Commands::Move.new.call(id: id, list: selected_list('in_progress'))
|
data/lib/dude/commands/stop.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../time_trackers/toggl/stop_time_entry'
|
2
4
|
|
3
5
|
module Dude
|
4
6
|
module Commands
|
5
7
|
class Stop < Dry::CLI::Command
|
6
8
|
include Settings
|
7
9
|
|
8
|
-
desc
|
10
|
+
desc 'Stop current time entry in Toggl'
|
9
11
|
|
10
12
|
def call
|
11
13
|
Dude::Toggl::StopTimeEntry.new.call
|
data/lib/dude/commands/tasks.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../project_management/client'
|
2
4
|
|
3
5
|
module Dude
|
4
6
|
module Commands
|
@@ -8,8 +10,8 @@ module Dude
|
|
8
10
|
desc "Print tasks as list with ID's and assignees"
|
9
11
|
|
10
12
|
def call
|
11
|
-
tasks = Dude::ProjectManagement::Client.new.
|
12
|
-
lists = tasks.map
|
13
|
+
tasks = Dude::ProjectManagement::Client.new.fetch_current_tasks
|
14
|
+
lists = tasks.map(&:status).uniq
|
13
15
|
|
14
16
|
lists.each do |list|
|
15
17
|
puts "#{list}:".green.bold
|
@@ -24,6 +26,7 @@ module Dude
|
|
24
26
|
|
25
27
|
def printable_issue_template(issue)
|
26
28
|
return "#{issue.id.to_s.bold}: #{issue.title}" + " (#{issue.assignee})".blue if issue.assignee
|
29
|
+
|
27
30
|
"#{issue.id.to_s.bold}: #{issue.title}"
|
28
31
|
end
|
29
32
|
end
|
data/lib/dude/commands/track.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../time_trackers/toggl/start_time_entry'
|
2
4
|
|
3
5
|
module Dude
|
4
6
|
module Commands
|
5
7
|
class Track < Dry::CLI::Command
|
6
8
|
include Settings
|
7
9
|
|
8
|
-
desc
|
10
|
+
desc 'Start time entry in Toggl with issue title and id'
|
9
11
|
|
10
|
-
argument :id, required: true, desc:
|
12
|
+
argument :id, required: true, desc: 'The card short ID'
|
11
13
|
|
12
14
|
def call(id:)
|
13
15
|
@id = id
|
data/lib/dude/git.rb
CHANGED
data/lib/dude/git/checkout.rb
CHANGED
@@ -1,8 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module Git
|
3
5
|
class Checkout
|
4
6
|
def call(branch_name)
|
5
|
-
|
7
|
+
@branch_name = branch_name
|
8
|
+
branch_exists? ? checkout_on_exising_branch : checkout_and_create
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
attr_reader :branch_name
|
14
|
+
|
15
|
+
def branch_exists?
|
16
|
+
!`git show-ref refs/heads/#{branch_name}`.empty?
|
17
|
+
end
|
18
|
+
|
19
|
+
def checkout_and_create
|
20
|
+
`git checkout -b #{branch_name}`
|
21
|
+
end
|
22
|
+
|
23
|
+
def checkout_on_exising_branch
|
24
|
+
`git checkout #{branch_name}`
|
6
25
|
end
|
7
26
|
end
|
8
27
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './jira/client'
|
3
4
|
|
4
5
|
module Dude
|
5
6
|
module ProjectManagement
|
@@ -10,6 +11,7 @@ module Dude
|
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
return unless LIST_OF_AVAILABLE_PROJECT_MANAGEMENT_TOOLS.include? settings['PROJECT_MANAGEMENT_TOOL']
|
14
|
+
|
13
15
|
@client = Dude::ProjectManagement::Jira::Client.new
|
14
16
|
end
|
15
17
|
|
@@ -17,8 +19,8 @@ module Dude
|
|
17
19
|
client.respond_to_missing?(method_name, include_private)
|
18
20
|
end
|
19
21
|
|
20
|
-
def method_missing(
|
21
|
-
client.send(
|
22
|
+
def method_missing(method, *args, &block)
|
23
|
+
client.send(method, *args, &block)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module ProjectManagement
|
3
5
|
module Entities
|
4
6
|
class Issue
|
5
7
|
attr_accessor :id, :title, :description, :status, :assignee
|
6
8
|
|
7
|
-
def initialize(id
|
9
|
+
def initialize(id:, title:, description:, status:, assignee: nil)
|
8
10
|
@id = id
|
9
11
|
@title = title
|
10
12
|
@description = description
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'jira-ruby'
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
require_relative './fetch_current_tasks'
|
5
|
+
require_relative './move_task_to_list'
|
6
|
+
require_relative './get_task_name_by_id'
|
5
7
|
|
6
8
|
module Dude
|
7
9
|
module ProjectManagement
|
@@ -28,12 +30,12 @@ module Dude
|
|
28
30
|
client.respond_to_missing?(method_name, include_private)
|
29
31
|
end
|
30
32
|
|
31
|
-
def method_missing(
|
32
|
-
client.send(
|
33
|
+
def method_missing(method, *args, &block)
|
34
|
+
client.send(method, *args, &block)
|
33
35
|
end
|
34
36
|
|
35
|
-
def
|
36
|
-
|
37
|
+
def fetch_current_tasks
|
38
|
+
FetchCurrentTasks.new(client).call
|
37
39
|
end
|
38
40
|
|
39
41
|
def move_task_to_list(id, list)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../entities/issue'
|
4
|
+
|
5
|
+
module Dude
|
6
|
+
module ProjectManagement
|
7
|
+
module Jira
|
8
|
+
class FetchCurrentTasks
|
9
|
+
include Settings
|
10
|
+
|
11
|
+
def initialize(client)
|
12
|
+
@client = client
|
13
|
+
end
|
14
|
+
|
15
|
+
def call
|
16
|
+
board = client.Board.find(settings['ATLASSIAN_BOARD_ID'])
|
17
|
+
|
18
|
+
all_issues = board_type(board)
|
19
|
+
|
20
|
+
all_issues.map { |issue| create_issue(issue) }
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
attr_reader :client
|
26
|
+
|
27
|
+
def board_type(board)
|
28
|
+
case board.type
|
29
|
+
when 'kanban' then board.issues
|
30
|
+
when 'simple', 'scrum' then board.sprints(state: 'active').flat_map(&:issues)
|
31
|
+
else raise Dude::ToBeImplementedError
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_issue(issue)
|
36
|
+
Entities::Issue.new(
|
37
|
+
id: issue.key,
|
38
|
+
title: issue.summary,
|
39
|
+
description: issue.description,
|
40
|
+
status: issue.status.name,
|
41
|
+
assignee: issue&.assignee&.displayName
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Dude
|
4
4
|
module ProjectManagement
|
@@ -14,33 +14,35 @@ module Dude
|
|
14
14
|
|
15
15
|
def call
|
16
16
|
issue = client.Issue.find(id)
|
17
|
-
available_transitions = client.Transition.all(:
|
17
|
+
available_transitions = client.Transition.all(issue: issue)
|
18
|
+
transition_id = generate_transition_id(issue, available_transitions)
|
19
|
+
transition = issue.transitions.build
|
20
|
+
transition.save!(transition: { id: transition_id })
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
attr_reader :client, :id, :list_name
|
18
26
|
|
19
|
-
|
27
|
+
def generate_transition_id(issue, available_transitions)
|
28
|
+
if list_name
|
20
29
|
available_transitions.find { |transition| transition.name == list_name }.id
|
21
30
|
else
|
22
31
|
select_list_for_moving(issue, available_transitions).id
|
23
32
|
end
|
24
|
-
|
25
|
-
transition = issue.transitions.build
|
26
|
-
transition.save!(transition: { id: transition_id })
|
27
33
|
end
|
28
34
|
|
29
|
-
|
30
|
-
|
31
|
-
def select_list_for_moving(issuem, available_transitions)
|
32
|
-
puts "Please, select list for moving:".green.bold
|
35
|
+
def select_list_for_moving(_issue, available_transitions)
|
36
|
+
puts 'Please, select list for moving:'.green.bold
|
33
37
|
|
34
38
|
available_transitions.each_with_index do |ea, index|
|
35
39
|
puts "#{index + 1}: #{ea.name.bold}"
|
36
40
|
end
|
37
41
|
|
38
42
|
print "\nList index: ".bold
|
39
|
-
list_index =
|
43
|
+
list_index = $stdin.gets.chomp
|
40
44
|
available_transitions[list_index.to_i - 1]
|
41
45
|
end
|
42
|
-
|
43
|
-
attr_reader :client, :id, :list_name
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
data/lib/dude/settings.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dude
|
2
4
|
module Settings
|
3
5
|
CONFIG_FILE = '.duderc'
|
@@ -5,6 +7,7 @@ module Dude
|
|
5
7
|
def settings
|
6
8
|
@settings ||= read(file).strip.split("\n").map do |line|
|
7
9
|
next if line =~ /^#/ || line.empty?
|
10
|
+
|
8
11
|
line.split('=').map(&:strip)
|
9
12
|
end.compact.to_h
|
10
13
|
end
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './base'
|
2
4
|
|
3
5
|
module Dude
|
4
6
|
module Toggl
|
5
7
|
class StartTimeEntry < Dude::Toggl::Base
|
6
|
-
|
7
8
|
def call(task_title:, project:)
|
8
9
|
@task_title = task_title
|
9
10
|
@project = project
|
data/lib/dude/version.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dude-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
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-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: colorize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: dry-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '1.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '1.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: jira-ruby
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,8 +108,52 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.0'
|
111
|
-
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.12'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.12'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.21.2
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.21.2
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov-cobertura
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.4'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.4'
|
153
|
+
description: 'This program helps to combine such services as Jira, Toggl and git and
|
112
154
|
replace most routine activities with one simple CLI utility.
|
155
|
+
|
156
|
+
'
|
113
157
|
email:
|
114
158
|
- work.pupko@gmail.com
|
115
159
|
executables:
|
@@ -118,12 +162,15 @@ extensions: []
|
|
118
162
|
extra_rdoc_files: []
|
119
163
|
files:
|
120
164
|
- ".github/dependabot.yml"
|
165
|
+
- ".github/workflows/verify.yml"
|
121
166
|
- ".gitignore"
|
122
167
|
- ".rspec"
|
168
|
+
- ".rubocop.yml"
|
123
169
|
- ".travis.yml"
|
124
170
|
- CHANGELOG.md
|
125
171
|
- Gemfile
|
126
172
|
- Gemfile.lock
|
173
|
+
- LICENCE
|
127
174
|
- README.md
|
128
175
|
- Rakefile
|
129
176
|
- bin/console
|
@@ -148,15 +195,9 @@ files:
|
|
148
195
|
- lib/dude/project_management/entities/issue.rb
|
149
196
|
- lib/dude/project_management/jira.rb
|
150
197
|
- lib/dude/project_management/jira/client.rb
|
151
|
-
- lib/dude/project_management/jira/
|
198
|
+
- lib/dude/project_management/jira/fetch_current_tasks.rb
|
152
199
|
- lib/dude/project_management/jira/get_task_name_by_id.rb
|
153
200
|
- lib/dude/project_management/jira/move_task_to_list.rb
|
154
|
-
- lib/dude/project_management/trello.rb
|
155
|
-
- lib/dude/project_management/trello/checkout.rb
|
156
|
-
- lib/dude/project_management/trello/client.rb
|
157
|
-
- lib/dude/project_management/trello/get_current_tasks.rb
|
158
|
-
- lib/dude/project_management/trello/get_lists.rb
|
159
|
-
- lib/dude/project_management/trello/move_tasks_to_list.rb
|
160
201
|
- lib/dude/settings.rb
|
161
202
|
- lib/dude/time_trackers/toggl.rb
|
162
203
|
- lib/dude/time_trackers/toggl/base.rb
|
@@ -164,7 +205,8 @@ files:
|
|
164
205
|
- lib/dude/time_trackers/toggl/stop_time_entry.rb
|
165
206
|
- lib/dude/version.rb
|
166
207
|
homepage: https://github.com/npupko/dude
|
167
|
-
licenses:
|
208
|
+
licenses:
|
209
|
+
- MIT
|
168
210
|
metadata:
|
169
211
|
homepage_uri: https://github.com/npupko/dude
|
170
212
|
source_code_uri: https://github.com/npupko/dude
|
@@ -177,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
219
|
requirements:
|
178
220
|
- - ">="
|
179
221
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.
|
222
|
+
version: 2.5.0
|
181
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
224
|
requirements:
|
183
225
|
- - ">="
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'dude/project_management/entities/issue'
|
2
|
-
require 'dude/project_management/jira/client'
|
3
|
-
|
4
|
-
module Dude
|
5
|
-
module ProjectManagement
|
6
|
-
module Jira
|
7
|
-
class GetCurrentTasks
|
8
|
-
include Settings
|
9
|
-
|
10
|
-
def initialize(client)
|
11
|
-
@client = client
|
12
|
-
end
|
13
|
-
|
14
|
-
def call
|
15
|
-
board = client.Board.find(settings['ATLASSIAN_BOARD_ID'])
|
16
|
-
|
17
|
-
all_issues = case board.type
|
18
|
-
when 'kanban' then board.issues
|
19
|
-
when 'simple', 'scrum' then board.sprints(state: 'active').flat_map { |sprint| sprint.issues }
|
20
|
-
else raise Dude::ToBeImplementedError
|
21
|
-
end
|
22
|
-
|
23
|
-
all_issues.map do |issue|
|
24
|
-
Entities::Issue.new({
|
25
|
-
id: issue.key,
|
26
|
-
title: issue.summary,
|
27
|
-
description: issue.description,
|
28
|
-
status: issue.status.name,
|
29
|
-
assignee: issue&.assignee&.displayName
|
30
|
-
})
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
attr_reader :client
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
|
3
|
-
require 'faraday'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
module Dude
|
7
|
-
module Trello
|
8
|
-
class Client
|
9
|
-
private
|
10
|
-
|
11
|
-
def faraday_client
|
12
|
-
@faraday_client ||= Faraday.new('https://api.trello.com/', {
|
13
|
-
params: {
|
14
|
-
key: "62b20e9eeab2d6e06145c69178521225",
|
15
|
-
token: "6285fc2d2ff6100a5c341838d0e4acfed3601ae503beb973ddccf1cfab088537"
|
16
|
-
}
|
17
|
-
})
|
18
|
-
end
|
19
|
-
|
20
|
-
def method_missing(method, *args, &block)
|
21
|
-
faraday_client.send(method, *args, &block)
|
22
|
-
end
|
23
|
-
|
24
|
-
def get_current_tasks
|
25
|
-
GetCurrentTasks.new(client).call
|
26
|
-
end
|
27
|
-
|
28
|
-
def move_task_to_list(id, list)
|
29
|
-
MoveTasksToList.new(client, id: id, list_name: list).call
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
module Dude
|
3
|
-
module ProjectManagement
|
4
|
-
module Trello
|
5
|
-
class GetCurrentTasks
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
client = Trello::Client.new
|
9
|
-
|
10
|
-
response = client.get("/1/lists/#{TODO_LIST_ID}/cards", { fields: 'name,idShort' })
|
11
|
-
|
12
|
-
body = JSON.parse(response.body)
|
13
|
-
|
14
|
-
puts "To Do list\n".green.bold
|
15
|
-
|
16
|
-
body.map do |issue|
|
17
|
-
binding.pry
|
18
|
-
Entities::Issue.new(id: card['idShort'], title: card['name'], description: issue.description, status: issue.status.name)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
module Dude
|
3
|
-
module Trello
|
4
|
-
class GetLists < Dry::CLI::Command
|
5
|
-
desc "Get board lists"
|
6
|
-
|
7
|
-
def call
|
8
|
-
client = Trello::Client.new
|
9
|
-
response = client.get "/1/boards/#{BOARD_ID}/lists"
|
10
|
-
body = JSON.parse(response.body)
|
11
|
-
puts body
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
module Dude
|
3
|
-
module Trello
|
4
|
-
class MoveTasksToList < Dry::CLI::Command
|
5
|
-
desc "Get board lists"
|
6
|
-
|
7
|
-
def call
|
8
|
-
# response = client.get("/1/boards/#{BOARD_ID}/cards/#{id}", { fields: 'id' })
|
9
|
-
# card_id = JSON.parse(response.body).dig('id')
|
10
|
-
# client.put("/1/cards/#{card_id}", { idList: selected_list(list) })
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|