Class: Termit::OutputManager
- Inherits:
-
Object
- Object
- Termit::OutputManager
- Defined in:
- lib/termit/output_manager.rb
Instance Method Summary collapse
- #display_error_info_and_quit ⇒ Object
- #display_help_and_quit ⇒ Object
- #display_player_error_and_quit ⇒ Object
- #display_synonyms(synonyms) ⇒ Object
- #display_translation(text) ⇒ Object
- #display_version_and_quit ⇒ Object
Instance Method Details
#display_error_info_and_quit ⇒ Object
4 5 6 7 |
# File 'lib/termit/output_manager.rb', line 4 def display_error_info_and_quit puts "TERMIT: Wrong data. Example: 'termit en es the cowboy ' => 'el vaquero'" exit end |
#display_help_and_quit ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/termit/output_manager.rb', line 20 def display_help_and_quit puts <<-EOS =========TERMIT========= Usage: termit 'source_language' 'target_language' 'text' Example: termit en fr 'hey cowboy where is your horse?' => 'hey cow-boy ou est votre cheval?' Options: -t - speech synthesis -s - synonyms list Check docs at: github.com/pawurb/termit EOS exit end |
#display_player_error_and_quit ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/termit/output_manager.rb', line 9 def display_player_error_and_quit = "Termit speech synthesis requires mpg123 installed." case Gem::Platform.local.os when "darwin" << "\nPlease run 'brew install mpg123'" when "linux" << "\nPlease run 'sudo apt-get install mpg123'" end abort end |
#display_synonyms(synonyms) ⇒ Object
50 51 52 53 |
# File 'lib/termit/output_manager.rb', line 50 def display_synonyms synonyms print '=> Synonyms: ' puts synonyms end |
#display_translation(text) ⇒ Object
45 46 47 48 |
# File 'lib/termit/output_manager.rb', line 45 def display_translation text print "=> " puts text end |