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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0defa22a48ce09f22352fe3e8af5eefe7f9339e5
4
- data.tar.gz: 45a714fbce9975a36bca67776a30572d76c5b05e
3
+ metadata.gz: 6b720e81c3ebfbf163c635b6ca68215699a826c9
4
+ data.tar.gz: 5b6ee8827c48fd8fdd4f957cc2773b45dfe61398
5
5
  SHA512:
6
- metadata.gz: 7ef100210997e744296acc4368dc59172510d3dca1440a705c07def410f0c45604f36e7f9ef169dbdbe4339a5e7b3bc4ed29938267b51ea2649b004f182769f3
7
- data.tar.gz: c29419fabe1ac781400030f63a2d5997229adb3047da82743feb2a418e7c4b53513ebe99889cacb4880e31b1a72ae71408c7c4169ef286fee336fd3b01ecf4df
6
+ metadata.gz: 3beabe677463c1e4807c5157146bdfd6d94fc06bed84db1b17b2bce6cb5e002a1011d175f26ceada56317961deca071de4cf95046698e8411aa79067d5a79fa9
7
+ data.tar.gz: 28ed0c1db7c8e04f20f340a5200809b3d3580568f2e6e637ae7ac2798e36410ba2961e72bcb001f0b76e8dde7f165eb775ffbc921533684d65b8e2e0e2969de8
@@ -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 'add NAME', 'add categories'
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("projects/#{@config[:project_key]}/categories", name: name)
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 NEW_NAME', 'update a category'
19
- def update(id, name)
20
- res = client.patch("projects/#{@config[:project_key]}/categories/#{id}", name: name)
21
- puts "category updated: #{res.body.id}\t#{res.body.name}"
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 CATEGORY_ID', 'delete categories'
35
+ desc 'delete [ID...]', 'delete categories'
25
36
  def delete(*ids)
26
37
  ids.each do |id|
27
- res = client.delete("projects/#{@config[:project_key]}/categories/#{id}")
38
+ res = client.delete("#{@url}/#{id}")
28
39
  puts "category deleted: #{res.body.id}\t#{res.body.name}"
29
40
  end
30
41
  end
@@ -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|
@@ -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 'add NAME', 'add milestones'
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("projects/#{@config[:project_key]}/versions", name: name)
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 'delete MILESTONE_ID', 'delete milestones'
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("projects/#{@config[:project_key]}/versions/#{id}")
58
+ res = client.delete("#{@url}/#{id}")
22
59
  puts "milestone deleted: #{res.body.id}\t#{res.body.name}"
23
60
  end
24
61
  end
@@ -8,7 +8,14 @@ module Bl
8
8
  super
9
9
  end
10
10
 
11
- desc 'add NAMES', 'add types'
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 TYPE_IDS', 'update types'
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 TYPE_IDS', 'delete types'
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|
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
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.12
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-06 00:00:00.000000000 Z
11
+ date: 2016-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor