Class: Descartes::Reply

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/descartes/modules/reply.rb

Instance Method Summary collapse

Instance Method Details

#execute(m) ⇒ Object



21
22
23
24
25
26
# File 'lib/descartes/modules/reply.rb', line 21

def execute(m)
  file = File.join $options[:dotfiles], 'replies.txt'
  m.reply [].tap { |ary|
    File.read(file).each_line { |line| ary << line unless line.strip.empty? }
  }.sample
end