summaryrefslogtreecommitdiff
path: root/app/models/blob.rb
Commit message (Collapse)AuthorAgeFilesLines
* Detect if file that appears to be text in the first 1024 bytes is actually ↵dm-blob-binaryness-changeDouwe Maan2017-06-081-2/+5
| | | | binary afer loading all data
* Merge branch 'dm-blob-file-type' into 'master'Grzegorz Bizon2017-06-081-0/+4
|\ | | | | | | | | Add Blob#file_type convenience method See merge request !11982
| * Add Blob#file_type convenience methoddm-blob-file-typeDouwe Maan2017-06-081-0/+4
| |
* | Merge branch 'dm-empty-blob-viewer-binary' into 'master'Grzegorz Bizon2017-06-081-1/+1
|\ \ | |/ |/| | | | | Empty blob viewer isn’t binary-only See merge request !11979
| * Empty blob viewer isn’t binary-onlydm-empty-blob-viewer-binaryDouwe Maan2017-06-071-1/+1
| |
* | Blob#load_all_data! doesn’t need an argumentblob-load-all-dataDouwe Maan2017-06-071-0/+4
|/
* Consistent diff and blob size limit namesDouwe Maan2017-05-291-8/+4
|
* Merge branch 'dm-gemfile-viewer'Rémy Coutable2017-05-181-1/+13
|\ | | | | | | See merge request !11346.
| * Add auxiliary blob viewers to dependency filesDouwe Maan2017-05-171-1/+13
| |
* | Add auxiliary viewer for READMEdm-readme-viewerDouwe Maan2017-05-171-0/+1
|/
* Add auxiliary blob viewer for CHANGELOGDouwe Maan2017-05-171-1/+2
|
* Add auxiliary viewer for CONTRIBUTINGdm-contributing-viewerDouwe Maan2017-05-161-1/+3
|
* Implement auxiliary blob viewersDouwe Maan2017-05-101-12/+22
|
* Enable the Style/TrailingCommaInLiteral copRémy Coutable2017-05-101-1/+1
| | | | | | Use the EnforcedStyleForMultiline: no_comma option. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'balsalmiq-support' into 'master' Phil Hughes2017-05-051-0/+1
|\ | | | | | | | | Initial balsamiq support See merge request !10564
| * Merge branch 'master' into balsalmiq-supportLuke "Jared" Bennett2017-04-301-0/+2
| |\
| * \ Merge branch 'master' into balsalmiq-supportLuke "Jared" Bennett2017-04-281-60/+118
| |\ \
| * | | BE review changesLuke "Jared" Bennett2017-04-121-1/+1
| | | |
| * | | Merge branch 'master' into 'balsalmiq-support'Luke "Jared" Bennett2017-04-121-5/+25
| |\ \ \ | | | | | | | | | | | | | | | # Conflicts: # app/models/blob.rb
| * | | | Initial balsamiq supportJacob Schatz2017-04-101-0/+6
| | | | |
* | | | | Refactor Blob support of external storage in preparation of job artifact blobsdm-blob-external-storageDouwe Maan2017-05-031-16/+30
| |_|_|/ |/| | |
* | | | Display video blobs in-line like imagesdm-video-viewerDouwe Maan2017-04-281-0/+2
| |_|/ |/| |
* | | Explain how viewers are selected from RICH_VIEWERSDouwe Maan2017-04-271-7/+27
| | |
* | | Add specsDouwe Maan2017-04-271-2/+2
| | |
* | | Small code tweaksDouwe Maan2017-04-271-12/+18
| | |
* | | Add BlobViewer::Base#binary? methodDouwe Maan2017-04-271-20/+24
| | |
* | | Refactor overriding max sizeDouwe Maan2017-04-271-3/+8
| | |
* | | Address feedbackDouwe Maan2017-04-271-5/+3
| | |
* | | Add test stubsDouwe Maan2017-04-271-2/+2
| | |
* | | Add rich blob viewersDouwe Maan2017-04-271-0/+8
| | |
* | | Refactor Blob and add BlobViewer::BaseDouwe Maan2017-04-271-56/+70
| | |
* | | Pass project to BlobDouwe Maan2017-04-271-2/+10
| |/ |/|
* | Don't show 'Copy content' button on text files that are not rendered as textDouwe Maan2017-04-101-5/+25
|/
* STL file viewerPhil Hughes2017-04-061-0/+6
|
* Use PDFLab to render PDFs in GitLabSam Rose2017-04-051-0/+6
|
* Load a preview of Sketch 43 filessketch-preview-filesJacob Schatz2017-04-051-0/+6
| | | | | | | Sketch 43 files are technically a zip file, so the JavaScript opens the zip file & locates a preview.png which is just a quick preview of the last sketch page edited. After that is loaded it simply places the image into the DOM
* Added worksheets support to notebook viewerPhil Hughes2017-03-301-1/+1
| | | | Updated some Ruby code based on comments
* Started iPython notebook viewerPhil Hughes2017-03-231-0/+6
| | | | | | Using NotebookLab library [ci skip]
* Do not show LFS object when LFS is disabledChristopher Bartz2017-03-131-2/+6
| | | | | | Do not display a 404, when a user tries to retrieve the raw content of an LFS file (pointer) if the config option "lfs_enabled" is set to false. Instead, display the LFS pointer file directly.
* Handle encoding in non-binary Blob instancesupdate-gitlab-gitYorick Peterse2016-09-141-0/+12
| | | | | | | | | | | | | | | | gitlab_git 10.6.4 relies on Rugged marking blobs as binary or not, instead of relying on Linguist. Linguist in turn would mark text blobs as binary whenever they would contain byte sequences that could not be encoded using UTF-8. However, marking such blobs as binary is not correct. If one pushes a Markdown document with invalid character sequences it's still a text based Markdown document and not some random binary blob. This commit overwrites Blob#data so it automatically converts text-based content to UTF-8 (the encoding we use everywhere else) while taking care of replacing any invalid sequences with the UTF-8 replacement character. The data of binary blobs is left as-is.
* Limit the size of SVGs when viewing them as blobssvg-render-size-limitYorick Peterse2016-08-151-0/+7
| | | | | | | | | This ensures that SVGs greater than 2 megabytes are not scrubbed and rendered. This in turn prevents requests from timing out due to reading/scrubbing large SVGs potentially taking a lot of time (and memory). The use of 2 megabytes is completely arbitrary. Fixes gitlab-org/gitlab-ce#1435
* Ensure relative paths for video are rewritten as we do for images20189-markdown-video-doesn-t-work-when-the-referenced-video-file-is-in-same-repoRémy Coutable2016-07-261-0/+4
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix Error 500 when viewing a blob with binary characters after the 1024-byte ↵Stan Hu2016-06-121-1/+1
| | | | | | | | | | | | | | | | mark Here was the problem: 1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file. 2. If the blob is text, GitLab will attempt to display it. 3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters. 4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT. To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires an update to gitlab_git: gitlab-org/gitlab_git!86 Closes #13826
* Properly handle bigger filesZeger-Jan van de Weg2016-04-281-0/+8
|
* Refactor caching codeJacob Vosmaer2016-03-071-0/+3
|
* Add a `Blob` model that wraps `Gitlab::Git::Blob`rs-blobRobert Speicher2016-02-181-0/+34
This allows us to take advantage of Rails' `to_partial_path` to render the correct partial based on the Blob type, rather than cluttering the view with conditionals. It also allows (and will allow in the future) better encapsulation for Blob-related logic which makes sense for our Rails app but might not make as much sense for the core `gitlab_git` library, such as detecting if the blob is an SVG.