• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

payrollhero / dispatch-rider / #3015

02 Sep 2022 11:22PM UTC coverage: 0.409% (-84.7%) from 85.154%
#3015

push

web-flow
Layout/SpaceInsideStringInterpolation-20220901233630 (#89)

* :police_car: regenerate rubocop todo

* :police_car: Layout/SpaceInsideStringInterpolation

* :police_car: regenerate rubocop todo

Co-authored-by: Rubocop Challenger <rubocop@payrollhero.com>

0 of 1 new or added line in 1 file covered. (0.0%)

1529 existing lines in 63 files now uncovered.

7 of 1711 relevant lines covered (0.41%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/dispatch-rider/logging/lifecycle_logger.rb
UNCOV
1
module DispatchRider
×
UNCOV
2
  module Logging
×
UNCOV
3
    class LifecycleLogger
×
UNCOV
4
      class << self
×
UNCOV
5
        def log_error_handler_fail(message, exception)
×
UNCOV
6
          new(:error_handler_fail, message, exception: exception).log
×
UNCOV
7
        end
×
8

UNCOV
9
        def log_got_stop(reason, message)
×
UNCOV
10
          new(:stop, message, reason: reason).log
×
UNCOV
11
        end
×
12

UNCOV
13
        def wrap_handling(message)
×
UNCOV
14
          start_time = Time.now
×
UNCOV
15
          log_start(message)
×
UNCOV
16
          yield
×
UNCOV
17
          log_success(message)
×
UNCOV
18
        rescue => exception
×
UNCOV
19
          log_fail(message, exception)
×
UNCOV
20
          raise exception
×
UNCOV
21
        ensure
×
UNCOV
22
          log_complete(message, Time.now - start_time)
×
UNCOV
23
        end
×
24

UNCOV
25
        private
×
26

UNCOV
27
        def log_complete(message, duration)
×
UNCOV
28
          new(:complete, message, duration: duration).log
×
UNCOV
29
        end
×
30

UNCOV
31
        def log_fail(message, exception)
×
UNCOV
32
          new(:fail, message, exception: exception).log
×
UNCOV
33
        end
×
34

UNCOV
35
        def log_success(message)
×
UNCOV
36
          new(:success, message).log
×
UNCOV
37
        end
×
38

UNCOV
39
        def log_start(message)
×
UNCOV
40
          new(:start, message).log
×
UNCOV
41
        end
×
UNCOV
42
      end
×
43

UNCOV
44
      def initialize(kind, message, options = {})
×
UNCOV
45
        @kind = kind
×
UNCOV
46
        @message = message
×
UNCOV
47
        @options = options
×
UNCOV
48
      end
×
49

UNCOV
50
      def log
×
UNCOV
51
        logger.send(log_action, formatted_data)
×
UNCOV
52
      end
×
53

UNCOV
54
      private
×
55

UNCOV
56
      attr_reader :kind, :message, :options
×
57

UNCOV
58
      def formatter
×
UNCOV
59
        DispatchRider.config.log_formatter
×
UNCOV
60
      end
×
61

UNCOV
62
      def logger
×
UNCOV
63
        DispatchRider.config.logger
×
UNCOV
64
      end
×
65

UNCOV
66
      def additional_info_injector
×
UNCOV
67
        DispatchRider.config.additional_info_injector
×
UNCOV
68
      end
×
69

UNCOV
70
      def translator
×
UNCOV
71
        Translator
×
UNCOV
72
      end
×
73

UNCOV
74
      def translated_message
×
UNCOV
75
        translator.translate(message, kind, options)
×
UNCOV
76
      end
×
77

UNCOV
78
      def interjected_message
×
UNCOV
79
        additional_info_injector.call(translated_message)
×
UNCOV
80
      end
×
81

UNCOV
82
      def formatted_data
×
UNCOV
83
        formatter.format(interjected_message)
×
UNCOV
84
      end
×
85

UNCOV
86
      def log_action
×
UNCOV
87
        case kind
×
UNCOV
88
        when :fail, :error_handler_fail then :error
×
UNCOV
89
        when :start, :stop, :complete, :success then :info
×
UNCOV
90
        end
×
UNCOV
91
      end
×
UNCOV
92
    end
×
UNCOV
93
  end
×
UNCOV
94
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc