crashwatcher/upload-gist.rb
def data(files, private_gist, description)
  i = 0
  file_data = {}
  files.each do |file|
    i = i + 1
    filename = file[:filename] ? file[:filename] : "gistfile#{i}"
    file_data[filename] = {:content => file[:input]}
  end
  
  data = {"files" => file_data}
  data.merge!({ 'description' => description }) unless description.nil?
  data.merge!({ 'public' => !private_gist })
  data
end
# Give an array of file information and private boolean, returns
# an appropriate payload for POSTing to gist.github.com
Give an array of file information and private boolean, returns
an appropriate payload for POSTing to gist.github.com
Give an array of file information and private boolean returns an appropriate payload for POSTing to gist . github . com
def data(files, private_gist, description)
  i = 0
  file_data = {}
  files.each do |file|
    i = i + 1
    filename = file[:filename] ? file[:filename] : "gistfile#{i}"
    file_data[filename] = {:content => file[:input]}
  end
  data = {"files" => file_data}
  data.merge!({ 'description' => description }) unless description.nil?
  data.merge!({ 'public' => !private_gist })
  data
end
def data ( files , private_gist , description ) i = 0 file_data = { } files . each do | file | i = i + 1 filename = file [ :filename ] ? file [ :filename ] : "gistfile#{i}" file_data [ filename ] = { :content => file [ :input ] } end data = { "files" => file_data } data . merge! ( { 'description' => description } ) unless description . nil? data . merge! ( { 'public' => ! private_gist } ) data end
Give an array of file information and private boolean, returns
an appropriate payload for POSTing to gist.github.com
Give an array of file information and private boolean returns an appropriate payload for POSTing to gist . github . com
files
private_gist
description