bin/rtanque in rtanque-0.1.1 vs bin/rtanque in rtanque-0.1.2
- old
+ new
@@ -94,18 +94,24 @@
end
end
end
def download_gist(gist_id, options)
- gist = Octokit.gist(gist_id)
- gist.files.values.map do |gist_file|
- gist_path = "#{BOT_DIR}/#{gist.user.login}.#{gist_id}/#{gist_file.filename}"
- create_file(gist_path, gist_file.content, options)
+ client = Octokit::Client.new
+ begin
+ gist = client.gist(gist_id)
+ rescue Octokit::NotFound
+ puts set_color("Error! Gist #{gist_id} not found. Please ensure the gist id is correct.", :red)
+ else
+ gist.files.attrs.each do |name, gist_file|
+ gist_path = "#{BOT_DIR}/#{gist.user.login}.#{gist_id}/#{name}"
+ create_file(gist_path, gist_file.content, options)
+ end
end
end
def print_stats(indent = 2, &block)
self.print_table([].tap(&block), :indent => indent)
end
end
-RTanqueCLI.start
\ No newline at end of file
+RTanqueCLI.start