bl 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -5
- data/lib/bl.rb +1 -0
- data/lib/bl/cli.rb +30 -9
- data/lib/bl/version.rb +1 -1
- 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: f5b2c242ce34ece8e38c7828ab5a25aac2f7464b
|
4
|
+
data.tar.gz: 295b6de216301f8397e7974f2f5402dfc3cd6de1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f93bb48ebebc72ac568727707f205c779540929424baceab6c9154c0711b052de57c19761e181255af3470ca5887550565d04b6d28faeabacf7a790c7ecac480
|
7
|
+
data.tar.gz: 3cac2fea44ac3f4f8d704b633a848220a008993ef7f462b2831a85c91e5a3996e4bcaa487b32dbafafee97e9462419be92ead97220f0570584b7af23a5916da4
|
data/README.md
CHANGED
@@ -13,17 +13,25 @@ bl uses `~/.bl.yml` for configuration.
|
|
13
13
|
bl init
|
14
14
|
$EDITOR ~/.bl.yml
|
15
15
|
|
16
|
+
### .bl.yml Parameters
|
17
|
+
|
18
|
+
:space_id: '***' # your backlog space id
|
19
|
+
:api_key: '***' # your backlog api key
|
20
|
+
:project_key: '***' # your backlog project key
|
21
|
+
|
16
22
|
## Usage
|
17
23
|
|
18
24
|
bl activities # list activities
|
19
|
-
bl add
|
25
|
+
bl add *SUBJECTS # add issues
|
26
|
+
bl browse KEY # browse an issue
|
20
27
|
bl categories # list issue categories
|
21
|
-
bl close
|
28
|
+
bl close *KEYS # close issues
|
22
29
|
bl config # show config
|
23
30
|
bl count # count issues
|
24
31
|
bl help [COMMAND] # Describe available commands or one specific command
|
25
32
|
bl init # initialize a default config file
|
26
33
|
bl list # list issues
|
34
|
+
bl milestones # list milestones
|
27
35
|
bl priorities # list priorities
|
28
36
|
bl projects # list projects
|
29
37
|
bl resolutions # list resolutions
|
@@ -31,14 +39,20 @@ bl uses `~/.bl.yml` for configuration.
|
|
31
39
|
bl show KEY # show an issue's details
|
32
40
|
bl statuses # list statuses
|
33
41
|
bl types # list issue types
|
42
|
+
bl update KEY # update an issue
|
34
43
|
bl users # list space users
|
35
44
|
bl version # show version
|
36
45
|
|
37
|
-
|
46
|
+
### Example
|
47
|
+
|
48
|
+
update unassigned issues
|
49
|
+
|
50
|
+
bl list --unassigned | awk '{print $2}' | xargs -L 1 bl update --assigneeId 12345
|
51
|
+
|
52
|
+
add multi issues on list.txt
|
38
53
|
|
39
|
-
|
54
|
+
cat list.txt | xargs -I {} bl add {}
|
40
55
|
|
41
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
42
56
|
|
43
57
|
## Contributing
|
44
58
|
|
data/lib/bl.rb
CHANGED
data/lib/bl/cli.rb
CHANGED
@@ -50,14 +50,19 @@ module Bl
|
|
50
50
|
|
51
51
|
desc 'list', 'list issues'
|
52
52
|
option :all, type: :boolean
|
53
|
-
option :
|
53
|
+
option :unassigned, type: :boolean
|
54
|
+
option :today, type: :boolean
|
55
|
+
option :overdue, type: :boolean
|
54
56
|
def list
|
55
57
|
opts = {}
|
56
|
-
|
57
|
-
|
58
|
-
|
58
|
+
opts[:statusId] = [1, 2, 3] unless options[:all]
|
59
|
+
opts[:assigneeId] = [-1] if options[:unassigned]
|
60
|
+
if options[:today]
|
61
|
+
opts[:dueDateSince] = Date.today.to_s
|
62
|
+
opts[:dueDateUntil] = Date.today.next.to_s
|
59
63
|
end
|
60
|
-
|
64
|
+
opts[:dueDateUntil] = Date.today.to_s
|
65
|
+
@client.get('issues', opts).body.each do |i|
|
61
66
|
puts [
|
62
67
|
i.issueType.name,
|
63
68
|
i.issueKey,
|
@@ -133,7 +138,7 @@ module Bl
|
|
133
138
|
end
|
134
139
|
end
|
135
140
|
|
136
|
-
desc 'update
|
141
|
+
desc 'update *KEYS', 'update issues'
|
137
142
|
option :summary, type: :string
|
138
143
|
option :description, type: :string
|
139
144
|
option :issueTypeId, type: :numeric
|
@@ -144,9 +149,11 @@ module Bl
|
|
144
149
|
# TODO: status
|
145
150
|
# TODO: resolution
|
146
151
|
option :assigneeId, type: :numeric
|
147
|
-
def update(
|
148
|
-
|
149
|
-
|
152
|
+
def update(*keys)
|
153
|
+
keys.each do |k|
|
154
|
+
res = @client.patch("issues/#{k}", options.to_h)
|
155
|
+
puts "issue updated: #{res.body.issueKey}\t#{res.body.summary}"
|
156
|
+
end
|
150
157
|
end
|
151
158
|
|
152
159
|
desc 'close *KEYS', 'close issues'
|
@@ -227,5 +234,19 @@ module Bl
|
|
227
234
|
puts a.pretty_inspect
|
228
235
|
end
|
229
236
|
end
|
237
|
+
|
238
|
+
desc 'project-status PROJECT_ID', 'show project status'
|
239
|
+
def project_status(pid)
|
240
|
+
all_issues_count = @client.get('issues/count', projectId: [pid]).body.count
|
241
|
+
open_issues_count = @client.get('issues/count', projectId: [pid], statusId: [1]).body.count
|
242
|
+
in_progress_issues_count = @client.get('issues/count', projectId: [pid], statusId: [2]).body.count
|
243
|
+
resolved_issues_count = @client.get('issues/count', projectId: [pid], statusId: [3]).body.count
|
244
|
+
closed_issues_count = @client.get('issues/count', projectId: [pid], statusId: [4]).body.count
|
245
|
+
puts "#{closed_issues_count} / #{all_issues_count}"
|
246
|
+
puts "open: #{open_issues_count}"
|
247
|
+
puts "in progress: #{in_progress_issues_count}"
|
248
|
+
puts "resolved: #{resolved_issues_count}"
|
249
|
+
puts "closed: #{closed_issues_count}"
|
250
|
+
end
|
230
251
|
end
|
231
252
|
end
|
data/lib/bl/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.8
|
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-
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|