diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-24 20:51:56 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-04-27 20:23:26 +0300 |
commit | 0b3ff9c80494307746f79c05f85cfbedc0efe3f6 (patch) | |
tree | 59716f7c2ecd9e96a1ffadf22e6fdf95058f7550 /app/models/blob_viewer | |
parent | a2f4650fc7e5407bbed1f73771306d12823f47da (diff) |
Set BlobViewer::Base.binary instead of .text
Diffstat (limited to 'app/models/blob_viewer')
-rw-r--r-- | app/models/blob_viewer/base.rb | 10 | ||||
-rw-r--r-- | app/models/blob_viewer/binary_stl.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/download.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/empty.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/image.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/markup.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/notebook.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/pdf.rb | 4 | ||||
-rw-r--r-- | app/models/blob_viewer/sketch.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/svg.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/text.rb | 2 | ||||
-rw-r--r-- | app/models/blob_viewer/text_stl.rb | 2 |
12 files changed, 17 insertions, 17 deletions
diff --git a/app/models/blob_viewer/base.rb b/app/models/blob_viewer/base.rb index ae90d977f03..d44d5c70fbb 100644 --- a/app/models/blob_viewer/base.rb +++ b/app/models/blob_viewer/base.rb @@ -1,6 +1,6 @@ module BlobViewer class Base - class_attribute :partial_name, :type, :extensions, :client_side, :text_based, :switcher_icon, :switcher_title, :max_size, :absolute_max_size + class_attribute :partial_name, :type, :extensions, :client_side, :binary, :switcher_icon, :switcher_title, :max_size, :absolute_max_size delegate :partial_path, :rich?, :simple?, :client_side?, :server_side?, :text?, :binary?, to: :class @@ -31,12 +31,12 @@ module BlobViewer !client_side? end - def self.text? - text_based + def self.binary? + binary end - def self.binary? - !text? + def self.text? + !binary? end def self.can_render?(blob) diff --git a/app/models/blob_viewer/binary_stl.rb b/app/models/blob_viewer/binary_stl.rb index 6cb54d49d86..80393471ef2 100644 --- a/app/models/blob_viewer/binary_stl.rb +++ b/app/models/blob_viewer/binary_stl.rb @@ -5,6 +5,6 @@ module BlobViewer self.partial_name = 'stl' self.extensions = %w(stl) - self.text_based = false + self.binary = true end end diff --git a/app/models/blob_viewer/download.rb b/app/models/blob_viewer/download.rb index dbd6f07dbc8..7bc45fe992c 100644 --- a/app/models/blob_viewer/download.rb +++ b/app/models/blob_viewer/download.rb @@ -7,7 +7,7 @@ module BlobViewer include ClientSide self.partial_name = 'download' - self.text_based = false + self.binary = true def render_error nil diff --git a/app/models/blob_viewer/empty.rb b/app/models/blob_viewer/empty.rb index 60003a7c12a..d9d128eb273 100644 --- a/app/models/blob_viewer/empty.rb +++ b/app/models/blob_viewer/empty.rb @@ -4,6 +4,6 @@ module BlobViewer include ServerSide self.partial_name = 'empty' - self.text_based = false + self.binary = true end end diff --git a/app/models/blob_viewer/image.rb b/app/models/blob_viewer/image.rb index b78f82df38f..c4eae5c79c2 100644 --- a/app/models/blob_viewer/image.rb +++ b/app/models/blob_viewer/image.rb @@ -5,7 +5,7 @@ module BlobViewer self.partial_name = 'image' self.extensions = UploaderHelper::IMAGE_EXT - self.text_based = false + self.binary = true self.switcher_icon = 'picture-o' self.switcher_title = 'image' end diff --git a/app/models/blob_viewer/markup.rb b/app/models/blob_viewer/markup.rb index 34740661320..8fdbab30dd1 100644 --- a/app/models/blob_viewer/markup.rb +++ b/app/models/blob_viewer/markup.rb @@ -5,6 +5,6 @@ module BlobViewer self.partial_name = 'markup' self.extensions = Gitlab::MarkupHelper::EXTENSIONS - self.text_based = true + self.binary = false end end diff --git a/app/models/blob_viewer/notebook.rb b/app/models/blob_viewer/notebook.rb index c5231f1e691..8632b8a9885 100644 --- a/app/models/blob_viewer/notebook.rb +++ b/app/models/blob_viewer/notebook.rb @@ -5,7 +5,7 @@ module BlobViewer self.partial_name = 'notebook' self.extensions = %w(ipynb) - self.text_based = true + self.binary = false self.switcher_icon = 'file-text-o' self.switcher_title = 'notebook' end diff --git a/app/models/blob_viewer/pdf.rb b/app/models/blob_viewer/pdf.rb index 1067388c72a..65805f5f388 100644 --- a/app/models/blob_viewer/pdf.rb +++ b/app/models/blob_viewer/pdf.rb @@ -2,10 +2,10 @@ module BlobViewer class PDF < Base include Rich include ClientSide - + self.partial_name = 'pdf' self.extensions = %w(pdf) - self.text_based = false + self.binary = true self.switcher_icon = 'file-pdf-o' self.switcher_title = 'PDF' end diff --git a/app/models/blob_viewer/sketch.rb b/app/models/blob_viewer/sketch.rb index 3de94efe67d..818456778e1 100644 --- a/app/models/blob_viewer/sketch.rb +++ b/app/models/blob_viewer/sketch.rb @@ -5,7 +5,7 @@ module BlobViewer self.partial_name = 'sketch' self.extensions = %w(sketch) - self.text_based = false + self.binary = true self.switcher_icon = 'file-image-o' self.switcher_title = 'preview' end diff --git a/app/models/blob_viewer/svg.rb b/app/models/blob_viewer/svg.rb index 5fd11a98462..b7e5cd71e6b 100644 --- a/app/models/blob_viewer/svg.rb +++ b/app/models/blob_viewer/svg.rb @@ -5,7 +5,7 @@ module BlobViewer self.partial_name = 'svg' self.extensions = %w(svg) - self.text_based = true + self.binary = false self.switcher_icon = 'picture-o' self.switcher_title = 'image' end diff --git a/app/models/blob_viewer/text.rb b/app/models/blob_viewer/text.rb index 5f442dadf0f..e27b2c2b493 100644 --- a/app/models/blob_viewer/text.rb +++ b/app/models/blob_viewer/text.rb @@ -4,7 +4,7 @@ module BlobViewer include ServerSide self.partial_name = 'text' - self.text_based = true + self.binary = false self.max_size = 1.megabyte self.absolute_max_size = 10.megabytes end diff --git a/app/models/blob_viewer/text_stl.rb b/app/models/blob_viewer/text_stl.rb index 1b238777c32..2bb136a2702 100644 --- a/app/models/blob_viewer/text_stl.rb +++ b/app/models/blob_viewer/text_stl.rb @@ -5,6 +5,6 @@ module BlobViewer self.partial_name = 'stl' self.extensions = %w(stl) - self.text_based = true + self.binary = false end end |