Sha256: 6bbc7c58ebf37f8f62fc090c12710a61741fc3149f8b97332113c04162a69e54

Contents?: true

Size: 303 Bytes

Versions: 58

Compression:

Stored size: 303 Bytes

Contents

class Bundler::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

58 entries across 58 versions & 4 rubygems

Version Path
rubygems-update-3.5.18 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.18 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.17 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.17 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.16 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.16 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.15 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.15 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.14 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.14 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.13 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.13 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.12 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.12 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.10 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.10 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.9 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.9 lib/bundler/vendor/thor/lib/thor/nested_context.rb
rubygems-update-3.5.8 bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
bundler-2.5.8 lib/bundler/vendor/thor/lib/thor/nested_context.rb