Class: Timmy::Meters

Inherits:
Object
  • Object
show all
Defined in:
lib/timmy/meters.rb

Constant Summary collapse

BUILTIN =
{
  docker_build_step: {
    begin_regex: /Step \d+\/\d+ : (?<title>.*)$/,
    end_regex: / ---> [0-9a-f]{12}$/
  }
}

Class Method Summary collapse

Class Method Details

.add(key, begin_regex:, end_regex: nil) ⇒ Object



11
12
13
# File 'lib/timmy/meters.rb', line 11

def add(key, begin_regex:, end_regex: nil)
  meters[key] = { begin_regex: begin_regex, end_regex: end_regex }
end

.clone_allObject



15
16
17
# File 'lib/timmy/meters.rb', line 15

def clone_all
  Marshal.load(Marshal.dump(meters))
end

.metersObject



19
20
21
# File 'lib/timmy/meters.rb', line 19

def meters
  @meters ||= BUILTIN
end