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 +4 -4
- data/lib/bl/cli.rb +4 -3
- data/lib/bl/constants.rb +1 -0
- data/lib/bl/printer.rb +2 -0
- data/lib/bl/recent.rb +0 -1
- data/lib/bl/version.rb +1 -1
- data/lib/bl/wiki.rb +39 -2
- 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: '03219c428b23372c28b606539fb8ab84070b71cb'
|
4
|
+
data.tar.gz: 72a0e687140543a94bd46392d9cc178e2464fb7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 661e4c0aa182113718192fca1882cdde7ec13e7507a428d77990131283af4c047116a18be872760f26030f0ca3320af0a7dec128a41cf94bd9b9e55e20886b6c
|
7
|
+
data.tar.gz: 3938903a27afbef92d6f2a01c2e3f4261c747abf9d7244b83e6b0306d63d3720db92b483b8a55289d5b84b4860876c6f5979304e0f7ca36178dc5dd83381feb7
|
data/lib/bl/cli.rb
CHANGED
@@ -33,13 +33,13 @@ module Bl
|
|
33
33
|
space_id: space_id,
|
34
34
|
api_key: api_key
|
35
35
|
)
|
36
|
-
res =
|
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 =
|
40
|
+
res = client.get("projects/#{project_key}/issueTypes")
|
41
41
|
config[:issue][:default][:issueTypeId] = res.body[0].id
|
42
|
-
res =
|
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
|
data/lib/bl/constants.rb
CHANGED
data/lib/bl/printer.rb
CHANGED
@@ -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
|
data/lib/bl/recent.rb
CHANGED
data/lib/bl/version.rb
CHANGED
data/lib/bl/wiki.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|