Class: Shining::Player
- Inherits:
-
Object
- Object
- Shining::Player
- Defined in:
- lib/shining/player.rb
Instance Method Summary collapse
- #decompress ⇒ Object
- #download ⇒ Object
- #go! ⇒ Object
-
#initialize(preso) ⇒ Player
constructor
A new instance of Player.
- #install ⇒ Object
- #installed? ⇒ Boolean
Constructor Details
Instance Method Details
#decompress ⇒ Object
30 31 32 33 |
# File 'lib/shining/player.rb', line 30 def decompress Shining.say "Decompressing /tmp/plainview.zip" `unzip -o -d /tmp /tmp/plainview.zip` end |
#download ⇒ Object
25 26 27 28 |
# File 'lib/shining/player.rb', line 25 def download Shining.say "Downloading Plainview from http://s3.amazonaws.com/plainviewapp/plainview_1.0.173.zip..." `curl -# http://s3.amazonaws.com/plainviewapp/plainview_1.0.173.zip -o /tmp/plainview.zip` end |
#go! ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/shining/player.rb', line 15 def go! raise RuntimeError, %w( Sorry! We currently only support Plainview on MacOSX as a player. Manually open your presentation's index.html via Safari or Chrome for the time being. ).join(' ') unless osx? download and decompress and install unless installed? `#{@preso.path}/vendor/Plainview.app/Contents/MacOS/Plainview #{@preso.path}/index.html` end |
#install ⇒ Object
35 36 37 38 |
# File 'lib/shining/player.rb', line 35 def install new_dir @preso.path/'vendor' move '/tmp/Plainview.app', @preso.path/'vendor/' end |
#installed? ⇒ Boolean
40 41 42 |
# File 'lib/shining/player.rb', line 40 def installed? dir? @preso.path/'vendor'/'Plainview.app' end |