agile-cli 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/.config.json +1 -1
- data/lib/agile.rb +2 -0
- data/lib/agile/assets/definition_of_done.txt +6 -0
- data/lib/agile/assets/definition_of_ready.txt +7 -9
- data/lib/agile/commands/dod.rb +13 -0
- data/lib/agile/commands/dor.rb +5 -2
- data/lib/agile/commands/init.rb +3 -12
- data/lib/agile/commands/login.rb +6 -9
- data/lib/agile/commands/projects.rb +39 -18
- data/lib/agile/constants.rb +1 -1
- data/spec/agile/dod_spec.rb +26 -0
- data/spec/agile/dor_spec.rb +9 -11
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8343b20f864b9087c903e2bdf4a0c7dbc879dbd0675e98918c235d4fa88b18ef
|
4
|
+
data.tar.gz: 07bdd7283c5ec3f56f6b6556da4aa27df85a88cf08dd69e907ab0103ce32eb80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5714b3d98508a8a58c8c255d3e0e7ece917eb2f1b793c458dd864b92ee1ba01c46d9181d3a2b94888ab2c083beeaf7dd16af81d16370af0b21f7e7cee4009abb
|
7
|
+
data.tar.gz: 5d94825a5ce075551dbdd5691813ffd15549cc17a45d0440a1216e483ca4506805f8147ca2f27397cbb32df8dd7662261dc844208614bb97032adbc1c3b26155
|
data/Gemfile.lock
CHANGED
data/lib/.config.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"current_remote":"
|
1
|
+
{"current_remote":"localhost:3000","current_user":"nieisnuje","current_project":"AgileCli"}
|
data/lib/agile.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
Definition of Ready
|
2
|
-
|
3
1
|
All work should have a related Ticket.
|
4
2
|
Developer should not start development unless a Ticket is "Ready for development"
|
5
3
|
We consider a Ticket "Ready for development" if it meets following requirements:
|
6
4
|
|
7
5
|
Ticket Requirements must have:
|
8
6
|
|
9
|
-
Ticket should have a short title
|
10
|
-
Ticket should have a clear description
|
11
|
-
Description should including "How to demo" section
|
12
|
-
Description may have "Acceptance Criteria" section which includes all important(specific) requirements
|
13
|
-
All
|
14
|
-
Ticket can reasonably be "Done" within the Sprint time-box
|
15
|
-
Ticket should have
|
7
|
+
1. Ticket should have a short title
|
8
|
+
2. Ticket should have a clear description
|
9
|
+
3. Description should including "How to demo" section
|
10
|
+
4. Description may have "Acceptance Criteria" section which includes all important(specific) requirements
|
11
|
+
5. All Blocker should be resolved
|
12
|
+
6. Ticket can reasonably be "Done" within the Sprint time-box
|
13
|
+
7. Ticket should have Estimation
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# rubocop:disable Naming/MethodName
|
2
|
+
# :reek:UncommunicativeMethodName
|
3
|
+
module Agile
|
4
|
+
class CLI < Thor
|
5
|
+
desc Rainbow("DoD").cornflower, Rainbow("Shows you rules of display done tasks").darkgoldenrod
|
6
|
+
def DoD
|
7
|
+
dod = []
|
8
|
+
dod << File.read("#{GEM_PATH}/agile/assets/definition_of_done.txt")
|
9
|
+
say Terminal::Table.new title: "Definition of Done", rows: [dod], style: TERMINAL_STYLE
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
# rubocop:enable Naming/MethodName
|
data/lib/agile/commands/dor.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
# rubocop:disable Naming/MethodName
|
2
|
+
# :reek:UncommunicativeMethodName
|
1
3
|
module Agile
|
2
4
|
class CLI < Thor
|
3
|
-
desc Rainbow("
|
4
|
-
def
|
5
|
+
desc Rainbow("DoR").cornflower, Rainbow("Shows you rules of writing items").darkgoldenrod
|
6
|
+
def DoR
|
5
7
|
dor = []
|
6
8
|
dor << File.read("#{GEM_PATH}/agile/assets/definition_of_ready.txt")
|
7
9
|
say Terminal::Table.new title: "Definition of Ready", rows: [dor], style: TERMINAL_STYLE
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
13
|
+
# rubocop:enable Naming/MethodName
|
data/lib/agile/commands/init.rb
CHANGED
@@ -6,22 +6,13 @@ module Agile
|
|
6
6
|
|
7
7
|
def init(remote)
|
8
8
|
create_config_file
|
9
|
-
|
10
|
-
|
11
|
-
File.write("#{GEM_PATH}.config.json", JSON.generate(@config))
|
9
|
+
CONFIG["current_remote"] = remote
|
10
|
+
File.write("#{GEM_PATH}.config.json", JSON.generate(CONFIG))
|
12
11
|
say "Successfully added new remote!"
|
13
12
|
end
|
14
13
|
|
15
14
|
private
|
16
|
-
|
17
|
-
def read_config_content
|
18
|
-
if File.read("#{GEM_PATH}.config.json").empty?
|
19
|
-
{}
|
20
|
-
else
|
21
|
-
JSON.parse(File.read("#{GEM_PATH}.config.json"))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
15
|
+
|
25
16
|
def create_config_file
|
26
17
|
`touch #{GEM_PATH}.config.json` if `find "#{GEM_PATH}" -name .config.json`.empty?
|
27
18
|
end
|
data/lib/agile/commands/login.rb
CHANGED
@@ -2,10 +2,8 @@
|
|
2
2
|
module Agile
|
3
3
|
class CLI < Thor
|
4
4
|
desc Rainbow("login LOGIN_FROM_GITHUB").cornflower, Rainbow("Sign in github.").darkgoldenrod
|
5
|
-
|
6
5
|
def login(username)
|
7
|
-
|
8
|
-
if @config
|
6
|
+
if CONFIG
|
9
7
|
write_to_config(username)
|
10
8
|
authorize
|
11
9
|
else
|
@@ -20,14 +18,13 @@ module Agile
|
|
20
18
|
end
|
21
19
|
|
22
20
|
def authorize
|
23
|
-
RestClient.get "#{
|
24
|
-
say "Hello, #{@curr_user}"
|
25
|
-
# say responce.body
|
21
|
+
RestClient.get "#{CONFIG['current_remote']}/api/v1/users/#{@curr_user}"
|
22
|
+
say "Hello, #{@curr_user}" if @curr_user
|
26
23
|
end
|
27
24
|
|
28
25
|
def write_to_config(username)
|
29
|
-
|
30
|
-
File.write("#{GEM_PATH}.config.json", JSON.generate(
|
26
|
+
CONFIG["current_user"] = github_user_login(username)
|
27
|
+
File.write("#{GEM_PATH}.config.json", JSON.generate(CONFIG))
|
31
28
|
end
|
32
29
|
end
|
33
|
-
end
|
30
|
+
end
|
@@ -2,11 +2,10 @@
|
|
2
2
|
module Agile
|
3
3
|
class Projects < Thor
|
4
4
|
desc "create <project>", "Create new project"
|
5
|
-
def create(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
say "Successelly create project #{project}"
|
5
|
+
def create(project_name)
|
6
|
+
response = RestClient.post "#{CONFIG['current_remote']}/api/v1/projects/", { name: project_name }
|
7
|
+
if response.body
|
8
|
+
say "Successelly create project #{project_name}"
|
10
9
|
else
|
11
10
|
say "Try again"
|
12
11
|
end
|
@@ -14,31 +13,53 @@ module Agile
|
|
14
13
|
|
15
14
|
desc "list", "Show projects"
|
16
15
|
def list
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
response = RestClient.get "#{CONFIG['current_remote']}/api/v1/projects/"
|
17
|
+
data = JSON.parse(response)
|
18
|
+
array = data.map { |hash| hash.values }
|
19
|
+
info = array.map { |hash| hash[1]}
|
21
20
|
say Rainbow("<<Your Projects>>").cornflower
|
22
|
-
|
21
|
+
info.map { |name| p name }
|
23
22
|
end
|
24
23
|
|
25
24
|
desc "use <project>", "Select current project"
|
26
25
|
def use(project)
|
27
|
-
|
28
|
-
|
29
|
-
data = RestClient.get "#{@config['current_remote']}/api/v1/projects/"
|
26
|
+
if CONFIG
|
27
|
+
response = RestClient.get "#{CONFIG['current_remote']}/api/v1/projects/"
|
30
28
|
else
|
31
29
|
say "You need to add a remote!"
|
32
30
|
end
|
33
|
-
project_search(
|
31
|
+
project_search(response, project)
|
34
32
|
end
|
35
33
|
|
34
|
+
desc "delete <project>", "Delete project"
|
35
|
+
def delete(project)
|
36
|
+
response = RestClient.delete "#{CONFIG['current_remote']}/api/v1/projects/#{project}", { name: project}
|
37
|
+
if response.body
|
38
|
+
say "Successelly delete project #{project}"
|
39
|
+
else
|
40
|
+
say "Try again"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "update <project_name> <new_project_name>", "Update project name"
|
45
|
+
def update(project, new_project)
|
46
|
+
response = RestClient.put "#{CONFIG['current_remote']}/api/v1/projects/#{project}", name: project, new_name: new_project
|
47
|
+
if response.body
|
48
|
+
say "Successelly update project #{project}"
|
49
|
+
else
|
50
|
+
say "Try again"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
36
54
|
private
|
37
55
|
|
38
|
-
def project_search(
|
39
|
-
|
40
|
-
|
41
|
-
|
56
|
+
def project_search(response, project)
|
57
|
+
array = JSON.parse(response)
|
58
|
+
info = array.map { |hash| hash.values }
|
59
|
+
names = info.map{ |hash| hash[1] }
|
60
|
+
if names.include?(project)
|
61
|
+
CONFIG["current_project"] = project
|
62
|
+
File.write("#{GEM_PATH}.config.json", JSON.generate(CONFIG))
|
42
63
|
say "Your project: #{project}"
|
43
64
|
else
|
44
65
|
say "Such a project does not exist. Try again"
|
data/lib/agile/constants.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
RSpec.describe Agile::CLI do
|
2
|
+
describe "#DoD" do
|
3
|
+
subject(:cli) { described_class.new }
|
4
|
+
dod = <<~DOD
|
5
|
+
We consider a ticket ‘Done’ when:
|
6
|
+
|
7
|
+
1. The ticket is merged into master and deployed
|
8
|
+
2. All "Acceptance Criteria" are met
|
9
|
+
3. It is presented to Product Owner
|
10
|
+
4. Product Owner agrees that ticket is completed
|
11
|
+
DOD
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(cli).to receive(:say).with(Terminal::Table)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "receive definition of done" do
|
18
|
+
expect(dod).to eq(File.read("#{Agile::GEM_PATH}/agile/assets/definition_of_done.txt"))
|
19
|
+
end
|
20
|
+
|
21
|
+
it "shows you table" do
|
22
|
+
cli.DoD
|
23
|
+
expect(cli).to have_received(:say).with(Terminal::Table)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/agile/dor_spec.rb
CHANGED
@@ -1,22 +1,20 @@
|
|
1
1
|
RSpec.describe Agile::CLI do
|
2
|
-
describe "#
|
2
|
+
describe "#DoR" do
|
3
3
|
subject(:cli) { described_class.new }
|
4
4
|
dor = <<~DOR
|
5
|
-
Definition of Ready
|
6
|
-
|
7
5
|
All work should have a related Ticket.
|
8
6
|
Developer should not start development unless a Ticket is "Ready for development"
|
9
7
|
We consider a Ticket "Ready for development" if it meets following requirements:
|
10
8
|
|
11
9
|
Ticket Requirements must have:
|
12
10
|
|
13
|
-
Ticket should have a short title
|
14
|
-
Ticket should have a clear description
|
15
|
-
Description should including "How to demo" section
|
16
|
-
Description may have "Acceptance Criteria" section which includes all important(specific) requirements
|
17
|
-
All
|
18
|
-
Ticket can reasonably be "Done" within the Sprint time-box
|
19
|
-
Ticket should have
|
11
|
+
1. Ticket should have a short title
|
12
|
+
2. Ticket should have a clear description
|
13
|
+
3. Description should including "How to demo" section
|
14
|
+
4. Description may have "Acceptance Criteria" section which includes all important(specific) requirements
|
15
|
+
5. All Blocker should be resolved
|
16
|
+
6. Ticket can reasonably be "Done" within the Sprint time-box
|
17
|
+
7. Ticket should have Estimation
|
20
18
|
DOR
|
21
19
|
|
22
20
|
before do
|
@@ -28,7 +26,7 @@ RSpec.describe Agile::CLI do
|
|
28
26
|
end
|
29
27
|
|
30
28
|
it "shows you table" do
|
31
|
-
cli.
|
29
|
+
cli.DoR
|
32
30
|
expect(cli).to have_received(:say).with(Terminal::Table)
|
33
31
|
end
|
34
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agile-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rubizza-camp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -217,8 +217,10 @@ files:
|
|
217
217
|
- lib/agile.rb
|
218
218
|
- lib/agile/assets/agile_principles.txt
|
219
219
|
- lib/agile/assets/agile_values.txt
|
220
|
+
- lib/agile/assets/definition_of_done.txt
|
220
221
|
- lib/agile/assets/definition_of_ready.txt
|
221
222
|
- lib/agile/assets/manifesto.txt
|
223
|
+
- lib/agile/commands/dod.rb
|
222
224
|
- lib/agile/commands/dor.rb
|
223
225
|
- lib/agile/commands/hello.rb
|
224
226
|
- lib/agile/commands/help.rb
|
@@ -230,6 +232,7 @@ files:
|
|
230
232
|
- lib/agile/commands/values.rb
|
231
233
|
- lib/agile/commands/version.rb
|
232
234
|
- lib/agile/constants.rb
|
235
|
+
- spec/agile/dod_spec.rb
|
233
236
|
- spec/agile/dor_spec.rb
|
234
237
|
- spec/agile/hello_spec.rb
|
235
238
|
- spec/agile/principles_spec.rb
|