bl 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -2
- data/README.md +32 -32
- data/Rakefile +4 -10
- data/bl.gemspec +5 -5
- data/etc/help.md +32 -31
- data/lib/bl.rb +16 -16
- data/lib/bl/cli.rb +25 -113
- data/lib/bl/command.rb +0 -1
- data/lib/bl/commands/category.rb +46 -0
- data/lib/bl/commands/file.rb +28 -0
- data/lib/bl/commands/gitrepo.rb +23 -0
- data/lib/bl/commands/group.rb +47 -0
- data/lib/bl/commands/issue.rb +104 -0
- data/lib/bl/commands/milestone.rb +60 -0
- data/lib/bl/commands/notification.rb +41 -0
- data/lib/bl/commands/project.rb +127 -0
- data/lib/bl/commands/pull_request.rb +23 -0
- data/lib/bl/commands/recent.rb +28 -0
- data/lib/bl/commands/space.rb +66 -0
- data/lib/bl/commands/type.rb +57 -0
- data/lib/bl/commands/user.rb +90 -0
- data/lib/bl/commands/watching.rb +67 -0
- data/lib/bl/commands/webhook.rb +52 -0
- data/lib/bl/commands/wiki.rb +79 -0
- data/lib/bl/version.rb +11 -1
- metadata +43 -43
- data/lib/bl/category.rb +0 -44
- data/lib/bl/file.rb +0 -26
- data/lib/bl/formatting.rb +0 -38
- data/lib/bl/gitrepo.rb +0 -22
- data/lib/bl/groups.rb +0 -45
- data/lib/bl/milestone.rb +0 -58
- data/lib/bl/notifications.rb +0 -38
- data/lib/bl/project.rb +0 -121
- data/lib/bl/pull_request.rb +0 -21
- data/lib/bl/recent.rb +0 -24
- data/lib/bl/space.rb +0 -61
- data/lib/bl/type.rb +0 -55
- data/lib/bl/users.rb +0 -87
- data/lib/bl/watchings.rb +0 -67
- data/lib/bl/webhooks.rb +0 -51
- data/lib/bl/wiki.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a7f3deae6619e2567d54136abe3d58bcbf216eda04268e1c42334a5a670f915
|
4
|
+
data.tar.gz: d016ba457cf66eeb5f870347edc89fd840ae9283c020fed5f2bb2331fbb42de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5260df8b19676f429367617f8ff9445dd1282a5d6d2c0de8cc2862f9d3cd996e9f3e0c6c0b57e61c5da262bc10431b1bdaf141fe5a8ea6a1bd88afa4a3098cf
|
7
|
+
data.tar.gz: 61bdd9b05e1734337f16ea27172e9e9eef9f18f2f7b2acd402c8ca9758f4fd35779aeeb1ab68ec79135515e8831358d7d9c60066bb17302dcf63bf1723899095
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
bl is a command line tool for Nulab's [Backlog](http://www.backlog.jp/).
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/bl.svg)](https://badge.fury.io/rb/bl)
|
6
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/sakihet/bl.svg)](https://gemnasium.com/github.com/sakihet/bl)
|
7
6
|
![License](https://img.shields.io/github/license/sakihet/bl.svg)
|
8
7
|
|
9
8
|
## Table of Contents
|
@@ -50,37 +49,38 @@ $EDITOR ~/.bl.yml
|
|
50
49
|
|
51
50
|
```
|
52
51
|
Commands:
|
53
|
-
bl add [SUBJECT...]
|
54
|
-
bl browse KEY
|
55
|
-
bl category SUBCOMMAND ...ARGS
|
56
|
-
bl close [KEY...]
|
57
|
-
bl config
|
58
|
-
bl count
|
59
|
-
bl edit KEY
|
60
|
-
bl file SUBCOMMAND ...ARGS
|
61
|
-
bl gitrepo SUBCOMMAND ...ARGS
|
62
|
-
bl
|
63
|
-
bl help [COMMAND]
|
64
|
-
bl init
|
65
|
-
bl list
|
66
|
-
bl milestone SUBCOMMAND ...ARGS
|
67
|
-
bl
|
68
|
-
bl priorities
|
69
|
-
bl project SUBCOMMAND ...ARGS
|
70
|
-
bl
|
71
|
-
bl
|
72
|
-
bl
|
73
|
-
bl
|
74
|
-
bl
|
75
|
-
bl
|
76
|
-
bl
|
77
|
-
bl
|
78
|
-
bl
|
79
|
-
bl
|
80
|
-
bl
|
81
|
-
bl
|
82
|
-
bl
|
83
|
-
bl
|
52
|
+
bl add [SUBJECT...] # add issues
|
53
|
+
bl browse KEY # browse an issue
|
54
|
+
bl category SUBCOMMAND ...ARGS # manage categories
|
55
|
+
bl close [KEY...] # close issues
|
56
|
+
bl config # show config
|
57
|
+
bl count # count issues
|
58
|
+
bl edit KEY # edit issues' description by $EDITOR
|
59
|
+
bl file SUBCOMMAND ...ARGS # manage files
|
60
|
+
bl gitrepo SUBCOMMAND ...ARGS # show gitrepos
|
61
|
+
bl group SUBCOMMAND ...ARGS # manage groups
|
62
|
+
bl help [COMMAND] # Describe available commands or one specific command
|
63
|
+
bl init # initialize a default config file
|
64
|
+
bl list # list issues by typical ways
|
65
|
+
bl milestone SUBCOMMAND ...ARGS # manage milestones
|
66
|
+
bl notification SUBCOMMAND ...ARGS # manage notifications
|
67
|
+
bl priorities # list priorities
|
68
|
+
bl project SUBCOMMAND ...ARGS # manage projects
|
69
|
+
bl pullrequest SUBCOMMAND ...ARGS # manage pull requests
|
70
|
+
bl recent SUBCOMMAND ...ARGS # list recent stuff
|
71
|
+
bl resolutions # list resolutions
|
72
|
+
bl roles # list roles
|
73
|
+
bl search # search issues
|
74
|
+
bl show KEY # show an issue's details
|
75
|
+
bl space SUBCOMMAND ...ARGS # manage space
|
76
|
+
bl statuses # list statuses
|
77
|
+
bl type SUBCOMMAND ...ARGS # manage types
|
78
|
+
bl update [KEY...] # update issues
|
79
|
+
bl user SUBCOMMAND ...ARGS # manage users
|
80
|
+
bl version # show version
|
81
|
+
bl watching SUBCOMMAND ...ARGS # manage watchings
|
82
|
+
bl webhook SUBCOMMAND ...ARGS # manage webhooks
|
83
|
+
bl wiki SUBCOMMAND ...ARGS # manage wikis
|
84
84
|
|
85
85
|
Options:
|
86
86
|
[--format=FORMAT] # set output format
|
data/Rakefile
CHANGED
@@ -60,30 +60,24 @@ task :system_test do
|
|
60
60
|
commands = [
|
61
61
|
'category list',
|
62
62
|
'config',
|
63
|
-
'count',
|
64
63
|
'file list',
|
65
64
|
'gitrepo list',
|
66
|
-
'
|
65
|
+
'group list',
|
67
66
|
'help',
|
68
|
-
'list',
|
69
67
|
'milestone list',
|
70
|
-
'notifications count',
|
71
|
-
'notifications list',
|
72
68
|
'priorities',
|
73
69
|
'project list',
|
74
70
|
'resolutions',
|
75
71
|
'roles',
|
76
|
-
'search',
|
77
|
-
'space activities',
|
78
72
|
'space disk-usage',
|
79
73
|
'space get-notification',
|
80
74
|
'space info',
|
81
75
|
'statuses',
|
82
76
|
'type colors',
|
83
77
|
'type list',
|
84
|
-
'
|
85
|
-
'
|
86
|
-
'
|
78
|
+
'user list',
|
79
|
+
'user myself',
|
80
|
+
'webhook list',
|
87
81
|
'wiki list'
|
88
82
|
]
|
89
83
|
commands.each do |c|
|
data/bl.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'bl/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'bl'
|
8
|
-
spec.version = Bl
|
8
|
+
spec.version = Bl.gem_version
|
9
9
|
spec.authors = ['saki']
|
10
10
|
spec.email = ['sakihet@gmail.com']
|
11
11
|
|
@@ -21,15 +21,15 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_dependency 'thor', '~> 0.20.0'
|
25
24
|
spec.add_dependency 'backlog_kit', '~> 0.16.0'
|
26
|
-
spec.add_dependency 'paint', '~> 2.0'
|
27
25
|
spec.add_dependency 'hirb', '~> 0.7.3'
|
28
|
-
spec.add_dependency 'hirb-unicode', '~> 0.0.
|
26
|
+
spec.add_dependency 'hirb-unicode-steakknife', '~> 0.0.8'
|
27
|
+
spec.add_dependency 'paint', '~> 2.0'
|
28
|
+
spec.add_dependency 'thor', '~> 0.20.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 1.16.0'
|
31
|
-
spec.add_development_dependency 'rake', '~> 12.2.1'
|
32
31
|
spec.add_development_dependency 'minitest', '~> 5.10'
|
33
32
|
spec.add_development_dependency 'pry', '~> 0.11.2'
|
33
|
+
spec.add_development_dependency 'rake', '~> 12.3.0'
|
34
34
|
spec.add_development_dependency 'rubocop', '~> 0.51.0'
|
35
35
|
end
|
data/etc/help.md
CHANGED
@@ -2,37 +2,38 @@
|
|
2
2
|
|
3
3
|
```
|
4
4
|
Commands:
|
5
|
-
bl add [SUBJECT...]
|
6
|
-
bl browse KEY
|
7
|
-
bl category SUBCOMMAND ...ARGS
|
8
|
-
bl close [KEY...]
|
9
|
-
bl config
|
10
|
-
bl count
|
11
|
-
bl edit KEY
|
12
|
-
bl file SUBCOMMAND ...ARGS
|
13
|
-
bl gitrepo SUBCOMMAND ...ARGS
|
14
|
-
bl
|
15
|
-
bl help [COMMAND]
|
16
|
-
bl init
|
17
|
-
bl list
|
18
|
-
bl milestone SUBCOMMAND ...ARGS
|
19
|
-
bl
|
20
|
-
bl priorities
|
21
|
-
bl project SUBCOMMAND ...ARGS
|
22
|
-
bl
|
23
|
-
bl
|
24
|
-
bl
|
25
|
-
bl
|
26
|
-
bl
|
27
|
-
bl
|
28
|
-
bl
|
29
|
-
bl
|
30
|
-
bl
|
31
|
-
bl
|
32
|
-
bl
|
33
|
-
bl
|
34
|
-
bl
|
35
|
-
bl
|
5
|
+
bl add [SUBJECT...] # add issues
|
6
|
+
bl browse KEY # browse an issue
|
7
|
+
bl category SUBCOMMAND ...ARGS # manage categories
|
8
|
+
bl close [KEY...] # close issues
|
9
|
+
bl config # show config
|
10
|
+
bl count # count issues
|
11
|
+
bl edit KEY # edit issues' description by $EDITOR
|
12
|
+
bl file SUBCOMMAND ...ARGS # manage files
|
13
|
+
bl gitrepo SUBCOMMAND ...ARGS # show gitrepos
|
14
|
+
bl group SUBCOMMAND ...ARGS # manage groups
|
15
|
+
bl help [COMMAND] # Describe available commands or one specific command
|
16
|
+
bl init # initialize a default config file
|
17
|
+
bl list # list issues by typical ways
|
18
|
+
bl milestone SUBCOMMAND ...ARGS # manage milestones
|
19
|
+
bl notification SUBCOMMAND ...ARGS # manage notifications
|
20
|
+
bl priorities # list priorities
|
21
|
+
bl project SUBCOMMAND ...ARGS # manage projects
|
22
|
+
bl pullrequest SUBCOMMAND ...ARGS # manage pull requests
|
23
|
+
bl recent SUBCOMMAND ...ARGS # list recent stuff
|
24
|
+
bl resolutions # list resolutions
|
25
|
+
bl roles # list roles
|
26
|
+
bl search # search issues
|
27
|
+
bl show KEY # show an issue's details
|
28
|
+
bl space SUBCOMMAND ...ARGS # manage space
|
29
|
+
bl statuses # list statuses
|
30
|
+
bl type SUBCOMMAND ...ARGS # manage types
|
31
|
+
bl update [KEY...] # update issues
|
32
|
+
bl user SUBCOMMAND ...ARGS # manage users
|
33
|
+
bl version # show version
|
34
|
+
bl watching SUBCOMMAND ...ARGS # manage watchings
|
35
|
+
bl webhook SUBCOMMAND ...ARGS # manage webhooks
|
36
|
+
bl wiki SUBCOMMAND ...ARGS # manage wikis
|
36
37
|
|
37
38
|
Options:
|
38
39
|
[--format=FORMAT] # set output format
|
data/lib/bl.rb
CHANGED
@@ -7,24 +7,24 @@ require 'bl/version'
|
|
7
7
|
require 'bl/constants'
|
8
8
|
require 'bl/config'
|
9
9
|
require 'bl/requestable'
|
10
|
-
require 'bl/formatting'
|
11
10
|
require 'bl/printer'
|
12
11
|
require 'bl/command'
|
13
|
-
require 'bl/space'
|
14
|
-
require 'bl/type'
|
15
|
-
require 'bl/category'
|
16
|
-
require 'bl/
|
17
|
-
require 'bl/
|
18
|
-
require 'bl/
|
19
|
-
require 'bl/
|
20
|
-
require 'bl/
|
21
|
-
require 'bl/
|
22
|
-
require 'bl/
|
23
|
-
require 'bl/
|
24
|
-
require 'bl/
|
25
|
-
require 'bl/
|
26
|
-
require 'bl/
|
27
|
-
require 'bl/
|
12
|
+
require 'bl/commands/space'
|
13
|
+
require 'bl/commands/type'
|
14
|
+
require 'bl/commands/category'
|
15
|
+
require 'bl/commands/issue'
|
16
|
+
require 'bl/commands/milestone'
|
17
|
+
require 'bl/commands/wiki'
|
18
|
+
require 'bl/commands/project'
|
19
|
+
require 'bl/commands/recent'
|
20
|
+
require 'bl/commands/file'
|
21
|
+
require 'bl/commands/gitrepo'
|
22
|
+
require 'bl/commands/pull_request'
|
23
|
+
require 'bl/commands/user'
|
24
|
+
require 'bl/commands/group'
|
25
|
+
require 'bl/commands/webhook'
|
26
|
+
require 'bl/commands/notification'
|
27
|
+
require 'bl/commands/watching'
|
28
28
|
require 'bl/formatter'
|
29
29
|
require 'bl/cli'
|
30
30
|
|
data/lib/bl/cli.rb
CHANGED
@@ -7,7 +7,7 @@ module Bl
|
|
7
7
|
|
8
8
|
desc 'version', 'show version'
|
9
9
|
def version
|
10
|
-
puts Bl
|
10
|
+
puts Bl.gem_version
|
11
11
|
end
|
12
12
|
|
13
13
|
desc 'config', 'show config'
|
@@ -46,46 +46,6 @@ module Bl
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
desc 'count', 'count issues'
|
50
|
-
options ISSUES_PARAMS
|
51
|
-
def count
|
52
|
-
puts request(:get, 'issues/count', delete_class_options(options.to_h)).body.count
|
53
|
-
end
|
54
|
-
|
55
|
-
desc 'list', 'list issues by typical ways'
|
56
|
-
option :all
|
57
|
-
option :unassigned
|
58
|
-
option :today
|
59
|
-
option :overdue
|
60
|
-
option :priority
|
61
|
-
option :nocategory
|
62
|
-
def list
|
63
|
-
opts = {}
|
64
|
-
opts[:statusId] = [1, 2, 3] unless options[:all]
|
65
|
-
opts[:assigneeId] = [-1] if options[:unassigned]
|
66
|
-
if options[:today]
|
67
|
-
today = Date.today
|
68
|
-
opts[:dueDateSince] = today.to_s
|
69
|
-
opts[:dueDateUntil] = today.next.to_s
|
70
|
-
end
|
71
|
-
opts[:dueDateUntil] = Date.today.to_s if options[:overdue]
|
72
|
-
if options[:priority]
|
73
|
-
opts[:sort] = 'priority'
|
74
|
-
opts[:order] = 'asc'
|
75
|
-
end
|
76
|
-
opts[:categoryId] = [-1] if options[:nocategory]
|
77
|
-
opts[:count] = ISSUES_COUNT_MAX
|
78
|
-
res = request(:get, 'issues', opts)
|
79
|
-
print_response(res, :issue)
|
80
|
-
end
|
81
|
-
|
82
|
-
desc 'search', 'search issues'
|
83
|
-
options ISSUES_PARAMS
|
84
|
-
def search
|
85
|
-
res = request(:get, 'issues', delete_class_options(options.to_h))
|
86
|
-
print_response(res, :issue)
|
87
|
-
end
|
88
|
-
|
89
49
|
desc 'show KEY', "show an issue's details"
|
90
50
|
def show(key)
|
91
51
|
res = request(:get, "issues/#{key}")
|
@@ -121,58 +81,6 @@ module Bl
|
|
121
81
|
system("open #{url}")
|
122
82
|
end
|
123
83
|
|
124
|
-
desc 'add [SUBJECT...]', 'add issues'
|
125
|
-
options ISSUE_BASE_ATTRIBUTES
|
126
|
-
def add(*subjects)
|
127
|
-
subjects.each do |s|
|
128
|
-
issue_default_options = @config[:issue][:default]
|
129
|
-
res = request(:post,
|
130
|
-
'issues',
|
131
|
-
issue_default_options.merge({summary: s}).merge(delete_class_options(options.to_h))
|
132
|
-
)
|
133
|
-
puts '💡 issue added'
|
134
|
-
print_response(res, :issue)
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
desc 'update [KEY...]', 'update issues'
|
139
|
-
options ISSUE_BASE_ATTRIBUTES
|
140
|
-
option :comment, type: :string
|
141
|
-
def update(*keys)
|
142
|
-
keys.each do |k|
|
143
|
-
res = request(:patch, "issues/#{k}", delete_class_options(options.to_h))
|
144
|
-
puts 'issue updated'
|
145
|
-
print_response(res, :issue)
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
desc 'close [KEY...]', 'close issues'
|
150
|
-
def close(*keys)
|
151
|
-
keys.each do |k|
|
152
|
-
res = request(:patch, "issues/#{k}", statusId: 4)
|
153
|
-
puts '🎉 issue closed'
|
154
|
-
print_response(res, :issue)
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
desc 'edit KEY', "edit issues' description by $EDITOR"
|
159
|
-
def edit(key)
|
160
|
-
issue_description = request(:get, "issues/#{key}").body.description
|
161
|
-
file = Tempfile.new
|
162
|
-
file.puts(issue_description)
|
163
|
-
file.close
|
164
|
-
begin
|
165
|
-
file.open
|
166
|
-
system("$EDITOR #{file.path}")
|
167
|
-
new_content = file.read
|
168
|
-
request(:patch, "issues/#{key}", description: new_content)
|
169
|
-
puts "issue #{key} updated."
|
170
|
-
ensure
|
171
|
-
file.close
|
172
|
-
file.unlink
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
84
|
desc 'statuses', 'list statuses'
|
177
85
|
def statuses
|
178
86
|
res = request(:get, 'statuses')
|
@@ -197,48 +105,52 @@ module Bl
|
|
197
105
|
end
|
198
106
|
|
199
107
|
desc 'category SUBCOMMAND ...ARGS', 'manage categories'
|
200
|
-
subcommand 'category', Category
|
108
|
+
subcommand 'category', Commands::Category
|
201
109
|
|
202
110
|
desc 'file SUBCOMMAND ...ARGS', 'manage files'
|
203
|
-
subcommand 'file', File
|
111
|
+
subcommand 'file', Commands::File
|
204
112
|
|
205
113
|
desc 'gitrepo SUBCOMMAND ...ARGS', 'show gitrepos'
|
206
|
-
subcommand 'gitrepo', GitRepo
|
114
|
+
subcommand 'gitrepo', Commands::GitRepo
|
115
|
+
|
116
|
+
desc 'group SUBCOMMAND ...ARGS', 'manage groups'
|
117
|
+
subcommand 'group', Commands::Group
|
207
118
|
|
208
|
-
desc '
|
209
|
-
subcommand '
|
119
|
+
desc 'issue SUBCOMMAND ...ARGS', 'manage issues'
|
120
|
+
subcommand 'issue', Commands::Issue
|
210
121
|
|
211
122
|
desc 'milestone SUBCOMMAND ...ARGS', 'manage milestones'
|
212
|
-
subcommand 'milestone', Milestone
|
123
|
+
subcommand 'milestone', Commands::Milestone
|
213
124
|
|
214
|
-
|
215
|
-
|
125
|
+
# TODO
|
126
|
+
# desc 'notification SUBCOMMAND ...ARGS', 'manage notifications'
|
127
|
+
# subcommand 'notification', Commands::Notification
|
216
128
|
|
217
129
|
desc 'project SUBCOMMAND ...ARGS', 'manage projects'
|
218
|
-
subcommand 'project', Project
|
130
|
+
subcommand 'project', Commands::Project
|
219
131
|
|
220
132
|
desc 'pullrequest SUBCOMMAND ...ARGS', 'manage pull requests'
|
221
|
-
subcommand 'pullrequest', PullRequest
|
133
|
+
subcommand 'pullrequest', Commands::PullRequest
|
222
134
|
|
223
135
|
desc 'recent SUBCOMMAND ...ARGS', 'list recent stuff'
|
224
|
-
subcommand 'recent', Recent
|
136
|
+
subcommand 'recent', Commands::Recent
|
225
137
|
|
226
138
|
desc 'space SUBCOMMAND ...ARGS', 'manage space'
|
227
|
-
subcommand 'space', Space
|
139
|
+
subcommand 'space', Commands::Space
|
228
140
|
|
229
141
|
desc 'type SUBCOMMAND ...ARGS', 'manage types'
|
230
|
-
subcommand 'type', Type
|
142
|
+
subcommand 'type', Commands::Type
|
231
143
|
|
232
|
-
desc '
|
233
|
-
subcommand '
|
144
|
+
desc 'user SUBCOMMAND ...ARGS', 'manage users'
|
145
|
+
subcommand 'user', Commands::User
|
234
146
|
|
235
|
-
desc '
|
236
|
-
subcommand '
|
147
|
+
desc 'watching SUBCOMMAND ...ARGS', 'manage watchings'
|
148
|
+
subcommand 'watching', Commands::Watching
|
237
149
|
|
238
|
-
desc '
|
239
|
-
subcommand '
|
150
|
+
desc 'webhook SUBCOMMAND ...ARGS', 'manage webhooks'
|
151
|
+
subcommand 'webhook', Commands::Webhook
|
240
152
|
|
241
153
|
desc 'wiki SUBCOMMAND ...ARGS', 'manage wikis'
|
242
|
-
subcommand 'wiki', Wiki
|
154
|
+
subcommand 'wiki', Commands::Wiki
|
243
155
|
end
|
244
156
|
end
|