Sha256: 4203c4e0f80489735a7a3ac3fb3a4a44b13bf48fbb93e786c487bfd7ed5a0e06

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

require 'securerandom'

module Buildbox
  class Artifact
    autoload :Poster,    "buildbox/artifact/poster"
    autoload :Collector, "buildbox/artifact/collector"
    autoload :Uploader,  "buildbox/artifact/uploader"

    attr_reader :id, :name, :path
    attr_accessor :remote_id, :upload_instructions

    def self.create(name, path)
      new(SecureRandom.uuid, name, path)
    end

    def initialize(id, name, path)
      @id   = id
      @name = name
      @path = path
    end

    def basename
      File.basename(@path)
    end

    def as_json
      { :id => @id, :name => @name, :path => @path, :file_size => File.size(@path) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
buildbox-0.6.beta3 lib/buildbox/artifact.rb