Module: TopGun
- Defined in:
- lib/top_gun.rb,
lib/top_gun/version.rb
Constant Summary collapse
- LYRICS_DIR =
File.dirname(__FILE__) + '/../lyrics'
- VERSION =
"0.1.0"
Class Method Summary collapse
- .danger_zone ⇒ Object
- .goose ⇒ Object
- .mav ⇒ Object
- .playing_with_the_boys ⇒ Object
- .say(opts) ⇒ Object
- .something_awesome(by_who) ⇒ Object
- .take_my_breath_away ⇒ Object
Class Method Details
.danger_zone ⇒ Object
22 23 24 |
# File 'lib/top_gun.rb', line 22 def self.danger_zone say :file => 'danger_zone.txt' end |
.goose ⇒ Object
30 31 32 |
# File 'lib/top_gun.rb', line 30 def self.goose say :text => something_awesome(:goose), :voice => :junior end |
.mav ⇒ Object
34 35 36 |
# File 'lib/top_gun.rb', line 34 def self.mav say :text => something_awesome(:mav), :voice => :bruce end |
.playing_with_the_boys ⇒ Object
38 39 40 |
# File 'lib/top_gun.rb', line 38 def self. say :file => 'playing_with_the_boys.txt' end |
.say(opts) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/top_gun.rb', line 6 def self.say(opts) commands = [] if text = opts[:text] commands << text else commands << "-f #{File.join(LYRICS_DIR, opts[:file])}" end if voice = opts[:voice] commands << "-v #{voice}" end `say #{commands.join(' ')}` end |
.something_awesome(by_who) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/top_gun.rb', line 42 def self.something_awesome(by_who) case by_who when :mav ["eyell hit the breaks and he will fly right bye", "Too close for miss els, eyem switching to guns.", "Tower, this is Ghost Rider requesting a flybye", "You don't have time to think up there. If you think, you're dead."] when :goose ["Cum on Mav, do some of that pilot shit!", "No, mav, this is not a good idea", "You must have carnal knowledge of a lady this time, on the premises", "Yee ha!! Jesters dead!"] end.sort_by{ rand }.first end |
.take_my_breath_away ⇒ Object
26 27 28 |
# File 'lib/top_gun.rb', line 26 def self.take_my_breath_away say :file => 'take_my_breath_away.txt', :voice => :victoria end |