Module: CliTalkyTalk::ClassMethods
- Defined in:
- lib/cli-talky-talk.rb
Constant Summary collapse
- VOICES =
`say -v \?`.split("\n").select { |v| v =~ /en_US/ }.map { |v| v.gsub(/\s+en_US.*$/,"")}
- GREETINGS =
[ 'ahoy', 'greeting', 'saalutations', 'waazame', 'bleep booop', 'exceslior', 'land hoe', 'hail', ]
- NAMES =
[ `whoami`.chomp, 'Govna', 'captain', 'boss', 'cheef', 'over loard', 'dragon commander', 'your excellence', 'exhaulted one', ]
- STATUSES =
[ 'all done here', 'works done', 'bingo!', 'hazaa', 'flip Yeah', 'get back to work', 'all systems go', ]
Instance Method Summary collapse
Instance Method Details
#rand(arr) ⇒ Object
43 44 45 |
# File 'lib/cli-talky-talk.rb', line 43 def rand(arr) arr.sample end |
#random_sentence ⇒ Object
51 52 53 |
# File 'lib/cli-talky-talk.rb', line 51 def random_sentence "#{rand GREETINGS}, #{rand NAMES}! #{rand STATUSES}" end |
#speak ⇒ Object
47 48 49 |
# File 'lib/cli-talky-talk.rb', line 47 def speak `say -v#{rand(VOICES)} #{random_sentence}` end |