trenni 3.9.0 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8daf0b4e7519f7cf5dc9ceb959b17b13094b2908ed1d5a7421880c9867511b1
4
- data.tar.gz: 15c6e221db0e24ed37a7b3cc65c8ce68be223972c1bb75a0e0171d3b4725ba78
3
+ metadata.gz: d691d52d748f9bad0d6f17c5c36a7572366f3a5810c65887e989f9d61ffabdb5
4
+ data.tar.gz: d6500ff06162ffbf6ce8fda15c708647389580d0b8910cb91a83d56595070f77
5
5
  SHA512:
6
- metadata.gz: c7063eae72ed9a392771c904152cb472cb18e4b46196e20365dc9cace23347eca3054c33a2c01badd8d6ed6a027121aa6ec2b4f616597ff752810d339a61cef7
7
- data.tar.gz: 531ed1c5fabc91dd36eb299b1c779c417f65c7aefc0026aa5ecaab3a6d84a2dce22eb7fa8dfdf43d1a1c36e9eb840d5d39acd51e6d4a9e8e471fe0dc6577a70f
6
+ metadata.gz: 6ef1b5b1125289c6defb4e8e692f6dc0309912065116c39f4a6d44e679394176a60c529a49fc7915790f5f2a3d83a33b92810f13225414650c5901ad8295df50
7
+ data.tar.gz: 41bb01d2f1326d26c04a402d8ca46ccd144007d537e745888d4f7be476066e895467ea2cada4a0a1b112dfd9934069412abea98fd3c58a0150046a9e356c1f9d
@@ -103,21 +103,25 @@ module Trenni
103
103
  end
104
104
  end
105
105
 
106
- def text(value)
107
- return unless value
106
+ def text(content)
107
+ return unless content
108
108
 
109
109
  if @indent
110
110
  @output << "\n" if @level.last > 0
111
111
  @output << indentation
112
112
  end
113
113
 
114
- Markup.append(@output, value)
114
+ Markup.append(@output, content)
115
115
 
116
116
  if @indent
117
117
  @output << "\n"
118
118
  end
119
119
  end
120
120
 
121
+ def << content
122
+ text(content)
123
+ end
124
+
121
125
  # Append pre-existing markup:
122
126
  def append(value)
123
127
  return unless value
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Trenni
24
- VERSION = "3.9.0"
24
+ VERSION = "3.10.0"
25
25
  end
@@ -55,6 +55,18 @@ module Trenni::BuilderSpec
55
55
  end
56
56
 
57
57
  describe Trenni::Builder do
58
+ describe '#<<' do
59
+ it 'can append text' do
60
+ subject << 'text'
61
+ expect(subject.output).to be == "text\n"
62
+ end
63
+
64
+ it "doesn't append nil" do
65
+ subject << nil
66
+ expect(subject.output).to be == ""
67
+ end
68
+ end
69
+
58
70
  it 'should be able to append nil' do
59
71
  expect{subject.append(nil)}.to_not raise_error
60
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trenni
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-14 00:00:00.000000000 Z
11
+ date: 2020-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler