From b031242f639166f885c3f3c081c86949afc042d8 Mon Sep 17 00:00:00 2001 From: Alex Genco Date: Fri, 1 Aug 2014 22:05:06 -0700 Subject: [PATCH] Remove class variables from Tabber @@vars are generally considered a Bad Thing in Ruby. See http://bit.ly/1kcit9V for a quick rationale. --- lib/synx/tabber.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/synx/tabber.rb b/lib/synx/tabber.rb index c2a5030..1d5d89c 100644 --- a/lib/synx/tabber.rb +++ b/lib/synx/tabber.rb @@ -1,39 +1,39 @@ module Synx class Tabber - @@options = {} - @@tabbing = 0 + @options = {} + @tabbing = 0 class << self def increase(n=1) - @@tabbing += n + @tabbing += n end def decrease(n=1) - @@tabbing -= n - @@tabbing = 0 if @@tabbing < 0 + @tabbing -= n + @tabbing = 0 if @tabbing < 0 end def current - @@tabbing + @tabbing end def reset - @@tabbing = 0 + @tabbing = 0 self.options = {} end def options=(options = {}) - @@options = options + @options = options end def options - @@options + @options end def puts(str="") str = str.uncolorize if options[:no_color] - Kernel.puts (a_single_tab * @@tabbing) + str.to_s unless options[:quiet] + Kernel.puts (a_single_tab * @tabbing) + str.to_s unless options[:quiet] end def a_single_tab