bl 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bl/category.rb +19 -8
- data/lib/bl/cli.rb +0 -29
- data/lib/bl/milestone.rb +41 -4
- data/lib/bl/type.rb +10 -3
- data/lib/bl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b720e81c3ebfbf163c635b6ca68215699a826c9
|
4
|
+
data.tar.gz: 5b6ee8827c48fd8fdd4f957cc2773b45dfe61398
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3beabe677463c1e4807c5157146bdfd6d94fc06bed84db1b17b2bce6cb5e002a1011d175f26ceada56317961deca071de4cf95046698e8411aa79067d5a79fa9
|
7
|
+
data.tar.gz: 28ed0c1db7c8e04f20f340a5200809b3d3580568f2e6e637ae7ac2798e36410ba2961e72bcb001f0b76e8dde7f165eb775ffbc921533684d65b8e2e0e2969de8
|
data/lib/bl/category.rb
CHANGED
@@ -4,27 +4,38 @@ module Bl
|
|
4
4
|
|
5
5
|
def initialize(*)
|
6
6
|
@config = Bl::Config.instance
|
7
|
+
@url = "projects/#{@config[:project_key]}/categories"
|
7
8
|
super
|
8
9
|
end
|
9
10
|
|
10
|
-
desc '
|
11
|
+
desc 'list', 'list categories'
|
12
|
+
def list
|
13
|
+
client.get(@url).body.each do |c|
|
14
|
+
puts [c.id, c.name].join("\t")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'add [NAME...]', 'add categories'
|
11
19
|
def add(*names)
|
12
20
|
names.each do |name|
|
13
|
-
res = client.post(
|
21
|
+
res = client.post(@url, name: name)
|
14
22
|
puts "category added: #{res.body.id}\t#{res.body.name}"
|
15
23
|
end
|
16
24
|
end
|
17
25
|
|
18
|
-
desc 'update ID
|
19
|
-
|
20
|
-
|
21
|
-
|
26
|
+
desc 'update [ID...]', 'update categories'
|
27
|
+
option :name, type: :string
|
28
|
+
def update(*ids)
|
29
|
+
ids.each do |id|
|
30
|
+
res = client.patch("#{@url}/#{id}", options)
|
31
|
+
puts "category updated: #{res.body.id}\t#{res.body.name}"
|
32
|
+
end
|
22
33
|
end
|
23
34
|
|
24
|
-
desc 'delete
|
35
|
+
desc 'delete [ID...]', 'delete categories'
|
25
36
|
def delete(*ids)
|
26
37
|
ids.each do |id|
|
27
|
-
res = client.delete("
|
38
|
+
res = client.delete("#{@url}/#{id}")
|
28
39
|
puts "category deleted: #{res.body.id}\t#{res.body.name}"
|
29
40
|
end
|
30
41
|
end
|
data/lib/bl/cli.rb
CHANGED
@@ -171,35 +171,6 @@ module Bl
|
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
|
-
desc 'types', 'list issue types'
|
175
|
-
def types
|
176
|
-
client.get("projects/#{@config[:project_key]}/issueTypes").body.each do |t|
|
177
|
-
puts [t.id, t.name].join("\t")
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
desc 'milestones', 'list milestones'
|
182
|
-
def milestones
|
183
|
-
client.get("projects/#{@config[:project_key]}/versions").body.each do |v|
|
184
|
-
puts [
|
185
|
-
v.id,
|
186
|
-
v.projectId,
|
187
|
-
v.name,
|
188
|
-
v.description,
|
189
|
-
v.startDate,
|
190
|
-
v.releaseDueDate,
|
191
|
-
v.archived
|
192
|
-
].join("\t")
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
desc 'categories', 'list issue categories'
|
197
|
-
def categories
|
198
|
-
client.get("projects/#{@config[:project_key]}/categories").body.each do |c|
|
199
|
-
puts [c.id, c.name].join("\t")
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
174
|
desc 'statuses', 'list statuses'
|
204
175
|
def statuses
|
205
176
|
client.get('statuses').body.each do |s|
|
data/lib/bl/milestone.rb
CHANGED
@@ -4,21 +4,58 @@ module Bl
|
|
4
4
|
|
5
5
|
def initialize(*)
|
6
6
|
@config = Bl::Config.instance
|
7
|
+
@url = "projects/#{@config[:project_key]}/versions"
|
7
8
|
super
|
8
9
|
end
|
9
10
|
|
10
|
-
desc '
|
11
|
+
desc 'list', 'list milestones'
|
12
|
+
def list
|
13
|
+
client.get(@url).body.each do |v|
|
14
|
+
puts [
|
15
|
+
v.id,
|
16
|
+
v.projectId,
|
17
|
+
v.name,
|
18
|
+
v.description,
|
19
|
+
v.startDate,
|
20
|
+
v.releaseDueDate,
|
21
|
+
v.archived
|
22
|
+
].join("\t")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'add [NAME...]', 'add milestones'
|
27
|
+
option :description, type: :string
|
28
|
+
option :startDate, type: :string
|
29
|
+
option :releaseDate, type: :string
|
11
30
|
def add(*names)
|
12
31
|
names.each do |name|
|
13
|
-
res = client.post(
|
32
|
+
res = client.post(
|
33
|
+
@url,
|
34
|
+
name: name,
|
35
|
+
description: options[:description],
|
36
|
+
startDate: options[:startDate],
|
37
|
+
releaseDate: options[:releaseDate]
|
38
|
+
)
|
14
39
|
puts "milestone added: #{res.body.id}\t#{res.body.name}"
|
15
40
|
end
|
16
41
|
end
|
17
42
|
|
18
|
-
desc '
|
43
|
+
desc 'update [ID...]', 'update milestones'
|
44
|
+
option :name, type: :string
|
45
|
+
option :description, type: :string
|
46
|
+
option :startDate, type: :string
|
47
|
+
option :releaseDate, type: :string
|
48
|
+
def update(*ids)
|
49
|
+
ids.each do |id|
|
50
|
+
res = client.patch("#{@url}/#{id}", options)
|
51
|
+
puts "milestone updated: #{res.body.id}\t#{res.body.name}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
desc 'delete [ID...]', 'delete milestones'
|
19
56
|
def delete(*ids)
|
20
57
|
ids.each do |id|
|
21
|
-
res = client.delete("
|
58
|
+
res = client.delete("#{@url}/#{id}")
|
22
59
|
puts "milestone deleted: #{res.body.id}\t#{res.body.name}"
|
23
60
|
end
|
24
61
|
end
|
data/lib/bl/type.rb
CHANGED
@@ -8,7 +8,14 @@ module Bl
|
|
8
8
|
super
|
9
9
|
end
|
10
10
|
|
11
|
-
desc '
|
11
|
+
desc 'list', 'list issue types'
|
12
|
+
def list
|
13
|
+
client.get(@url).body.each do |t|
|
14
|
+
puts [t.id, t.name, t.color].join("\t")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'add [NAME...]', 'add types'
|
12
19
|
option :color, type: :string, required: true
|
13
20
|
def add(*names)
|
14
21
|
names.each do |name|
|
@@ -17,7 +24,7 @@ module Bl
|
|
17
24
|
end
|
18
25
|
end
|
19
26
|
|
20
|
-
desc 'update
|
27
|
+
desc 'update [ID...]', 'update types'
|
21
28
|
option :name, type: :string
|
22
29
|
option :color, color: :color
|
23
30
|
def update(*ids)
|
@@ -27,7 +34,7 @@ module Bl
|
|
27
34
|
end
|
28
35
|
end
|
29
36
|
|
30
|
-
desc 'delete
|
37
|
+
desc 'delete [ID...]', 'delete types'
|
31
38
|
option :substituteIssueTypeId, type: :numeric, required: true
|
32
39
|
def delete(*ids)
|
33
40
|
ids.each do |id|
|
data/lib/bl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|