trenni 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trenni/template.rb +5 -1
- data/lib/trenni/version.rb +1 -1
- data/spec/trenni/builder_spec.rb +1 -1
- data/spec/trenni/template_spec.rb +4 -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: 50784d6ac977a20302a0fbaff7808065161c569c
|
4
|
+
data.tar.gz: f07903da43893883ab2e5238af72ede943ebe221
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11e041b09097ecb7a0bf3d635ad6d11df0d29b76844e95a920c6e6efd7ec7e87abf4f7fd3013e4e4ce13db7ea69b0d2daf28c45a119a2b1bb0aca91a02a4a5f6
|
7
|
+
data.tar.gz: df06c19505556ab8b16a82ab4788f6d5f08e782f376f74e53d181d32ca3fa92c1b17f6cbbd843f75f00f00332903cf469e1398eaf0f3f142f6864d0568cb46a3
|
data/lib/trenni/template.rb
CHANGED
@@ -50,7 +50,11 @@ module Trenni
|
|
50
50
|
|
51
51
|
# Output raw text to the template.
|
52
52
|
def text(text)
|
53
|
-
|
53
|
+
text = text.gsub("'", "\\\\'")
|
54
|
+
@parts << "#{OUT}<<'#{text}';"
|
55
|
+
|
56
|
+
# This is an interesting approach, but it doens't preserve newlines or tabs as raw characters, so template line numbers don't match up.
|
57
|
+
# @parts << "#{OUT}<<#{text.dump};"
|
54
58
|
end
|
55
59
|
|
56
60
|
# Output a ruby expression (or part of).
|
data/lib/trenni/version.rb
CHANGED
data/spec/trenni/builder_spec.rb
CHANGED
@@ -45,7 +45,7 @@ module Trenni::BuilderSpec
|
|
45
45
|
|
46
46
|
describe Trenni::Builder do
|
47
47
|
it 'should be able to append nil' do
|
48
|
-
expect{subject.append(nil)}.to_not raise_error
|
48
|
+
expect{subject.append(nil)}.to_not raise_error
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should append existing markup' do
|
@@ -74,6 +74,10 @@ module Trenni::TemplateSpec
|
|
74
74
|
|
75
75
|
let(:escaped_template) {Trenni::Template.load_file File.expand_path('template_spec/escaped.trenni', __dir__)}
|
76
76
|
|
77
|
+
it "should have the same number of lines as input" do
|
78
|
+
expect(escaped_template.send(:code).lines.count).to be == 2
|
79
|
+
end
|
80
|
+
|
77
81
|
it "should process escaped characters" do
|
78
82
|
expect(escaped_template.to_string).to be ==
|
79
83
|
"This\\nisn't one line.\n" +
|
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: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|