Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Suggest terminal size of 30x8

  • Loading branch information...
commit c3499c49e5133ef7b8097bc97a24894485fb415d 1 parent 5151e03
Justin Campbell authored
7 lib/screen.rb
@@ -9,6 +9,13 @@ def height
9 9 `tput lines`.to_i
10 10 end
11 11
  12 + def suggest(x, y)
  13 + y.times do |n|
  14 + print "\n" if n.nonzero?
  15 + print "\u2588" * x
  16 + end
  17 + end
  18 +
12 19 def width
13 20 `tput cols`.to_i
14 21 end
3  lib/tp/presenter.rb
@@ -7,6 +7,9 @@ def initialize(markdown)
7 7 end
8 8
9 9 def present
  10 + Screen.suggest 30, 8
  11 + Keyboard.wait_for_enter
  12 +
10 13 slides.each do |slide|
11 14 Screen.clear!
12 15 show_slide slide
4 spec/lib/tp/presenter_spec.rb
@@ -19,12 +19,12 @@
19 19 }
20 20
21 21 before :each do
22   - Screen.stub width: 20, height: 20
  22 + Screen.stub width: 20, height: 20, suggest: nil
23 23 end
24 24
25 25 describe "#present" do
26 26 it "works" do
27   - Keyboard.should_receive(:wait_for_enter).exactly(3).times
  27 + Keyboard.should_receive(:wait_for_enter).exactly(4).times
28 28 Screen.should_receive(:clear!).exactly(4).times
29 29
30 30 presenter.should_receive(:print).exactly(3).times

0 comments on commit c3499c4

Please sign in to comment.
Something went wrong with that request. Please try again.