lib/github_bot/github/client.rb
# Public: Retrieve the contents of a file
#
# @param file [Sawyer::Resource] The file for retrieving contents
Retrieve the contents of a file
Retrieve the contents of a file
def file_content(file)
        raw_contents file
      rescue Octokit::NotFound
        ''
      rescue Octokit::Forbidden => e
        if e.errors.any? && e.errors.first[:code] == 'too_large'
          return URI.parse(file.raw_url).open.read
        end
        raise e
      end
def file_content ( file ) raw_contents file rescue Octokit :: NotFound '' rescue Octokit :: Forbidden => e if e . errors . any? && e . errors . first [ :code ] == 'too_large' return URI . parse ( file . raw_url ) . open . read end raise e end
Public: Retrieve the contents of a file
Public : Retrieve the contents of a file
# revert to using the raw_url for getting the content
file
The file for retrieving contents
The file for retrieving contents