Sha256: 48f01eb1258c38bdf86fe8a4ca86a55b087335f35f686f4dc5399014ed6c8305

Contents?: true

Size: 728 Bytes

Versions: 12

Compression:

Stored size: 728 Bytes

Contents

module Shipit
  class CommitChecksController < ShipitController
    def show
      checks.schedule
    end

    params do
      accepts :since, Integer, default: 0
    end
    def tail
      output = checks.output(since: params.since)
      url = nil
      unless checks.finished?
        next_offset = params.since + output.bytesize
        url = stack_tail_commit_checks_path(stack, sha: commit.sha, since: next_offset)
      end

      render json: {url: url, output: output, status: checks.status}
    end

    private

    delegate :checks, to: :commit

    def commit
      @commit ||= stack.commits.find_by_sha!(params[:sha])
    end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
shipit-engine-0.20.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.20.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.19.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.18.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.18.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.17.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.16.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.15.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.14.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.13.0 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.12.1 app/controllers/shipit/commit_checks_controller.rb
shipit-engine-0.12.0 app/controllers/shipit/commit_checks_controller.rb