tp 0.7.0pre1 → 0.7.0pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/screen.rb +5 -3
- data/lib/tp/version.rb +1 -1
- data/spec/lib/screen_spec.rb +10 -0
- data/spec/spec_helper.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce4ec0c53ab2d9dbbb1b484e65da65b3a2dc391
|
4
|
+
data.tar.gz: f216644030d74c7cbcb3c901ff1f3203de968561
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf0ce4dc392ba6077d19e5f57c58f53ff3a2dc09b757a57b31d221dd119a2543cfc14c6e1d17a5ffd09cf13c566ad6ba7687b01f60b35019fac4d27f7bbc8e3b
|
7
|
+
data.tar.gz: 448769e2bfdb35e292e5d4f3582919b1a8f99cb66fa7b2e59f5cdea51808045bae65daeaeb284f9062c084c0b33888c5063d43a972ce7ad67500610e3d35db25
|
data/lib/screen.rb
CHANGED
@@ -3,6 +3,8 @@ module Screen
|
|
3
3
|
|
4
4
|
X_GUTTER = 2
|
5
5
|
Y_GUTTER = 1
|
6
|
+
GUTTER_CHAR = "\u2591"
|
7
|
+
SUGGEST_CHAR = "\u2588"
|
6
8
|
|
7
9
|
def add_gutter(text)
|
8
10
|
text = text.lines.map { |line|
|
@@ -29,12 +31,12 @@ module Screen
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def suggest(x, y)
|
32
|
-
Y_GUTTER.times { print
|
34
|
+
Y_GUTTER.times { print GUTTER_CHAR * (x + X_GUTTER * 2) + "\n" }
|
33
35
|
y.times do |n|
|
34
36
|
print "\n" if n.nonzero?
|
35
|
-
print
|
37
|
+
print GUTTER_CHAR * X_GUTTER + SUGGEST_CHAR * x + GUTTER_CHAR * X_GUTTER
|
36
38
|
end
|
37
|
-
Y_GUTTER.times { print "\n" +
|
39
|
+
Y_GUTTER.times { print "\n" + GUTTER_CHAR * (x + X_GUTTER * 2) }
|
38
40
|
end
|
39
41
|
|
40
42
|
def width
|
data/lib/tp/version.rb
CHANGED
data/spec/lib/screen_spec.rb
CHANGED
@@ -39,6 +39,8 @@ describe Screen do
|
|
39
39
|
describe ".height" do
|
40
40
|
subject(:height) { klass.height }
|
41
41
|
|
42
|
+
before { klass.unstub :height }
|
43
|
+
|
42
44
|
it "returns the height" do
|
43
45
|
height.should be_nonzero
|
44
46
|
end
|
@@ -72,9 +74,17 @@ describe Screen do
|
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|
77
|
+
describe ".suggest" do
|
78
|
+
it "prints the slide size with gutter" do
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
75
83
|
describe ".width" do
|
76
84
|
subject(:width) { klass.width }
|
77
85
|
|
86
|
+
before { klass.unstub :width }
|
87
|
+
|
78
88
|
it "returns the width" do
|
79
89
|
width.should be_nonzero
|
80
90
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.0pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderay
|