| 52 | end |
| 53 | |
| 54 | def commands |
| 55 | return @commands if @commands |
| 56 | |
| 57 | require "rubygems" |
| 58 | require "net/http" |
| 59 | require "net/https" |
| 60 | require "json" |
| 61 | require "uri" |
| 62 | |
| 63 | url = URI.parse "https://raw.githubusercontent.com/redis/redis-doc/master/commands.json" |
| 64 | client = Net::HTTP.new url.host, url.port |
| 65 | client.use_ssl = true |
| 66 | response = client.get url.path |
| 67 | if response.is_a?(Net::HTTPSuccess) |
| 68 | @commands = JSON.parse(response.body) |
| 69 | else |
| 70 | response.error! |
| 71 | end |
| 72 | end |
| 73 | |
| 74 | def generate_groups |
| 75 | GROUPS.map do |n| |