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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ff8d7a73ba2ef5c153eff38d0869b2d6cb53a91
4
- data.tar.gz: 5a8a5f044ea099e6d69fc17d1481f47f2a678f47
3
+ metadata.gz: 50784d6ac977a20302a0fbaff7808065161c569c
4
+ data.tar.gz: f07903da43893883ab2e5238af72ede943ebe221
5
5
  SHA512:
6
- metadata.gz: 505a3e2d978b00b89764a085402d94d5d15c6c8230ed91f4f6f5970d6c5752f86af98d176e9be7bbd40d9b294ad35d6e13b08194d4f846706444bc5a916f13ac
7
- data.tar.gz: a08e384c2cf0487b9567e972b701f8b5d70b0b8d737e579bc7c76fc9586228657e1cee554d099ffc45b23d6150f7ad0a8a5bf3c976cfc4e39166c3e7cd023000
6
+ metadata.gz: 11e041b09097ecb7a0bf3d635ad6d11df0d29b76844e95a920c6e6efd7ec7e87abf4f7fd3013e4e4ce13db7ea69b0d2daf28c45a119a2b1bb0aca91a02a4a5f6
7
+ data.tar.gz: df06c19505556ab8b16a82ab4788f6d5f08e782f376f74e53d181d32ca3fa92c1b17f6cbbd843f75f00f00332903cf469e1398eaf0f3f142f6864d0568cb46a3
@@ -50,7 +50,11 @@ module Trenni
50
50
 
51
51
  # Output raw text to the template.
52
52
  def text(text)
53
- @parts << "#{OUT}<<#{text.dump};"
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).
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Trenni
22
- VERSION = "1.5.0"
22
+ VERSION = "1.5.1"
23
23
  end
@@ -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(TypeError)
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.0
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-10 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler