class Fwac

Constants

VERSION

Public Class Methods

convert(text) click to toggle source

Convert words to words.

Returns a String, but a much cooler string than what you had initially.

# File lib/fwac.rb, line 8
def self.convert(text)
  text.tr('A-Za-z0-9', 'A-Za-z0-9')
end
copy(text) click to toggle source

Copies the text to clipboard

… not in windows, tho

# File lib/fwac.rb, line 15
def self.copy(text)
  copycmd = case RUBY_PLATFORM
  when /darwin/
    'pbcopy'
  when /linux/
    'xclip'
  end

  copycmd && system("printf \"#{text}\" | #{copycmd}")
end