Sha256: e8092206c03e107350e629d86abb43231ac9149f726c8951c9aa7273c2c3824e

Contents?: true

Size: 290 Bytes

Versions: 117

Compression:

Stored size: 290 Bytes

Contents

class Thor
  class NestedContext
    def initialize
      @depth = 0
    end

    def enter
      push

      yield
    ensure
      pop
    end

    def entered?
      @depth > 0
    end

    private

    def push
      @depth += 1
    end

    def pop
      @depth -= 1
    end
  end
end

Version data entries

117 entries across 70 versions & 14 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/thor-1.2.1/lib/thor/nested_context.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/thor-1.2.1/lib/thor/nested_context.rb
thor-1.2.2 lib/thor/nested_context.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/nested_context.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/nested_context.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/thor-1.1.0/lib/thor/nested_context.rb
thor-1.2.1 lib/thor/nested_context.rb
thor-1.2.0 lib/thor/nested_context.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/nested_context.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/nested_context.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/nested_context.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/nested_context.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/nested_context.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/nested_context.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/nested_context.rb