Walt 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,8 +11,8 @@ A Ruby gem providing simple line and blockquote parsing (w/o paragraphs):
11
11
 
12
12
  # -->
13
13
  [
14
- [ String, nil],
15
- [ String, "I am a block"]
14
+ [ "This is a line.", nil],
15
+ [ "This is a line with a block", " I am a block."]
16
16
  ]
17
17
 
18
18
  Installation
@@ -45,6 +45,8 @@ module Kernel
45
45
  last = pair.last
46
46
 
47
47
  if last
48
+ last.shift if last.first.strip.empty?
49
+ last.pop if last.last.strip.empty?
48
50
  last = last.join("\n")
49
51
  end
50
52
 
@@ -1 +1 @@
1
- Walt_Version = "0.1.0"
1
+ Walt_Version = "0.1.1"
@@ -1,6 +1,20 @@
1
1
 
2
2
  describe "Walt" do
3
3
 
4
+ it "parses example from README.md" do
5
+ Walt(%@
6
+ This is a line.
7
+ This is a line with a block:
8
+
9
+ I am a block.
10
+
11
+
12
+ @).should == [
13
+ [ "This is a line.", nil],
14
+ [ "This is a line with a block", " I am a block."]
15
+ ]
16
+ end
17
+
4
18
  it "parses lines" do
5
19
  Walt(%@
6
20
  This is A.
@@ -15,7 +29,18 @@ describe "Walt" do
15
29
 
16
30
  Block
17
31
 
18
- @).should == [["This is A.", nil], ["This is B", " Block\n "] ]
32
+ @).should == [["This is A.", nil], ["This is B", " Block"] ]
33
+ end
34
+
35
+ it "removes empty lines surrounding block" do
36
+ Walt(%@
37
+ This is A.
38
+ This is B:
39
+
40
+ Block line 1.
41
+ Block line 2.
42
+
43
+ @).should == [["This is A.", nil], ["This is B", " Block line 1.\n Block line 2."] ]
19
44
  end
20
45
 
21
46
  it "does not remove last colon if line has no block." do
@@ -25,6 +50,6 @@ describe "Walt" do
25
50
  This is B.
26
51
  @).should == ["This is A.", "This is :memory:", "This is B."].zip([nil, nil, nil])
27
52
  end
28
-
53
+
29
54
  end # === Walt
30
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Walt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: