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

pabloh / pathway / 23928424686

03 Apr 2026 12:33AM UTC coverage: 98.777% (-0.9%) from 99.674%
23928424686

Pull #62

github

web-flow
Merge 95c69cc89 into d1472813d
Pull Request #62: Add tags for lambda steps

30 of 34 new or added lines in 2 files covered. (88.24%)

323 of 327 relevant lines covered (98.78%)

72.33 hits per line

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

91.67
/lib/pathway/plugins/auto_deconstruct_state.rb
1
# frozen_string_literal: true
2

3
module Pathway
2✔
4
  module Plugins
2✔
5
    module AutoDeconstructState
2✔
6
      module ClassMethods
2✔
7
        attr_accessor :auto_deconstruct_state_on
2✔
8

9
        def inherited(subclass)
2✔
NEW
10
          super
×
NEW
11
          subclass.auto_deconstruct_state_on = auto_deconstruct_state_on
×
12
        end
13
      end
14

15
      module InstanceMethods
2✔
16
        extend Forwardable
2✔
17

18
        delegate auto_deconstruct_state_on: "self.class"
2✔
19
      end
20

21
      module DSLMethods
2✔
22
        private
2✔
23

24
        def _callable(callable, &block)
2✔
25
          next_step = super
12✔
26

27
          if callable.is_a?(Symbol) &&
12✔
28
             ((block_given? && @operation.auto_deconstruct_state_on.member?(:block) && _can_deconstruct?(block)) ||
10✔
29
             (@operation.auto_deconstruct_state_on.member?(:method) && @operation.respond_to?(callable, true) &&
8✔
30
               _can_deconstruct?(@operation.method(callable))))
31

32
            ->(state, **kw) { next_step.call(**state, **kw) }
12✔
33
          else
34
            next_step
6✔
35
          end
36
        end
37

38
        def _can_deconstruct?(cb)= cb.parameters.all? { _1 in [:key | :keyreq | :keyrest | :block, *] }
22✔
39
      end
40

41
      OPTIONS = %i[all method block].freeze
2✔
42

43
      def self.apply(operation, on: :all)
2✔
44
        operation.auto_deconstruct_state_on = on == :all ? OPTIONS - [:all] : Array(on)
2✔
45
      end
46
    end
47
  end
48
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

© 2026 Coveralls, Inc