trenni 3.9.0 → 3.10.0
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 +4 -4
- data/lib/trenni/builder.rb +7 -3
- data/lib/trenni/version.rb +1 -1
- data/spec/trenni/builder_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d691d52d748f9bad0d6f17c5c36a7572366f3a5810c65887e989f9d61ffabdb5
|
4
|
+
data.tar.gz: d6500ff06162ffbf6ce8fda15c708647389580d0b8910cb91a83d56595070f77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef1b5b1125289c6defb4e8e692f6dc0309912065116c39f4a6d44e679394176a60c529a49fc7915790f5f2a3d83a33b92810f13225414650c5901ad8295df50
|
7
|
+
data.tar.gz: 41bb01d2f1326d26c04a402d8ca46ccd144007d537e745888d4f7be476066e895467ea2cada4a0a1b112dfd9934069412abea98fd3c58a0150046a9e356c1f9d
|
data/lib/trenni/builder.rb
CHANGED
@@ -103,21 +103,25 @@ module Trenni
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
|
-
def text(
|
107
|
-
return unless
|
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,
|
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
|
data/lib/trenni/version.rb
CHANGED
data/spec/trenni/builder_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|