Sha256: e78014fd6a4b4b20268571677fccc9eae711eddfe51b506604c611401ba72358

Contents?: true

Size: 871 Bytes

Versions: 2

Compression:

Stored size: 871 Bytes

Contents

# frozen_string_literal: true

module Distribuo
  module Apps
    # FIXME: This should probably inherit from an ApplicatoinController
    class ReleasesController < ActionController::Base
      # skip_before_action :authenticate_user!
      before_action :set_objects

      def download
        if request.get?
          @release.downloads.create(ip: request.ip)
          send_data @release.build.download, filename: @release.build.filename.to_s,
                                             content_type: @release.build.content_type
        else
          head 204
        end
      end

      def manifest
        render plist: 'manifest.plist.erb'
      end

      private

      def set_objects
        @app = App.find(params[:app_id]) if params[:app_id]
        @release = @app.releases.find(params[:release_id]) if params[:release_id]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
distribuo-0.1.16 app/controllers/distribuo/apps/releases_controller.rb
distribuo-0.1.8 app/controllers/distribuo/apps/releases_controller.rb