bl 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 626f60af1ef5bbb4826c638651491678d100bc17
4
- data.tar.gz: 9bb8afac7c45900cf10d422aef4c7d7a074e5551
3
+ metadata.gz: 6f561d7d01920939ff153cd28a4732f1a1c9103c
4
+ data.tar.gz: e29a1f79d225eb012ed4fd1a2a423519b6717bbe
5
5
  SHA512:
6
- metadata.gz: 799682459b708731fa859797a29177e4e88dce270862ec2248bb4ccce413241b4bcd49804fbed14da898b98076f1ed4d885f46837cb3bf79f699d0843975242e
7
- data.tar.gz: 19330e9ba70afff70f7a34c0cae19cb14670212cdebc8ccd98bf533779213217cf6511f9e49dbf342137ada862dacb7a91a60738c6977763210422c7d46dfb02
6
+ metadata.gz: 9aed15e68ccda4de5c0c9aee00a0729a516385fb0059195b14d01e1f24385b6c1ead803f857dbd029db0d365eb9cb40dbb1758bf11ab7ac6a12e811e26db558d
7
+ data.tar.gz: ca472cc27a71fa58d5b88971713b33e89f519854ef7517a0454aa84ac2801532b90c089ad1a32ae150eca7b20d1e712c9931a1f17b911cca27934b592eb308d0
@@ -125,6 +125,22 @@ module Bl
125
125
  {id: 5, name: 'Guest Reporter'},
126
126
  {id: 6, name: 'Guest Viewer'}
127
127
  ]
128
+ SPACE_DISK_USAGE = %i(
129
+ capacity
130
+ issue
131
+ wiki
132
+ file
133
+ subversion
134
+ git
135
+ )
136
+ SPACE_DISK_USAGE_DETAILS_FIELDS = %i(
137
+ projectId
138
+ issue
139
+ wiki
140
+ file
141
+ subversion
142
+ git
143
+ )
128
144
  SPACE_FIELDS = %i(
129
145
  spaceKey
130
146
  name
@@ -136,6 +152,10 @@ module Bl
136
152
  created
137
153
  updated
138
154
  )
155
+ SPACE_NOTIFICATION_FIELDS = %i(
156
+ content
157
+ updated
158
+ )
139
159
  TYPE_COLORS = %w(
140
160
  #e30000
141
161
  #934981
@@ -28,18 +28,34 @@ module Bl
28
28
 
29
29
  desc 'get-notification', 'get space notification'
30
30
  def get_notification
31
- puts client.get('space/notification').body.content
31
+ res = client.get('space/notification')
32
+ print_space_notification(res)
32
33
  end
33
34
 
34
35
  desc 'update-notification CONTENT', 'update space notification'
35
36
  def update_notification(content)
36
- client.put('space/notification', content: content)
37
+ res = client.put('space/notification', content: content)
38
+ puts 'space notification updated'
39
+ print_space_notification(res)
37
40
  end
38
41
 
39
42
  desc 'disk-usage', 'get space disk usage'
40
43
  def disk_usage
41
- capacity = client.get('space/diskUsage').body.capacity
42
- puts "capacity: #{capacity}"
44
+ res = client.get('space/diskUsage')
45
+ print_space_disk_usage(res)
46
+ end
47
+
48
+ private
49
+
50
+ def print_space_notification(res)
51
+ puts formatter.render(res.body, fields: SPACE_NOTIFICATION_FIELDS)
52
+ end
53
+
54
+ def print_space_disk_usage(res)
55
+ puts 'summary:'
56
+ puts formatter.render(res.body, fields: SPACE_DISK_USAGE)
57
+ puts 'details:'
58
+ res.body.details.map { |v| puts formatter.render(v, fields: SPACE_DISK_USAGE_DETAILS_FIELDS) }
43
59
  end
44
60
  end
45
61
  end
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.5.10'.freeze
2
+ VERSION = '0.5.11'.freeze
3
3
  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.5.10
4
+ version: 0.5.11
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-04 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor