Sha256: 8d6f57a1fc2bd064c1a09509a977c0b26c3b92dbd6900c2ae967f6389f9fde31

Contents?: true

Size: 558 Bytes

Versions: 22

Compression:

Stored size: 558 Bytes

Contents

require 'uri'

module Shipit
  class CCMenuUrlController < ShipitController
    def fetch
      uri = URI(api_stack_ccmenu_url(stack_id: stack.to_param))
      uri.query = {'token' => client.authentication_token}.to_query
      render json: {ccmenu_url: uri.to_s}
    end

    private

    def client
      @client ||= ApiClient.create_with(permissions: %w(read:stack))
                           .find_or_create_by!(creator: current_user, name: 'CCMenu Client')
    end

    def stack
      @stack ||= Stack.from_param!(params[:stack_id])
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.30.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.29.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.28.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.28.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.27.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.27.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.26.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.25.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.25.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.24.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.23.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.23.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.22.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.21.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.20.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.20.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.19.0 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.18.1 app/controllers/shipit/ccmenu_url_controller.rb
shipit-engine-0.18.0 app/controllers/shipit/ccmenu_url_controller.rb