Class: Bl::Commands::Space
Instance Method Summary
collapse
Methods included from Printer
print_response, printable_issues
client, formatter, request
Constructor Details
#initialize ⇒ Space
Returns a new instance of Space.
4
5
6
7
|
# File 'lib/bl/commands/space.rb', line 4
def initialize(*)
@config = Bl::Config.instance
super
end
|
Instance Method Details
#disk_usage ⇒ Object
44
45
46
47
|
# File 'lib/bl/commands/space.rb', line 44
def disk_usage
res = request(:get, 'space/diskUsage')
print_space_disk_usage(res)
end
|
#get_notification ⇒ Object
31
32
33
34
|
# File 'lib/bl/commands/space.rb', line 31
def get_notification
res = request(:get, 'space/notification')
print_space_notification(res)
end
|
#image ⇒ Object
24
25
26
27
28
|
# File 'lib/bl/commands/space.rb', line 24
def image
body = request(:get, 'space/image').body
::File.open(body.filename, 'wb') { |f| f.write(body.content) }
puts "#{body.filename} generated."
end
|
#info ⇒ Object
10
11
12
13
|
# File 'lib/bl/commands/space.rb', line 10
def info
res = request(:get, 'space')
puts formatter.render(res.body, fields: SPACE_FIELDS)
end
|
#update_notification(content) ⇒ Object
37
38
39
40
41
|
# File 'lib/bl/commands/space.rb', line 37
def update_notification(content)
res = client.put('space/notification', content: content)
puts 'space notification updated'
print_space_notification(res)
end
|