Class: Fwac

Inherits:
Object
  • Object
show all
Defined in:
lib/fwac.rb

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.convert(text) ⇒ Object

Convert words to words.

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



8
9
10
# File 'lib/fwac.rb', line 8

def self.convert(text)
  text.tr('A-Za-z0-9', 'A-Za-z0-9')
end

.copy(text) ⇒ Object

Copies the text to clipboard

… not in windows, tho



15
16
17
18
19
20
21
22
23
24
# 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