2018-09-26 03:45:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-04-03 06:26:38 +00:00
|
|
|
# Controller for viewing a file's raw
|
2013-06-23 16:47:22 +00:00
|
|
|
class Projects::RawController < Projects::ApplicationController
|
2013-04-03 06:26:38 +00:00
|
|
|
include ExtractsPath
|
2018-08-30 12:34:41 +00:00
|
|
|
include SendsBlob
|
2013-04-03 06:26:38 +00:00
|
|
|
|
2015-04-16 12:03:37 +00:00
|
|
|
before_action :require_non_empty_project
|
|
|
|
before_action :assign_ref_vars
|
|
|
|
before_action :authorize_download_code!
|
2013-04-03 06:26:38 +00:00
|
|
|
|
|
|
|
def show
|
2013-10-01 17:34:41 +00:00
|
|
|
@blob = @repository.blob_at(@commit.id, @path)
|
2016-03-07 13:27:53 +00:00
|
|
|
|
2018-10-17 15:47:05 +00:00
|
|
|
send_blob(@repository, @blob, inline: (params[:inline] != 'false'))
|
2015-12-03 16:08:09 +00:00
|
|
|
end
|
2013-04-03 06:26:38 +00:00
|
|
|
end
|