# File lib/rudy/cli/aws/ec2/candy.rb, line 12
12:     def status
13:       url = 'http://status.aws.amazon.com/rss/EC2.rss'
14:       
15:       if (@@global.region || '').to_s.strip.match(/\Aeu/)
16:         url = 'http://status.aws.amazon.com/rss/EC2EU.rss'
17:       end
18:       
19:       # TODO: Move to Rudy::AWS
20:       ec2 = Rudy::Utils::RSSReader.run(url) || {}
21:       
22:       # TODO: Create Storable object
23:       if @@global.format == 'yaml'
24:         li ec2.to_yaml
25:       elsif @@global.format == 'json'
26:         require 'json'
27:         li ec2.to_json
28:       else
29:         li "#{ec2[:title]}"
30:         li "Updated: #{ec2[:pubdate]}"
31:         (ec2[:items] || []).each do |i|
32:           li
33:           li '%s' % i[:title]
34:           li '  %s: %s' % [i[:pubdate], i[:description]]
35:         end
36:         if ec2.empty? || ec2[:items].empty?
37:           li "No announcements" 
38:           return
39:         end
40:       end
41:       
42:       
43:       
44:     end