Sha256: be011f4b653786bda6f23405c01b2eb5ff9a265df6d2cd482593c5ba6b7cf2dc

Contents?: true

Size: 604 Bytes

Versions: 14

Compression:

Stored size: 604 Bytes

Contents

module WatchmonkeyCli
  class Application
    module OutputHelper
      def puts *a
        sync { @opts[:stdout].send(:puts, *a) }
      end

      def print *a
        sync { @opts[:stdout].send(:print, *a) }
      end

      def warn *a
        sync { @opts[:stdout].send(:warn, *a) }
      end

      def debug msg, lvl = 1
        puts c("[DEBUG] #{msg}", :black) if @opts[:debug] && @opts[:debug] >= lvl
      end

      def abort msg, exit_code = 1
        puts c("[ABORT] #{msg}", :red)
        exit(exit_code)
      end

      def error msg
        warn c(msg, :red)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
watchmonkey_cli-1.10.0 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.9.1 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.9.0 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.6 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.5 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.4 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.3 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.2 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8.1 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.8 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.7.1 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.7 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.6 lib/watchmonkey_cli/application/output_helper.rb
watchmonkey_cli-1.5 lib/watchmonkey_cli/application/output_helper.rb