repositories_controller.rb revision 03dee28977299b4b40210d9b7842bf85c136ab7d
7384b4e78eaab44693c985192276e31322155e32Stephan Boschclass RepositoriesController < ApplicationController
9e7bf91667639a2390207ab4d90bf88e2afcec2aStephan Bosch load_and_authorize_resource :except => [:index, :show]
9e7bf91667639a2390207ab4d90bf88e2afcec2aStephan Bosch commit_id = @repository.commit_id(params[:oid])
9e7bf91667639a2390207ab4d90bf88e2afcec2aStephan Bosch @info = @repository.path_info(params[:path], @oid)
50a6d26bd9041f44b4cad0c0357c0c604c132cc8Stephan Bosch raise Repository::FileNotFoundError, @path if @info.nil?
50a6d26bd9041f44b4cad0c0357c0c604c132cc8Stephan Bosch render text: @repository.read_file(@path, @oid)[:content],
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch content_type: Mime::Type.lookup('application/force-download')
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch @file = @repository.read_file(@info[:entry][:path], params[:oid])
def history