Sha256: f903124ea73e8af261e1b9f202625957feba3747ec2773bf22241b21897fcd5d

Contents?: true

Size: 601 Bytes

Versions: 26

Compression:

Stored size: 601 Bytes

Contents

#!/usr/bin/env ruby

class Counter
  class << self
    def get
      File.read('/tmp/counter').to_i 
    end
    def set(value)
      File.open('/tmp/counter', 'w+') do |file|
        file.puts(value)
      end
    end
    def increase
      set(get + 1)
    end
    def decrease
      set(get - 1)
    end
    def to_human
      get.to_s.rjust(4, '0')
    end
  end
end


STDIN.each_line do |line|
  puts ''
  Counter.increase
  puts "#{Counter.to_human} - Debugging: #{ARGV[0]}: #{line.chomp}"
  puts '--------------------------------------------------------------------------------'
  puts ''
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ix-cli-0.0.27 bin/ix-debugging
ix-cli-0.0.26 bin/ix-debugging
ix-cli-0.0.25 bin/ix-debugging
ix-cli-0.0.24 bin/ix-debugging
ix-cli-0.0.23 bin/ix-debugging
ix-cli-0.0.22 bin/ix-debugging
ix-cli-0.0.21 bin/ix-debugging
ix-cli-0.0.20 bin/ix-debugging
ix-cli-0.0.19 bin/ix-debugging
ix-cli-0.0.18 bin/ix-debugging
ix-cli-0.0.17 bin/ix-debugging
ix-cli-0.0.16 bin/ix-debugging
ix-cli-0.0.15 bin/ix-debugging
ix-cli-0.0.14 bin/ix-debugging
ix-cli-0.0.13 bin/ix-debugging
ix-cli-0.0.12 bin/ix-debugging
ix-cli-0.0.11 bin/ix-debugging
ix-cli-0.0.10 bin/ix-debugging
ix-cli-0.0.9 bin/ix-debugging
ix-cli-0.0.7 bin/ix-debugging