Sha256: d442cb9de4eef3a8ac9fd34e38e94c5e9629202975a1afc0e2c6ae6d1c5d0fb7

Contents?: true

Size: 294 Bytes

Versions: 83

Compression:

Stored size: 294 Bytes

Contents

class Thor
  class NestedContext
    def initialize
      @depth = 0
    end

    def enter
      push

      yield
    ensure
      pop
    end

    def entered?
      @depth.positive?
    end

  private

    def push
      @depth += 1
    end

    def pop
      @depth -= 1
    end
  end
end

Version data entries

83 entries across 83 versions & 7 rubygems

Version Path
harbr-0.1.57 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.56 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.55 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.54 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.53 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.52 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.50 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.49 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.48 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.47 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.46 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.45 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.44 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.43 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.42 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.41 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.39 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.38 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
harbr-0.1.37 vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/nested_context.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/thor-1.3.0/lib/thor/nested_context.rb