dude-cli 1.0.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -2
  3. data/.travis.yml +4 -3
  4. data/CHANGELOG.md +25 -0
  5. data/Gemfile +3 -2
  6. data/Gemfile.lock +55 -54
  7. data/README.md +41 -25
  8. data/bin/dude +3 -2
  9. data/dude.gemspec +16 -16
  10. data/lib/dude.rb +14 -0
  11. data/lib/dude/commands.rb +24 -0
  12. data/lib/dude/commands/checkout.rb +21 -0
  13. data/lib/dude/commands/install.rb +57 -0
  14. data/lib/dude/commands/move.rb +15 -0
  15. data/lib/dude/commands/start.rb +29 -0
  16. data/lib/dude/commands/stop.rb +15 -0
  17. data/lib/dude/commands/tasks.rb +31 -0
  18. data/lib/dude/commands/track.rb +28 -0
  19. data/lib/dude/commands/version.rb +11 -0
  20. data/lib/dude/git.rb +5 -0
  21. data/lib/dude/git/checkout.rb +2 -16
  22. data/lib/dude/git/current_branch_name.rb +1 -2
  23. data/lib/dude/project_management/client.rb +25 -0
  24. data/lib/dude/project_management/entities/board.rb +9 -0
  25. data/lib/dude/project_management/entities/issue.rb +37 -0
  26. data/lib/dude/project_management/jira.rb +9 -0
  27. data/lib/dude/project_management/jira/client.rb +49 -0
  28. data/lib/dude/project_management/jira/get_current_tasks.rb +40 -0
  29. data/lib/dude/project_management/jira/get_task_name_by_id.rb +24 -0
  30. data/lib/dude/project_management/jira/move_task_to_list.rb +47 -0
  31. data/lib/dude/project_management/trello.rb +6 -0
  32. data/lib/dude/project_management/trello/checkout.rb +4 -0
  33. data/lib/dude/project_management/trello/client.rb +33 -0
  34. data/lib/dude/project_management/trello/get_current_tasks.rb +24 -0
  35. data/lib/dude/project_management/trello/get_lists.rb +15 -0
  36. data/lib/dude/project_management/trello/move_tasks_to_list.rb +14 -0
  37. data/lib/dude/settings.rb +6 -2
  38. data/lib/dude/time_trackers/toggl.rb +5 -0
  39. data/lib/dude/time_trackers/toggl/base.rb +18 -0
  40. data/lib/dude/{toggl → time_trackers/toggl}/start_time_entry.rb +14 -8
  41. data/lib/dude/{toggl → time_trackers/toggl}/stop_time_entry.rb +4 -2
  42. data/lib/dude/version.rb +1 -1
  43. metadata +56 -103
  44. data/.ruby-version +0 -1
  45. data/LICENSE.txt +0 -21
  46. data/lib/dude/cli.rb +0 -156
  47. data/lib/dude/gitlab/add_spend_time.rb +0 -36
  48. data/lib/dude/gitlab/base.rb +0 -38
  49. data/lib/dude/gitlab/count_spend_time.rb +0 -13
  50. data/lib/dude/gitlab/estimate.rb +0 -20
  51. data/lib/dude/gitlab/get_issue_info.rb +0 -9
  52. data/lib/dude/gitlab/get_issue_time_spent.rb +0 -9
  53. data/lib/dude/gitlab/get_issue_title.rb +0 -14
  54. data/lib/dude/gitlab/get_my_issues.rb +0 -31
  55. data/lib/dude/gitlab/move_issue.rb +0 -37
  56. data/lib/dude/interface.rb +0 -98
  57. data/lib/dude/report.rb +0 -38
  58. data/lib/dude/service.rb +0 -18
  59. data/lib/dude/toggl.rb +0 -40
  60. data/lib/dude/toggl/base.rb +0 -36
  61. data/lib/dude/toggl/issue_spend_time.rb +0 -56
  62. data/lib/dude/toggl/report.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb7926440f3431ebb117b8b77a91d30761182f9de66f579231344bda39c44c46
4
- data.tar.gz: 1f00f5f11ab2a692e54b91c9d24859b1f099e6bc1321b5510e2368d9b3fdf25a
3
+ metadata.gz: a79bc51f94b638cd5924d001d4846754aa62665ae427b2ddd323ec880e1bd4bc
4
+ data.tar.gz: 9ace665f11e4338894ae466d921d8179363e6f13183848b5d56d905579700875
5
5
  SHA512:
6
- metadata.gz: 508caccdec86a0dc90ae30a46ca91cf751b7a441bc587862be44859d3ea82074de7716faea229e3970242e8cdf447a7f8fce8f39b8c59571dc22eafe1b41cfbb
7
- data.tar.gz: 8991faf2d8cea44b026d365ed6e05eec3f85aeb2749f6ce060f6e02381aa032713ebdc28eec7d08fc07cb7755b0f08d36717e54caaae37f2090d455f3758e963
6
+ metadata.gz: 9f141f3ef3e34cc3da6cebe73feceb9f01077870228b8f311974be21c94bfed1244a6cde8d030a451baa4a96f6fda1ca0d26592b56b9b441ae8c90cd8a53ee28
7
+ data.tar.gz: b3006b12eadb6b57349d36a3e8be818ff5f0e2103cf3ba5c7f5b408ac7de781d3d4fff71635910b8bcbc3f924a62cc022c8746ea1259b070f65ef8c913411ca6
data/.gitignore CHANGED
@@ -6,8 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- .byebug_history
10
9
 
11
10
  # rspec failure tracking
12
11
  .rspec_status
13
- .ruby-gemset
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
- sudo: false
1
+ ---
2
2
  language: ruby
3
+ cache: bundler
3
4
  rvm:
4
- - 2.4.0
5
- before_install: gem install bundler -v 1.16.0
5
+ - 2.7.2
6
+ before_install: gem install bundler -v 2.1.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Added
6
+
7
+ - Added Trello support
8
+
9
+ ## [2.0.0] - 2021-03-10
10
+
11
+ ### Added
12
+
13
+ - Basic commands for project management
14
+ - Jira support
15
+ - Toggl support
16
+
17
+ ### Changed
18
+
19
+ - Removed stats
20
+ - Removed estimates
21
+ - Removed GitLab support
22
+ - Removed automatic project detection based on folder name. Replaced with .duderc setting
23
+
24
+ [2.0.0]: https://github.com/npupko/dude/releases/tag/2.0.0
25
+ [1.0.2]: https://github.com/npupko/dude/releases/tag/1.0.2
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
3
  # Specify your gem's dependencies in dude.gemspec
6
4
  gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
data/Gemfile.lock CHANGED
@@ -1,73 +1,74 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dude-cli (1.0.1)
5
- colorize (~> 0.8)
6
- git (~> 1.3)
7
- gitlab (~> 4.3)
8
- rest-client (~> 2.0)
9
- thor (~> 0.20)
4
+ dude-cli (2.0.0)
5
+ colorize (~> 0.8.1)
6
+ dry-cli (>= 0.6)
7
+ faraday (~> 1.1)
8
+ jira-ruby (~> 2.1)
10
9
 
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- coderay (1.1.2)
13
+ activesupport (6.1.1)
14
+ concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ zeitwerk (~> 2.3)
19
+ atlassian-jwt (0.2.0)
20
+ jwt (~> 2.1.0)
21
+ coderay (1.1.3)
15
22
  colorize (0.8.1)
16
- diff-lcs (1.3)
17
- domain_name (0.5.20180417)
18
- unf (>= 0.0.5, < 1.0.0)
19
- git (1.4.0)
20
- gitlab (4.4.0)
21
- httparty (>= 0.14.0)
22
- terminal-table (>= 1.5.1)
23
- http-cookie (1.0.3)
24
- domain_name (~> 0.5)
25
- httparty (0.16.2)
26
- multi_xml (>= 0.5.2)
27
- method_source (0.9.0)
28
- mime-types (3.1)
29
- mime-types-data (~> 3.2015)
30
- mime-types-data (3.2016.0521)
31
- multi_xml (0.6.0)
32
- netrc (0.11.0)
33
- pry (0.11.3)
34
- coderay (~> 1.1.0)
35
- method_source (~> 0.9.0)
36
- rake (10.0.4)
37
- rest-client (2.0.2)
38
- http-cookie (>= 1.0.2, < 2.0)
39
- mime-types (>= 1.16, < 4.0)
40
- netrc (~> 0.8)
41
- rspec (3.7.0)
42
- rspec-core (~> 3.7.0)
43
- rspec-expectations (~> 3.7.0)
44
- rspec-mocks (~> 3.7.0)
45
- rspec-core (3.7.0)
46
- rspec-support (~> 3.7.0)
47
- rspec-expectations (3.7.0)
23
+ concurrent-ruby (1.1.7)
24
+ diff-lcs (1.4.4)
25
+ dry-cli (0.6.0)
26
+ concurrent-ruby (~> 1.0)
27
+ faraday (1.1.0)
28
+ multipart-post (>= 1.2, < 3)
29
+ ruby2_keywords
30
+ i18n (1.8.7)
31
+ concurrent-ruby (~> 1.0)
32
+ jira-ruby (2.1.4)
33
+ activesupport
34
+ atlassian-jwt
35
+ multipart-post
36
+ oauth (~> 0.5, >= 0.5.0)
37
+ jwt (2.1.0)
38
+ method_source (1.0.0)
39
+ minitest (5.14.3)
40
+ multipart-post (2.1.1)
41
+ oauth (0.5.4)
42
+ pry (0.13.1)
43
+ coderay (~> 1.1)
44
+ method_source (~> 1.0)
45
+ rake (12.3.3)
46
+ rspec (3.10.0)
47
+ rspec-core (~> 3.10.0)
48
+ rspec-expectations (~> 3.10.0)
49
+ rspec-mocks (~> 3.10.0)
50
+ rspec-core (3.10.0)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-expectations (3.10.0)
48
53
  diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.7.0)
50
- rspec-mocks (3.7.0)
54
+ rspec-support (~> 3.10.0)
55
+ rspec-mocks (3.10.0)
51
56
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.7.0)
53
- rspec-support (3.7.0)
54
- terminal-table (1.8.0)
55
- unicode-display_width (~> 1.1, >= 1.1.1)
56
- thor (0.20.0)
57
- unf (0.1.4)
58
- unf_ext
59
- unf_ext (0.0.7.5)
60
- unicode-display_width (1.4.0)
57
+ rspec-support (~> 3.10.0)
58
+ rspec-support (3.10.0)
59
+ ruby2_keywords (0.0.2)
60
+ tzinfo (2.0.4)
61
+ concurrent-ruby (~> 1.0)
62
+ zeitwerk (2.4.2)
61
63
 
62
64
  PLATFORMS
63
65
  ruby
64
66
 
65
67
  DEPENDENCIES
66
- bundler (~> 1.16)
67
68
  dude-cli!
68
- pry (~> 0.11.3)
69
- rake (~> 10.0)
69
+ pry (~> 0.13.1)
70
+ rake (~> 12.0)
70
71
  rspec (~> 3.0)
71
72
 
72
73
  BUNDLED WITH
73
- 1.16.3
74
+ 2.1.4
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A daily assistant in the hard work of a programmer
4
4
 
5
- This program helps to combine such services as [Gitlab](https://gitlab.com), [Toggl](https://toggl.com) and replace most routine activities with one simple CLI utility.
5
+ This program helps to combine such services as [Jira](https://atlassian.net), [Toggl](https://toggl.com) and replace most routine activities with one simple CLI utility.
6
6
 
7
7
  ## Installation
8
8
 
@@ -26,45 +26,61 @@ After that create .duderc file in your HOME directory by command:
26
26
 
27
27
  And configure all variables in this file
28
28
 
29
- `TOGGL_EMAIL` - Your email, registered in Toggl
29
+ `PROJECT_MANAGEMENT_TOOL=jira` - Project management (Now only Jira supported)
30
+ `ATLASSIAN_EMAIL` - Your Jira email
30
31
 
31
- `TOGGL_TOKEN=` - Your Toggl [token](https://toggl.com/app/profile)
32
+ `ATLASSIAN_TOKEN` - How to create Atlassian token: https://support.siteimprove.com/hc/en-gb/articles/360004317332-How-to-create-an-API-token-from-your-Atlassian-account
32
33
 
33
- `TOGGL_WORKSPACE_ID` - Your Toggl Workspace ID (You can find it in Toggl [team](https://toggl.com/app/team) or [projects](https://toggl.com/app/projects/) url)
34
+ `ATLASSIAN_URL` - URL of your project. Example: https://example.atlassian.net
34
35
 
35
- `GITLAB_ENDPOINT=https://gitlab.yoursite.com/api/v4/` - Change yoursite.com to your site
36
+ `ATLASSIAN_PROJECT_KEY` - KEY of your project. If your issues have id BT-123 - BT is the key
36
37
 
37
- `GITLAB_TOKEN=imyiKqwsQBbn1zCMY2PJ` - Your Gitlab token (<https://gitlab.yoursite.com/profile/personal_access_tokens>)
38
+ `ATLASSIAN_BOARD_ID`:
39
+ Just open your atlassian main board and copy id from the url after rapidView=*ID* part.
38
40
 
39
- `HOURS_PER_DAY=8` - Working hours per day
41
+ Example: https://dealmakerns.atlassian.net/secure/RapidBoard.jspa?rapidView=23&projectKey=DT - 23 is the id
40
42
 
41
- `HOURS_PER_WEEK=40` - Working hours per week
42
43
 
43
- ## Usage
44
+ #### Replace it with your project list names. Skip for empty lists
45
+
46
+ ```
47
+ TODO_LIST_NAME=To Do
48
+ IN_PROGRESS_LIST_NAME=In Progress
49
+ CODE_REVIEW_LIST_NAME=Code Review
50
+ TESTING_LIST_NAME=TESTABLE
51
+ DONE_LIST_NAME=Done
52
+ ```
44
53
 
45
- | Command | Required parameters | Optional parameters | Description |
46
- |---------------|:-------------------:|:-------------------------------:|------------------------------------------------------------|
47
- | dude install | - | - | Create .duderc file in your home directory |
48
- | dude checkout | issue_id | project_title<sup>1</sup> | Checkout to branch with name "ID-issue-title" |
49
- | dude track | issue_id | project_title<sup>1</sup> | Start time entry in Toggl with issue project, title and id |
50
- | dude tasks | - | project_title<sup>1</sup> | Show issues in current project assigned to you |
51
- | dude estimate | duration | issue_id<sup>2</sup>, project_title<sup>1</sup> | Estimate time for issue |
52
- | dude stop | - | project_title<sup>1</sup> | Stop current time entry in Toggl, move issue to `To Do` |
53
- | dude stats | - | - | Display your daily and weekly stats from Toggl |
54
- | dude start | issue_id | project_title<sup>1</sup> | Do `checkout`, `track` and `move` actions |
55
- | dude move | label | issue_id<sup>2</sup>, project_title<sup>1</sup> | Move issue to another column |
56
- | dude version | - | - | Display gem version |
54
+ `TOGGL_PROJECT_NAME` - Your Toggl project name
57
55
 
58
- You also can use `dude help` for short description of every command.
56
+ `TOGGL_TOKEN` - Your Toggl API token can be found at the bottom of the page: https://track.toggl.com/profile
59
57
 
60
- <sup>1</sup>: You can not specify a `project_title` if the project folder name matches its name<br>
61
- <sup>2</sup>: You can not specify `issue_id` if the correct name for the git branch is specified
58
+ `TOGGL_WORKSPACE_ID` - Can be copied from url here: https://toggl.com/app/projects/. Example: 123456
62
59
 
60
+ #### Use the *id* and *title* and specify format for the task titles in Trello or keep it as it is
61
+ `TOGGL_TASK_FORMAT=[id] title`
62
+
63
+ ## Usage
64
+
65
+ | Command | Required parameters | Optional parameters | Description |
66
+ |:-------------:|:-------------------|:-------------------|:--------------------------------------------------------------------------------------|
67
+ | dude install | - | - | Create .duderc file in your home directory |
68
+ | dude checkout | ISSUE_ID | - | Checkout to branch with name "ID-issue-title" |
69
+ | dude track | ISSUE_ID | - | Start time entry in Toggl with issue project, title and id |
70
+ | dude tasks | ISSUE_ID | - | Show all issues in current project (For current sprint) |
71
+ | dude stop | - | - | Stop current time entry in Toggl |
72
+ | dude start | - | - | Do `checkout`, `track` and `move` actions |
73
+ | dude move | ISSUE_ID | --list=NAME | Move issue to another column (Will provide options if called without --list parameter) |
74
+ | dude version | - | - | Display gem version |
75
+
76
+ You also can use `dude help` for short description of every command.
63
77
 
64
78
  ## Contributing
65
79
 
66
- Bug reports and pull requests are welcome on GitHub at https://github.com/Random4405/dude.
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/npupko/dude.
67
81
 
68
82
  ## License
69
83
 
70
84
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
85
+
86
+ ## [Changelog](https://github.com/npupko/dude/CHANGELOG.md)
data/bin/dude CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "dude/cli"
3
+ require "bundler/setup"
4
+ require "dude"
4
5
 
5
- Dude::CLI.start
6
+ Dry::CLI.new(Dude::Commands).call
data/dude.gemspec CHANGED
@@ -1,32 +1,32 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "dude/version"
1
+ require_relative 'lib/dude/version'
4
2
 
5
3
  Gem::Specification.new do |spec|
6
4
  spec.name = "dude-cli"
7
5
  spec.version = Dude::VERSION
8
6
  spec.authors = ["Nikita Pupko"]
9
7
  spec.email = ["work.pupko@gmail.com"]
8
+
10
9
  spec.summary = %q{A daily assistant in the hard work of a programmer.}
11
10
  spec.description = %q{This program helps to combine such services as Gitlab, Toggl and git and replace most routine activities with one simple CLI utility.}
12
11
  spec.homepage = "https://github.com/npupko/dude"
13
- spec.license = "MIT"
14
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
15
- f.match(%r{^(test|spec|features)/})
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = "https://github.com/npupko/dude"
16
+ spec.metadata["changelog_uri"] = "https://github.com/npupko/dude/blob/master/CHANGELOG.md"
17
+
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
20
  end
21
+
17
22
  spec.bindir = "bin"
18
23
  spec.executables = ["dude"]
19
24
  spec.require_paths = ["lib"]
20
- spec.required_ruby_version = '>= 2.2.0'
21
25
 
22
- spec.add_development_dependency "bundler", "~> 1.16"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "pry", "~> 0.11.3"
25
- spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_runtime_dependency 'dry-cli', '>= 0.6'
27
+ spec.add_runtime_dependency "faraday", "~> 1.1"
28
+ spec.add_runtime_dependency "colorize", "~> 0.8.1"
29
+ spec.add_runtime_dependency "jira-ruby", "~> 2.1"
26
30
 
27
- spec.add_runtime_dependency "thor", "~> 0.20"
28
- spec.add_runtime_dependency "colorize", "~> 0.8"
29
- spec.add_runtime_dependency "gitlab", "~> 4.3"
30
- spec.add_runtime_dependency "git", "~> 1.3"
31
- spec.add_runtime_dependency "rest-client", "~> 2.0"
31
+ spec.add_development_dependency 'pry', '~> 0.13.1'
32
32
  end
data/lib/dude.rb CHANGED
@@ -1,2 +1,16 @@
1
+ require "pry"
2
+ require "colorize"
3
+
4
+ require "dude/settings"
5
+ require "dude/version"
6
+ require "dude/commands"
7
+ require "dude/git"
8
+ require "dude/project_management/trello"
9
+ require "dude/project_management/jira"
10
+ require "dude/time_trackers/toggl"
11
+
1
12
  module Dude
13
+ class ToBeImplementedError < StandardError; end
14
+
15
+ LIST_OF_AVAILABLE_PROJECT_MANAGEMENT_TOOLS = %w[jira]
2
16
  end
@@ -0,0 +1,24 @@
1
+ require "dry/cli"
2
+ require_relative "./commands/version"
3
+ require_relative "./commands/tasks"
4
+ require_relative "./commands/move"
5
+ require_relative "./commands/checkout"
6
+ require_relative "./commands/start"
7
+ require_relative "./commands/track"
8
+ require_relative "./commands/stop"
9
+ require_relative "./commands/install"
10
+
11
+ module Dude
12
+ module Commands
13
+ extend Dry::CLI::Registry
14
+
15
+ register "install", Dude::Commands::Install, aliases: ["install"]
16
+ register "version", Dude::Commands::Version, aliases: ["v", "-v", "--version"]
17
+ register "tasks", Dude::Commands::Tasks, aliases: ["t", "-t", "--tasks"]
18
+ register "move", Dude::Commands::Move, aliases: ["m", "-m", "--move"]
19
+ register "checkout", Dude::Commands::Checkout, aliases: ["co"]
20
+ register "track", Dude::Commands::Track, aliases: ["tr"]
21
+ register "stop", Dude::Commands::Stop
22
+ register "start", Dude::Commands::Start, aliases: ["st"]
23
+ end
24
+ end
@@ -0,0 +1,21 @@
1
+ module Dude
2
+ module Commands
3
+ class Checkout < Dry::CLI::Command
4
+ desc "Checkout to branch named as current issue"
5
+
6
+ argument :id, required: true, desc: "The card short ID"
7
+
8
+ def call(id:)
9
+ client = ProjectManagement::Client.new
10
+ issue_title = client.get_task_name_by_id(id)
11
+ Dude::Git::Checkout.new.call(branch_name(issue_title, id))
12
+ end
13
+
14
+ private
15
+
16
+ def branch_name(issue_title, id)
17
+ issue_title.downcase.gsub(/[^a-z0-9\-_]+/, '-').prepend("#{id}-")
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,57 @@
1
+ require 'dude/settings'
2
+
3
+ module Dude
4
+ module Commands
5
+ class Install < Dry::CLI::Command
6
+ desc "Creates .duderc for future configuration"
7
+
8
+ def call
9
+ path = File.join(Dir.home, Settings::CONFIG_FILE)
10
+ if File.exist?(path)
11
+ puts "Config file already exists"
12
+ else
13
+ File.open(path, 'w') {|f| f.write(duderc_file_content) }
14
+ puts ".duderc created in your HOME directory"
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def duderc_file_content
21
+ <<~HEREDOC
22
+ # Please, don't use quotes and spaces.
23
+ # Write all variables using following format: NAME=VALUE
24
+ #
25
+ # Now jira only (Github, Gitlab, Trello later)
26
+ PROJECT_MANAGEMENT_TOOL=jira
27
+ ATLASSIAN_EMAIL=
28
+ # How to create Atlassian token: https://support.siteimprove.com/hc/en-gb/articles/360004317332-How-to-create-an-API-token-from-your-Atlassian-account
29
+ ATLASSIAN_TOKEN=
30
+ # URL of your project. Example: https://example.atlassian.net
31
+ ATLASSIAN_URL=
32
+ # KEY of your project. If your issues have id BT-123 - BT is the key
33
+ ATLASSIAN_PROJECT_KEY=
34
+ # Just open your atlassian main board and copy id from the url after rapidView=*ID* part.
35
+ # Example: https://dealmakerns.atlassian.net/secure/RapidBoard.jspa?rapidView=23&projectKey=DT - 23 is the id
36
+ ATLASSIAN_BOARD_ID=
37
+
38
+ # Replace it with your project list names. Skip for empty lists
39
+ TODO_LIST_NAME=To Do
40
+ IN_PROGRESS_LIST_NAME=In Progress
41
+ CODE_REVIEW_LIST_NAME=Code Review
42
+ TESTING_LIST_NAME=TESTABLE
43
+ DONE_LIST_NAME=Done
44
+
45
+ # Your Toggl project name
46
+ TOGGL_PROJECT_NAME=
47
+ # Your Toggl API token can be found at the bottom of the page: https://track.toggl.com/profile
48
+ TOGGL_TOKEN=
49
+ # Can be copied from url here: https://toggl.com/app/projects/. Example: 123456
50
+ TOGGL_WORKSPACE_ID=
51
+ # Use the *id* and *title* and specify format for the task titles in Trello or keep it as it is
52
+ TOGGL_TASK_FORMAT=[id] title
53
+ HEREDOC
54
+ end
55
+ end
56
+ end
57
+ end