Sha256: 2248f6a404fdf4fe4fd7fae3e483514ed8545b9e158f811147a892a5dc70da69

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

# Wrap project in object to allow lazy loading of status
class Cody::List
  class Project
    include Cody::AwsServices
    extend Memoist

    attr_reader :name
    def initialize(name)
      @name = name # Simple string
    end

    def status
      resp = codebuild.batch_get_builds(ids: [build_id])
      build = resp.builds.first
      build.build_status
    end
    memoize :status

    def build_id
      resp = codebuild.list_builds_for_project(project_name: @name)
      resp.ids.first # most recent build_id
    end
    memoize :build_id
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cody-0.9.3 lib/cody/list/project.rb
cody-0.9.2 lib/cody/list/project.rb