Sha256: c309db1b61083620d99534a9967d724df7d5043f88709ce328e5bf3a3ae17a27

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

class ChunksController < ShipitController
  include ChunksHelper

  before_action :load_stack
  before_action :load_task
  before_action :load_output_chunks

  respond_to :json

  def index
    respond_with(@output_chunks)
  end

  def tail
    respond_with(url: next_chunks_url(@task), task: @task, chunks: @output_chunks)
  end

  private

  def load_output_chunks
    @output_chunks = @task.chunks.tail(params[:last_id])
  end

  def load_task
    @task = @stack.tasks.find(params[:task_id])
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shipit-engine-0.1.0 app/controllers/chunks_controller.rb
shipit-engine-0.0.1.pre app/controllers/chunks_controller.rb