class Promper
Constants
- VERSION
Public Class Methods
new()
click to toggle source
# File lib/promper.rb, line 6 def initialize end
Public Instance Methods
clipboard_copy(result)
click to toggle source
# File lib/promper.rb, line 36 def clipboard_copy(result) IO.popen("pbcopy", "w") { |pipe| pipe.puts result } end
go_boy()
click to toggle source
# File lib/promper.rb, line 10 def go_boy puts "Ruff ruff ruff!\nMy name is promper! I'm an energetic dog!!!" while true phrase = prompt("What are we looking for? (Enter nothing to quit)") if phrase == '' break end result = search(phrase) puts "\nI think I found it!\n" pp(result) end end
prompt(phrase = '')
click to toggle source
# File lib/promper.rb, line 23 def prompt(phrase = '') puts "\n*drool drool drool*\n#{phrase}" phrase = gets.chomp end
search(phrase)
click to toggle source
# File lib/promper.rb, line 28 def search(phrase) tree = GabTree.new(phrase, phoneme_convert: true, match_criteria: LooseMatch.new) processor = GabTreeProcessor.new(tree.root_node) tree.iterate_until_finished processor.result end