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 +4 -4
 - data/lib/bl/command.rb +20 -0
 - data/lib/bl/space.rb +20 -4
 - 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: 6f561d7d01920939ff153cd28a4732f1a1c9103c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e29a1f79d225eb012ed4fd1a2a423519b6717bbe
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9aed15e68ccda4de5c0c9aee00a0729a516385fb0059195b14d01e1f24385b6c1ead803f857dbd029db0d365eb9cb40dbb1758bf11ab7ac6a12e811e26db558d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ca472cc27a71fa58d5b88971713b33e89f519854ef7517a0454aa84ac2801532b90c089ad1a32ae150eca7b20d1e712c9931a1f17b911cca27934b592eb308d0
         
     | 
    
        data/lib/bl/command.rb
    CHANGED
    
    | 
         @@ -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
         
     | 
    
        data/lib/bl/space.rb
    CHANGED
    
    | 
         @@ -28,18 +28,34 @@ module Bl 
     | 
|
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                desc 'get-notification', 'get space notification'
         
     | 
| 
       30 
30 
     | 
    
         
             
                def get_notification
         
     | 
| 
       31 
     | 
    
         
            -
                   
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
       42 
     | 
    
         
            -
                   
     | 
| 
      
 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
         
     | 
    
        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.5. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-05-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: thor
         
     |