github.rb
# Use the GitHub Contents API (https://developer.github.com/v3/repos/contents/)
# to write the compiled PDF to a named branch.
# Returns the URL to the PDF on GitHub
Use the GitHub Contents API
to write the compiled PDF to a named branch.
Returns the URL to the PDF on GitHub
Use the GitHub Contents API to write the compiled PDF to a named branch . Returns the URL to the PDF on GitHub
def create_git_pdf(file_path, issue_id, papers_repo, journal_alias)
    id = "%05d" % issue_id
    pdf_path = "#{journal_alias}.#{id}/10.21105.#{journal_alias}.#{id}.pdf"
    gh_response = github_client.create_contents(papers_repo,
                                                pdf_path,
                                                "Creating 10.21105.#{journal_alias}.#{id}.pdf",
                                                File.open("#{file_path.strip}").read,
                                                :branch => "#{journal_alias}.#{id}")
    return gh_response.content.html_url, gh_response.content.download_url
  end
def create_git_pdf ( file_path , issue_id , papers_repo , journal_alias ) id = "%05d" % issue_id pdf_path = "#{journal_alias}.#{id}/10.21105.#{journal_alias}.#{id}.pdf" gh_response = github_client . create_contents ( papers_repo , pdf_path , "Creating 10.21105.#{journal_alias}.#{id}.pdf" , File . open ( "#{file_path.strip}" ) . read , :branch => "#{journal_alias}.#{id}" ) return gh_response . content . html_url , gh_response . content . download_url end
Use the GitHub Contents API (https://developer.github.com/v3/repos/contents/)
to write the compiled PDF to a named branch.
Use the GitHub Contents API ( https : // developer . github . com / v3 / repos / contents / ) to write the compiled PDF to a named branch .
file_path
issue_id
papers_repo
journal_alias