File: global.rb

package info (click to toggle)
ruby-rainbow 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: ruby: 559; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require_relative 'wrapper'

module Rainbow
  def self.global
    @global ||= Wrapper.new
  end

  def self.enabled
    global.enabled
  end

  def self.enabled=(value)
    global.enabled = value
  end

  def self.uncolor(string)
    StringUtils.uncolor(string)
  end
end

def Rainbow(string)
  Rainbow.global.wrap(string.to_s)
end