flippy 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +3 -0
- data/lib/flippy/version.rb +1 -1
- data/lib/flippy/vertical.rb +2 -1
- data/spec/vertical_spec.rb +14 -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: 2ac32b046bd9e616d2a792b80f1ac7a596dcd4ae
|
4
|
+
data.tar.gz: a9ee303090506ecceabd43544db5607ac335fc3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d61a1ad9a28d39cadea03b50383133f575edbc19a29754d6f7a399a52440059dc45caff8f597fbf2e9a09c5d2abd8e83d2b533134440a4d75e720b41f71b936
|
7
|
+
data.tar.gz: 761fb2f023a3a26762d230783808a7f46469fa9462d2ebaa56a69a4c080b83aee025df09ca14edcd42e6b46e7549bf90c7cf8bb87ba329f4cd54251bc1f4579e
|
data/History.txt
CHANGED
data/lib/flippy/version.rb
CHANGED
data/lib/flippy/vertical.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Flippy::Vertical
|
2
3
|
PUNC = ["、","。",",","."]
|
3
4
|
|
@@ -24,7 +25,7 @@ module Flippy::Vertical
|
|
24
25
|
top = line[0] || ""
|
25
26
|
rest = line[1..-1] || ""
|
26
27
|
lines << rest.gsub(/[^#{PUNC.join}]/, ' ')
|
27
|
-
lines << top + rest.gsub(/#{PUNC.join("|")}/, '')
|
28
|
+
lines << top + rest.gsub(/#{PUNC.join("|")}/, ' ')
|
28
29
|
}
|
29
30
|
|
30
31
|
max = lines.map(&:size).max
|
data/spec/vertical_spec.rb
CHANGED
@@ -12,9 +12,23 @@ describe Flippy do
|
|
12
12
|
ち
|
13
13
|
は
|
14
14
|
|、
|
15
|
+
|
15
16
|
EOS
|
16
17
|
end
|
17
18
|
|
19
|
+
context "with any strings(multiple punctuations)" do
|
20
|
+
subject { "こんにちはー、\n日本。人。".vertical }
|
21
|
+
it { should eq <<-EOS.chomp }
|
22
|
+
日 こ
|
23
|
+
本。ん
|
24
|
+
に
|
25
|
+
人。ち
|
26
|
+
は
|
27
|
+
|、
|
28
|
+
|
29
|
+
EOS
|
30
|
+
end
|
31
|
+
|
18
32
|
context "with empty strings" do
|
19
33
|
subject { "".vertical }
|
20
34
|
it { should eq "" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flippy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kyoendo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|