Sha256: dd3bcf19aef6a04f3eeec57d1b548856c0b259efc131c6820b9592bc5adfaa5b

Contents?: true

Size: 274 Bytes

Versions: 104

Compression:

Stored size: 274 Bytes

Contents

class KuberKit::Shell::CommandCounter
  def initialize
    @mutex = Mutex.new
  end

  def get_number
    @mutex.synchronize do
      @@number ||= 0
      @@number += 1
      @@number
    end
  end

  def reset!
    @mutex.synchronize do
      @@number = 0
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
kuber_kit-1.3.8 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.7 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.8 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.6 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.7 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.5 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.4 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.6 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.3 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.2 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.5 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.1 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.3.0 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.4 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.2.7 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.2.6 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.2.5 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.2.4 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.2.2 lib/kuber_kit/shell/command_counter.rb
kuber_kit-1.1.2 lib/kuber_kit/shell/command_counter.rb