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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 16bd1cac3a14051361cc6988574a9cc8f9cf6697
4
- data.tar.gz: be527cd14ce53c2bc14c244388731c573a4d015d
2
+ SHA256:
3
+ metadata.gz: 5a7f3deae6619e2567d54136abe3d58bcbf216eda04268e1c42334a5a670f915
4
+ data.tar.gz: d016ba457cf66eeb5f870347edc89fd840ae9283c020fed5f2bb2331fbb42de2
5
5
  SHA512:
6
- metadata.gz: 2d8af6be1801884f5084eacd2bef859804eece21647c808283fe49832ca4bd213f52a6cb8fa6a9fe808e6442c6273ddfd4986a711cd112c7c8ff0847f28b96f7
7
- data.tar.gz: 84bc6c4187d7488f3578e83937f16ed543afd28b97d39a74cfbbf50e87c3a92972cf49cfb8e73477195f8d459a7759081e91ac18520c0dd1069584797ef001b8
6
+ metadata.gz: f5260df8b19676f429367617f8ff9445dd1282a5d6d2c0de8cc2862f9d3cd996e9f3e0c6c0b57e61c5da262bc10431b1bdaf141fe5a8ea6a1bd88afa4a3098cf
7
+ data.tar.gz: 61bdd9b05e1734337f16ea27172e9e9eef9f18f2f7b2acd402c8ca9758f4fd35779aeeb1ab68ec79135515e8831358d7d9c60066bb17302dcf63bf1723899095
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
- before_install: gem install bundler -v 1.11.2
3
+ - 2.4.2
4
+ before_install:
5
+ - gem update --system
6
+ - gem --version
7
+ - gem install bundler -v 1.16.0
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...] # add issues
54
- bl browse KEY # browse an issue
55
- bl category SUBCOMMAND ...ARGS # manage categories
56
- bl close [KEY...] # close issues
57
- bl config # show config
58
- bl count # count issues
59
- bl edit KEY # edit issues' description by $EDITOR
60
- bl file SUBCOMMAND ...ARGS # manage files
61
- bl gitrepo SUBCOMMAND ...ARGS # show gitrepos
62
- bl groups SUBCOMMAND ...ARGS # manage groups
63
- bl help [COMMAND] # Describe available commands or one specific command
64
- bl init # initialize a default config file
65
- bl list # list issues by typical ways
66
- bl milestone SUBCOMMAND ...ARGS # manage milestones
67
- bl notifications SUBCOMMAND ...ARGS # manage notifications
68
- bl priorities # list priorities
69
- bl project SUBCOMMAND ...ARGS # manage projects
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 users SUBCOMMAND ...ARGS # manage users
80
- bl version # show version
81
- bl watchings SUBCOMMAND ...ARGS # manage watchings
82
- bl webhooks SUBCOMMAND ...ARGS # manage webhooks
83
- bl wiki SUBCOMMAND ...ARGS # manage wikis
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
- 'groups list',
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
- 'users list',
85
- 'users myself',
86
- 'webhooks list',
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::VERSION
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.5'
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
@@ -2,37 +2,38 @@
2
2
 
3
3
  ```
4
4
  Commands:
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 groups 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 notifications SUBCOMMAND ...ARGS # manage notifications
20
- bl priorities # list priorities
21
- bl project SUBCOMMAND ...ARGS # manage projects
22
- bl recent SUBCOMMAND ...ARGS # list recent stuff
23
- bl resolutions # list resolutions
24
- bl roles # list roles
25
- bl search # search issues
26
- bl show KEY # show an issue's details
27
- bl space SUBCOMMAND ...ARGS # manage space
28
- bl statuses # list statuses
29
- bl type SUBCOMMAND ...ARGS # manage types
30
- bl update [KEY...] # update issues
31
- bl users SUBCOMMAND ...ARGS # manage users
32
- bl version # show version
33
- bl watchings SUBCOMMAND ...ARGS # manage watchings
34
- bl webhooks SUBCOMMAND ...ARGS # manage webhooks
35
- bl wiki SUBCOMMAND ...ARGS # manage wikis
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/milestone'
17
- require 'bl/wiki'
18
- require 'bl/project'
19
- require 'bl/recent'
20
- require 'bl/file'
21
- require 'bl/gitrepo'
22
- require 'bl/pull_request'
23
- require 'bl/users'
24
- require 'bl/groups'
25
- require 'bl/webhooks'
26
- require 'bl/notifications'
27
- require 'bl/watchings'
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
 
@@ -7,7 +7,7 @@ module Bl
7
7
 
8
8
  desc 'version', 'show version'
9
9
  def version
10
- puts Bl::VERSION
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 'groups SUBCOMMAND ...ARGS', 'manage groups'
209
- subcommand 'groups', Groups
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
- desc 'notifications SUBCOMMAND ...ARGS', 'manage notifications'
215
- subcommand 'notifications', Notifications
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 'users SUBCOMMAND ...ARGS', 'manage users'
233
- subcommand 'users', Users
144
+ desc 'user SUBCOMMAND ...ARGS', 'manage users'
145
+ subcommand 'user', Commands::User
234
146
 
235
- desc 'watchings SUBCOMMAND ...ARGS', 'manage watchings'
236
- subcommand 'watchings', Watchings
147
+ desc 'watching SUBCOMMAND ...ARGS', 'manage watchings'
148
+ subcommand 'watching', Commands::Watching
237
149
 
238
- desc 'webhooks SUBCOMMAND ...ARGS', 'manage webhooks'
239
- subcommand 'webhooks', Webhooks
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