An amazing tutorial from Matt Greensmith with an answer for this appeared on his blog that I totally recommend checking out.
require 'octokit'
#github = Octokit::Client.new(:login => "me", :password => "sekret")
# set up some vars:
repo = 'me/myrepo'
ref = 'heads/master'
sha_latest_commit = github.ref(repo, ref).object.sha
sha_base_tree = github.commit(repo, sha_latest_commit).commit.tree.sha
file_name = File.join("some_dir", "new_file.txt")
blob_sha = github.create_blob(repo, Base64.encode64(my_content), "base64")
sha_new_tree = github.create_tree(repo,
[ { :path => file_name,
:mode => "100644",
:type => "blob",
:sha => blob_sha } ],
{:base_tree => sha_base_tree }).sha
commit_message = "Committed via Octokit!"
sha_new_commit = github.create_commit(repo, commit_message, sha_new_tree, sha_latest_commit).sha
updated_ref = github.update_ref(repo, ref, sha_new_commit)
puts updated_ref