flippy 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3772f4b9c48e0aaa2f6c9a52dce645f1cd1b9c89
4
- data.tar.gz: 430e7340d4e14a41a7cbf82fa4a55adf3d3c89a8
3
+ metadata.gz: 6837facdd05e44c2beafb7d4ecbcb799a1e26a85
4
+ data.tar.gz: b9dc0c89e52e6764e88819140b53c85a061adb43
5
5
  SHA512:
6
- metadata.gz: f4ce040a29b002d95a043d5de511d6e26c92e175ee8b287dab5914b0f93398d759000e72b9198060ab619e7f9918feb64a34a0fe31b7a817689bd18e08a3add7
7
- data.tar.gz: ee2e4066224b148e329718bfff62dc0cb2cd81f8c9e226867700b83dc99c9ff582b508e041d9e21f81d8d8b3ca642f6324cce2a81c4308c27e2f61a678b3cc30
6
+ metadata.gz: 960bccc18997413b2c76968403b24a830ae66d7b9ce5e486a83e931c28cef848bc1f5fb03bcdde8dccefe61060ba5eed411459382a7c02130c5c321593256e03
7
+ data.tar.gz: d689d0b6be66fabf35c4e6801870d341ab525504a0f5df01ad3be328b5a99fde9d558ffbabb1d6fefbc22ab918b98eb3a920cbec478dd00646d85cd2417fd40b
@@ -1,3 +1,6 @@
1
+ == 0.1.1 / 2013-03-20
2
+ * Buf Fixes
3
+
1
4
  == 0.1.0 / 2013-03-20
2
5
  * Flippy#vertical accept horizontal part with '//' symbol
3
6
 
@@ -1,3 +1,3 @@
1
1
  module Flippy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -28,7 +28,12 @@ module Flippy::Vertical
28
28
  main_line << chr
29
29
  punc_line << ' '
30
30
  else
31
- punc_line[-1] = chr
31
+ if PUNC.include?(punc_line.last)
32
+ main_line << ' '
33
+ punc_line << chr
34
+ else
35
+ punc_line[-1] = chr
36
+ end
32
37
  end
33
38
  end
34
39
  lines << punc_line << main_line
@@ -37,6 +42,7 @@ module Flippy::Vertical
37
42
  max = lines.map(&:size).max
38
43
  lines.map { |line| line.fill(' ', line.size...max) }
39
44
  .transpose
40
- .map { |line| line.join.reverse }.join("\n").concat("#{h_part}")
45
+ .map { |line| line.join.reverse }.join("\n")
46
+ .gsub(/ +$/, '').concat("#{h_part}")
41
47
  end
42
48
  end
@@ -6,11 +6,11 @@ describe Flippy do
6
6
  context "with any strings" do
7
7
  subject { "こんにちはー、\n日本。".vertical }
8
8
  it { should eq <<-EOS.chomp }
9
- 日 こ 
10
- 本。ん 
11
-   に 
12
-   ち 
13
-   は 
9
+ 日 こ
10
+ 本。ん
11
+   に
12
+   ち
13
+   は
14
14
    |、
15
15
  EOS
16
16
  end
@@ -18,38 +18,50 @@ EOS
18
18
  context "with any strings(multiple punctuations)" do
19
19
  subject { "こんにちはー、\n日本。人。".vertical }
20
20
  it { should eq <<-EOS.chomp }
21
- 日 こ 
22
- 本。ん 
23
- 人。に 
24
-   ち 
25
-   は 
21
+ 日 こ
22
+ 本。ん
23
+ 人。に
24
+   ち
25
+   は
26
26
    |、
27
27
  EOS
28
28
  end
29
29
 
30
+ context "with any strings(sequential multiple punctuations)" do
31
+ subject { "今日は、、いい\n天気、です。。".vertical }
32
+ it { should eq <<-EOS.chomp }
33
+ 天 今
34
+ 気、日
35
+ で は、
36
+ す。 、
37
+  。い
38
+   い
39
+ EOS
40
+ end
41
+
30
42
  context "vertical horizontal mix string" do
31
43
  subject { "ニッポンの//自然".vertical }
32
44
  it { should eq <<-EOS.chomp }
33
-  
34
-  
35
-  
36
-  
37
- の 自然
45
+
46
+
47
+
48
+
49
+ の自然
38
50
  EOS
39
51
  end
40
52
 
41
53
  context "vertical horizontal mix string" do
42
54
  subject { "ニッポンの//自然//大切に。".vertical }
43
55
  it { should eq <<-EOS.chomp }
44
-  
45
-  
46
-  
47
-  
48
-  
49
- / 
50
- / 
51
-  
52
- 然 大切に。
56
+
57
+
58
+
59
+
60
+
61
+ /
62
+ /
63
+
64
+ 然大切に。
53
65
  EOS
54
66
  end
55
67
 
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.1.0
4
+ version: 0.1.1
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-19 00:00:00.000000000 Z
11
+ date: 2013-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop