Sha256: 0603a8fdc9b31c4a93ba4f652d5e63ed3036e5cc4653ac43f57f96ec643f63ff

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

# encoding: utf-8
class Bubs
  VERSION = '0.0.2'

  CONVERT_MAP = {
    'A' => 'Ⓐ',
    'B' => 'Ⓑ',
    'C' => 'Ⓒ',
    'D' => 'Ⓓ',
    'E' => 'Ⓔ',
    'F' => 'Ⓕ',
    'G' => 'Ⓖ',
    'H' => 'Ⓗ',
    'I' => 'Ⓘ',
    'J' => 'Ⓙ',
    'K' => 'Ⓚ',
    'L' => 'Ⓛ',
    'M' => 'Ⓜ',
    'N' => 'Ⓝ',
    'O' => 'Ⓞ',
    'P' => 'Ⓟ',
    'Q' => 'Ⓠ',
    'R' => 'Ⓡ',
    'S' => 'Ⓢ',
    'T' => 'Ⓣ',
    'U' => 'Ⓤ',
    'V' => 'Ⓥ',
    'W' => 'Ⓦ',
    'X' => 'Ⓧ',
    'Y' => 'Ⓨ',
    'Z' => 'Ⓩ',
    'a' => 'ⓐ',
    'b' => 'ⓑ',
    'c' => 'ⓒ',
    'd' => 'ⓓ',
    'e' => 'ⓔ',
    'f' => 'ⓕ',
    'g' => 'ⓖ',
    'h' => 'ⓗ',
    'i' => 'ⓘ',
    'j' => 'ⓙ',
    'k' => 'ⓚ',
    'l' => 'ⓛ',
    'm' => 'ⓜ',
    'n' => 'ⓝ',
    'o' => 'ⓞ',
    'p' => 'ⓟ',
    'q' => 'ⓠ',
    'r' => 'ⓡ',
    's' => 'ⓢ',
    't' => 'ⓣ',
    'u' => 'ⓤ',
    'v' => 'ⓥ',
    'w' => 'ⓦ',
    'x' => 'ⓧ',
    'y' => 'ⓨ',
    'z' => 'ⓩ',
    '1' => '①',
    '2' => '②',
    '3' => '③',
    '4' => '④',
    '5' => '⑤',
    '6' => '⑥',
    '7' => '⑦',
    '8' => '⑧',
    '9' => '⑨',
    '0' => '⓪'
  }

  # Convert words to ⓌⓄⓇⒹⓈ.
  #
  # Returns a String, but a much cooler string than what you had initially.
  def self.convert(text)
    text.gsub(/[a-z0-9]/i, CONVERT_MAP)
  end

  # Copies the text to clipboard
  #
  # ... not in windows, tho
  def self.copy(text)
    copycmd = case RUBY_PLATFORM
    when /darwin/
      'pbcopy'
    when /linux/
      'xclip'
    end

    copycmd && `printf "#{text}" | #{copycmd}`
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bubs-0.0.2 lib/bubs.rb