bl 0.6.1 → 0.6.2

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: d05f12acc0e75e703832ab0cce2346b918a8ab72
4
- data.tar.gz: 823008f346a5f109ff1d7273d9a01af2f9f10d4a
3
+ metadata.gz: '03219c428b23372c28b606539fb8ab84070b71cb'
4
+ data.tar.gz: 72a0e687140543a94bd46392d9cc178e2464fb7a
5
5
  SHA512:
6
- metadata.gz: d375b572e522e8ccef165b619e8b1bc1b1d7ed51fd4982403acfbc9ddb5b1cfdc653664e25f7a6f6966c85b1f34d2a14f4a66d9a5a0772bf4025bb95271b29be
7
- data.tar.gz: c64446967123dae6b41cce1da774cf95404baf178b264d6e310816756e70469550e28dcfc73c319c10f2052e1f3ec9aa8b236101eee3521a391718c3bc2e0791
6
+ metadata.gz: 661e4c0aa182113718192fca1882cdde7ec13e7507a428d77990131283af4c047116a18be872760f26030f0ca3320af0a7dec128a41cf94bd9b9e55e20886b6c
7
+ data.tar.gz: 3938903a27afbef92d6f2a01c2e3f4261c747abf9d7244b83e6b0306d63d3720db92b483b8a55289d5b84b4860876c6f5979304e0f7ca36178dc5dd83381feb7
@@ -33,13 +33,13 @@ module Bl
33
33
  space_id: space_id,
34
34
  api_key: api_key
35
35
  )
36
- res = request(:get, 'projects')
36
+ res = client.get('projects')
37
37
  project_key = res.body[0].projectKey
38
38
  config[:project_key] = project_key
39
39
  config[:issue][:default][:projectId] = res.body[0].id
40
- res = request(:get, "projects/#{project_key}/issueTypes")
40
+ res = client.get("projects/#{project_key}/issueTypes")
41
41
  config[:issue][:default][:issueTypeId] = res.body[0].id
42
- res = request(:get, 'priorities')
42
+ res = client.get('priorities')
43
43
  config[:issue][:default][:priorityId] = res.body[1].id
44
44
  f.write(config.to_yaml)
45
45
  puts "#{filename} generated."
@@ -74,6 +74,7 @@ module Bl
74
74
  opts[:order] = 'asc'
75
75
  end
76
76
  opts[:categoryId] = [-1] if options[:nocategory]
77
+ opts[:count] = ISSUES_COUNT_MAX
77
78
  res = request(:get, 'issues', opts)
78
79
  print_response(res, :issue)
79
80
  end
@@ -46,6 +46,7 @@ module Bl
46
46
  priorityId: :numeric,
47
47
  assigneeId: :numeric
48
48
  }
49
+ ISSUES_COUNT_MAX = 100
49
50
  ISSUE_FIELDS = %i(
50
51
  issueType
51
52
  issueKey
@@ -8,6 +8,8 @@ module Bl
8
8
  puts formatter.render(printable_issues(res.body), fields: ISSUE_FIELDS)
9
9
  when :named
10
10
  puts formatter.render(res.body, fields: %i(id name))
11
+ when :wiki
12
+ puts formatter.render(res.body, fields: WIKI_FIELDS)
11
13
  else
12
14
  raise 'invalid resource error'
13
15
  end
@@ -1,6 +1,5 @@
1
1
  module Bl
2
2
  class Recent < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  super
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.2'.freeze
3
3
  end
@@ -1,16 +1,45 @@
1
1
  module Bl
2
2
  class Wiki < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  @url = 'wikis'
7
6
  super
8
7
  end
9
8
 
9
+ desc 'add NAME', 'add wiki'
10
+ option :projectId, type: :numeric, required: true
11
+ option :content, type: :string, required: true
12
+ def add(name)
13
+ res = request(
14
+ :post,
15
+ @url,
16
+ projectId: options[:projectId],
17
+ name: name,
18
+ content: options[:content]
19
+ )
20
+ puts 'wiki added:'
21
+ print_response(res, :wiki)
22
+ end
23
+
24
+ desc 'count', 'count wiki'
25
+ option :projectIdOrKey, type: :numeric, required: true
26
+ def count
27
+ res = request(:get, "#{@url}/count", projectIdOrKey: options[:projectIdOrKey])
28
+ puts 'wiki count'
29
+ puts res.body.count
30
+ end
31
+
32
+ desc 'delete ID', 'delete wiki'
33
+ def delete(id)
34
+ res = request(:delete, "#{@url}/#{id}")
35
+ puts 'wiki deleted'
36
+ print_response(res, :wiki)
37
+ end
38
+
10
39
  desc 'list', 'list wikis'
11
40
  def list
12
41
  res = request(:get, @url, projectIdOrKey: @config[:project_key])
13
- puts formatter.render(res.body, fields: WIKI_FIELDS)
42
+ print_response(res, :wiki)
14
43
  end
15
44
 
16
45
  desc 'show ID', "show a wiki's content"
@@ -25,6 +54,14 @@ module Bl
25
54
  puts body.content
26
55
  end
27
56
 
57
+ desc 'tags', 'show wiki tags'
58
+ option :projectIdOrKey, type: :numeric, required: true
59
+ def tags
60
+ res = request(:get, "#{@url}/tags", projectIdOrKey: options[:projectIdOrKey])
61
+ puts 'wiki tags:'
62
+ print_response(res, :named)
63
+ end
64
+
28
65
  desc 'edit ID', 'edit a wiki by $EDITOR'
29
66
  def edit(id)
30
67
  wiki_content = request(:get, "#{@url}/#{id}").body.content
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - saki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-13 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor