flippy 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flippy/version.rb +1 -1
- data/lib/flippy/vertical.rb +4 -2
- data/spec/vertical_spec.rb +14 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7953fdf72ddb0ae18ecd68c3025a97869672eca7
|
4
|
+
data.tar.gz: 608eb487cd019392e6eb0df87daf6a7bfaaaf625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bedc81d02fce143787c053c2b96439af32f2ddbc126a98fc30a52d714d076e31ff732242998fd93cd53f879c42b4571f70a9ad60688db89579ea7f58000a6be
|
7
|
+
data.tar.gz: ae1f6f493cd013be7313352df1a4b00bbcd987350384bc21916978b33dfedba72f412c3e423c7f9082eb5a5da2039ec2e51b3dfe5868b10377639f2d3b3400b2
|
data/lib/flippy/version.rb
CHANGED
data/lib/flippy/vertical.rb
CHANGED
@@ -21,8 +21,10 @@ module Flippy::Vertical
|
|
21
21
|
self.tr(SYM1, SYM2)
|
22
22
|
.each_line { |line|
|
23
23
|
line.chomp!
|
24
|
-
|
25
|
-
|
24
|
+
top = line[0] || ""
|
25
|
+
rest = line[1..-1] || ""
|
26
|
+
lines << rest.gsub(/[^#{PUNC.join}]/, ' ')
|
27
|
+
lines << top + rest.gsub(/#{PUNC.join("|")}/, '')
|
26
28
|
}
|
27
29
|
|
28
30
|
max = lines.map(&:size).max
|
data/spec/vertical_spec.rb
CHANGED
@@ -3,8 +3,9 @@ require_relative 'spec_helper'
|
|
3
3
|
|
4
4
|
describe Flippy do
|
5
5
|
describe "#vertical" do
|
6
|
-
|
7
|
-
|
6
|
+
context "with any strings" do
|
7
|
+
subject { "こんにちはー、\n日本。".vertical }
|
8
|
+
it { should eq <<-EOS.chomp }
|
8
9
|
日 こ
|
9
10
|
本。ん
|
10
11
|
に
|
@@ -12,5 +13,16 @@ describe Flippy do
|
|
12
13
|
は
|
13
14
|
|、
|
14
15
|
EOS
|
16
|
+
end
|
17
|
+
|
18
|
+
context "with empty strings" do
|
19
|
+
subject { "".vertical }
|
20
|
+
it { should eq "" }
|
21
|
+
end
|
22
|
+
|
23
|
+
context "with CR" do
|
24
|
+
subject { "\n".vertical }
|
25
|
+
it { should eq "" }
|
26
|
+
end
|
15
27
|
end
|
16
28
|
end
|