lib/trifle/logger/tracer/hash.rb in trifle-logger-0.0.2 vs lib/trifle/logger/tracer/hash.rb in trifle-logger-0.1.0
- old
+ new
@@ -2,17 +2,18 @@
module Trifle
module Logger
module Tracer
class Hash
- attr_accessor :key, :meta, :data, :tags, :state
+ attr_accessor :key, :meta, :data, :tags, :artifacts, :state
def initialize(key:, meta: nil)
@key = key
@meta = meta
@data = []
@tags = []
+ @artifacts = []
@state = :success
@result_prefix = '=> '
trace("Trifle::Trace has been initialized for #{key}")
end
@@ -53,9 +54,17 @@
Time.now.to_i
end
def tag(tag)
@tags << tag
+ end
+
+ def artifact(name, path)
+ @data << {
+ at: now, message: "Artifact: #{name}",
+ state: :success, head: false, meta: true
+ }
+ @artifacts << path
end
def fail!
@state = :error
end