bl 0.0.13 → 0.0.14

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: 6b720e81c3ebfbf163c635b6ca68215699a826c9
4
- data.tar.gz: 5b6ee8827c48fd8fdd4f957cc2773b45dfe61398
3
+ metadata.gz: 559e35437d97c9d832b31cd792009ce160847b2c
4
+ data.tar.gz: e8ad94555dd438c2e3119e2bbe9b8e1e8f177f16
5
5
  SHA512:
6
- metadata.gz: 3beabe677463c1e4807c5157146bdfd6d94fc06bed84db1b17b2bce6cb5e002a1011d175f26ceada56317961deca071de4cf95046698e8411aa79067d5a79fa9
7
- data.tar.gz: 28ed0c1db7c8e04f20f340a5200809b3d3580568f2e6e637ae7ac2798e36410ba2961e72bcb001f0b76e8dde7f165eb775ffbc921533684d65b8e2e0e2969de8
6
+ metadata.gz: 6c58386ada3ba1179939ac55110e26ecda0a5f76548b4acabd81d67276e9b15dea5143eb7eb10e60fe0a70062b1c2e04bbb01e1e18a46cd8d2b37d876ccb18b9
7
+ data.tar.gz: 6cd708c609005232236c5ca3bdea35e7dbbbb00e9ae7492fd139697681e3c8cd1f276f445a269dc992f3d5b5e506eac8812a12b42550755112b50662dcf48fe7
data/README.md CHANGED
@@ -21,27 +21,29 @@ bl uses `~/.bl.yml` for configuration.
21
21
 
22
22
  ## Usage
23
23
 
24
- bl activities # list activities
25
- bl add *SUBJECTS # add issues
26
- bl browse KEY # browse an issue
27
- bl categories # list issue categories
28
- bl close *KEYS # close issues
29
- bl config # show config
30
- bl count # count issues
31
- bl help [COMMAND] # Describe available commands or one specific command
32
- bl init # initialize a default config file
33
- bl list # list issues
34
- bl milestones # list milestones
35
- bl priorities # list priorities
36
- bl projects # list projects
37
- bl resolutions # list resolutions
38
- bl search # search issues
39
- bl show KEY # show an issue's details
40
- bl statuses # list statuses
41
- bl types # list issue types
42
- bl update KEY # update an issue
43
- bl users # list space users
44
- bl version # show version
24
+ bl activities # list activities
25
+ bl add [SUBJECT...] # add issues
26
+ bl browse KEY # browse an issue
27
+ bl category SUBCOMMAND ...ARGS # manage categoryies
28
+ bl close [KEY...] # close issues
29
+ bl config # show config
30
+ bl count # count issues
31
+ bl help [COMMAND] # Describe available commands or one specific command
32
+ bl init # initialize a default config file
33
+ bl list # list issues
34
+ bl milestone SUBCOMMAND ...ARGS # manage milestones
35
+ bl priorities # list priorities
36
+ bl project SUBCOMMAND ...ARGS # manage projects
37
+ bl resolutions # list resolutions
38
+ bl search # search issues
39
+ bl show KEY # show an issue's details
40
+ bl statuses # list statuses
41
+ bl type SUBCOMMAND ...ARGS # manage types
42
+ bl update [KEY...] # update issues
43
+ bl users # list space users
44
+ bl version # show version
45
+ bl wiki SUBCOMMAND ...ARGS # manage wikis
46
+
45
47
 
46
48
  ### Example
47
49
 
data/lib/bl.rb CHANGED
@@ -8,6 +8,8 @@ require 'bl/requestable'
8
8
  require 'bl/type'
9
9
  require 'bl/category'
10
10
  require 'bl/milestone'
11
+ require 'bl/wiki'
12
+ require 'bl/project'
11
13
  require 'bl/cli'
12
14
 
13
15
  Bl::CLI.start(ARGV)
@@ -29,7 +29,7 @@ module Bl
29
29
 
30
30
  desc 'config', 'show config'
31
31
  def config
32
- puts @config
32
+ p @config
33
33
  end
34
34
 
35
35
  desc 'init', 'initialize a default config file'
@@ -128,7 +128,7 @@ module Bl
128
128
  system("open #{url}")
129
129
  end
130
130
 
131
- desc 'add *SUBJECTS', 'add issues'
131
+ desc 'add [SUBJECT...]', 'add issues'
132
132
  options ISSUE_BASE_ATTRIBUTES
133
133
  def add(*subjects)
134
134
  subjects.each do |s|
@@ -146,7 +146,7 @@ module Bl
146
146
  end
147
147
  end
148
148
 
149
- desc 'update *KEYS', 'update issues'
149
+ desc 'update [KEY...]', 'update issues'
150
150
  options ISSUE_BASE_ATTRIBUTES
151
151
  option :comment, type: :string
152
152
  def update(*keys)
@@ -156,7 +156,7 @@ module Bl
156
156
  end
157
157
  end
158
158
 
159
- desc 'close *KEYS', 'close issues'
159
+ desc 'close [KEY...]', 'close issues'
160
160
  def close(*keys)
161
161
  keys.each do |k|
162
162
  res = client.patch("issues/#{k}", statusId: 4)
@@ -164,13 +164,6 @@ module Bl
164
164
  end
165
165
  end
166
166
 
167
- desc 'projects', 'list projects'
168
- def projects
169
- client.get('projects').body.each do |p|
170
- puts [p.id, p.projectKey, p.name].join("\t")
171
- end
172
- end
173
-
174
167
  desc 'statuses', 'list statuses'
175
168
  def statuses
176
169
  client.get('statuses').body.each do |s|
@@ -215,37 +208,10 @@ module Bl
215
208
  desc 'milestone SUBCOMMAND ...ARGS', 'manage milestones'
216
209
  subcommand 'milestone', Milestone
217
210
 
218
- desc 'project-status PROJECT_ID', 'show project status'
219
- def project_status(pid)
220
- all_issues_count = client.get('issues/count', projectId: [pid]).body.count
221
- open_issues_count = client.get('issues/count', projectId: [pid], statusId: [1]).body.count
222
- in_progress_issues_count = client.get('issues/count', projectId: [pid], statusId: [2]).body.count
223
- resolved_issues_count = client.get('issues/count', projectId: [pid], statusId: [3]).body.count
224
- closed_issues_count = client.get('issues/count', projectId: [pid], statusId: [4]).body.count
225
- puts "#{closed_issues_count} / #{all_issues_count}"
226
- puts "open: #{open_issues_count}"
227
- puts "in progress: #{in_progress_issues_count}"
228
- puts "resolved: #{resolved_issues_count}"
229
- puts "closed: #{closed_issues_count}"
230
- end
231
-
232
- desc 'wikis', 'list wikis'
233
- def wikis
234
- client.get('wikis', projectIdOrKey: @config[:project_key]).body.each do |w|
235
- puts [w.id, w.projectId, w.name, w.updated].join("\t")
236
- end
237
- end
211
+ desc 'wiki SUBCOMMAND ...ARGS', 'manage wikis'
212
+ subcommand 'wiki', Wiki
238
213
 
239
- desc 'wiki WIKI_ID', "show a wiki's content"
240
- def wiki(wiki_id)
241
- body = client.get("wikis/#{wiki_id}").body
242
- puts "id: #{body.id}"
243
- puts "projectId: #{body.projectId}"
244
- puts "name: #{body.name}"
245
- puts "updated: #{body.updated}"
246
- puts '--'
247
- puts 'content:'
248
- puts body.content
249
- end
214
+ desc 'project SUBCOMMAND ...ARGS', 'manage projects'
215
+ subcommand 'project', Project
250
216
  end
251
217
  end
@@ -0,0 +1,39 @@
1
+ module Bl
2
+ class Project < Thor
3
+ include Bl::Requestable
4
+
5
+ def initialize(*)
6
+ @config = Bl::Config.instance
7
+ @url = 'projects'
8
+ super
9
+ end
10
+
11
+ desc 'list', 'list projects'
12
+ def list
13
+ client.get(@url).body.each do |p|
14
+ puts [p.id, p.projectKey, p.name].join("\t")
15
+ end
16
+ end
17
+
18
+ desc 'status ID', 'show project status'
19
+ def status(id)
20
+ all_issues_count = client.get('issues/count', projectId: [id]).body.count
21
+ open_issues_count = client.get('issues/count', projectId: [id], statusId: [1]).body.count
22
+ in_progress_issues_count = client.get('issues/count', projectId: [id], statusId: [2]).body.count
23
+ resolved_issues_count = client.get('issues/count', projectId: [id], statusId: [3]).body.count
24
+ closed_issues_count = client.get('issues/count', projectId: [id], statusId: [4]).body.count
25
+ puts "#{closed_issues_count} / #{all_issues_count}"
26
+ puts "open: #{open_issues_count}"
27
+ puts "in progress: #{in_progress_issues_count}"
28
+ puts "resolved: #{resolved_issues_count}"
29
+ puts "closed: #{closed_issues_count}"
30
+ end
31
+
32
+ desc 'users ID', 'show project users'
33
+ def users(id)
34
+ client.get("#{@url}/#{id}/users").body.each do |u|
35
+ puts [u.id, u.userId, u.name, u.roleType, u.lang, u.mailAddress].join("\t")
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
@@ -0,0 +1,30 @@
1
+ module Bl
2
+ class Wiki < Thor
3
+ include Bl::Requestable
4
+
5
+ def initialize(*)
6
+ @config = Bl::Config.instance
7
+ @url = 'wikis'
8
+ super
9
+ end
10
+
11
+ desc 'list', 'list wikis'
12
+ def list
13
+ client.get(@url, projectIdOrKey: @config[:project_key]).body.each do |w|
14
+ puts [w.id, w.projectId, w.name, w.updated].join("\t")
15
+ end
16
+ end
17
+
18
+ desc 'show ID', "show a wiki's content"
19
+ def show(id)
20
+ body = client.get("#{@url}/#{id}").body
21
+ puts "id: #{body.id}"
22
+ puts "projectId: #{body.projectId}"
23
+ puts "name: #{body.name}"
24
+ puts "updated: #{body.updated}"
25
+ puts '--'
26
+ puts 'content:'
27
+ puts body.content
28
+ end
29
+ end
30
+ end
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.13
4
+ version: 0.0.14
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-07 00:00:00.000000000 Z
11
+ date: 2016-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -131,9 +131,11 @@ files:
131
131
  - lib/bl/cli.rb
132
132
  - lib/bl/config.rb
133
133
  - lib/bl/milestone.rb
134
+ - lib/bl/project.rb
134
135
  - lib/bl/requestable.rb
135
136
  - lib/bl/type.rb
136
137
  - lib/bl/version.rb
138
+ - lib/bl/wiki.rb
137
139
  homepage: https://github.com/sakihet/bl
138
140
  licenses:
139
141
  - MIT