trenni 3.7.1 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/Gemfile +2 -1
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/benchmark/call_vs_yield.rb +1 -0
- data/benchmark/interpolation_vs_concat.rb +1 -0
- data/benchmark/io_vs_string.rb +1 -0
- data/ext/Rakefile +1 -0
- data/ext/trenni/extconf.rb +1 -0
- data/lib/trenni.rb +2 -0
- data/lib/trenni/buffer.rb +2 -0
- data/lib/trenni/builder.rb +2 -0
- data/lib/trenni/entities.rb +2 -0
- data/lib/trenni/fallback/markup.rb +19 -17
- data/lib/trenni/fallback/markup.rl +1 -0
- data/lib/trenni/fallback/template.rb +1 -0
- data/lib/trenni/markup.rb +2 -0
- data/lib/trenni/native.rb +2 -0
- data/lib/trenni/parse_delegate.rb +2 -0
- data/lib/trenni/parse_error.rb +2 -0
- data/lib/trenni/parsers.rb +1 -0
- data/lib/trenni/strings.rb +2 -0
- data/lib/trenni/tag.rb +2 -0
- data/lib/trenni/template.rb +3 -1
- data/lib/trenni/uri.rb +2 -0
- data/lib/trenni/version.rb +3 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/trenni/builder_spec.rb +1 -0
- data/spec/trenni/corpus/large.rb +2 -0
- data/spec/trenni/markup_parser_spec.rb +1 -0
- data/spec/trenni/markup_performance_spec.rb +1 -0
- data/spec/trenni/markup_spec.rb +1 -0
- data/spec/trenni/parsers_performance_spec.rb +1 -0
- data/spec/trenni/strings_spec.rb +1 -0
- data/spec/trenni/tag_spec.rb +2 -0
- data/spec/trenni/template_error_spec.rb +1 -0
- data/spec/trenni/template_performance_spec.rb +1 -0
- data/spec/trenni/template_spec.rb +1 -0
- data/spec/trenni/uri_spec.rb +1 -0
- data/tasks/entities.rake +1 -0
- data/tasks/parsers.rake +2 -1
- data/trenni.gemspec +17 -14
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a26e4589abdde22a5b44a719a5d5e429b5efc2ea39c739399d2cb063e7e8cf4
|
4
|
+
data.tar.gz: a8599966b8c8199461df0f10b69c609a94aa70005b2454be3e0dc68276bc5fc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 681cb654a128f2759084febb2741f70f94eee995d9476ebec84141dabefdefd0ffa7868167371234fbbd95e9aa86fcfaf5fa5947348eb9248de64923f51d5aa5
|
7
|
+
data.tar.gz: 8613b8452812b7c68b7c3e8389a160987e31a4ae548827b58cdff26be22c4c6b48972312af6ea94f0cf97a5a683b62bf9dde4e3baf5d636f9178d1bc050aa2e5
|
data/.travis.yml
CHANGED
@@ -6,7 +6,6 @@ before_script:
|
|
6
6
|
|
7
7
|
matrix:
|
8
8
|
include:
|
9
|
-
- rvm: 2.3
|
10
9
|
- rvm: 2.4
|
11
10
|
- rvm: 2.5
|
12
11
|
- rvm: 2.6
|
@@ -14,10 +13,11 @@ matrix:
|
|
14
13
|
env: TRENNI_PREFER_FALLBACK=y
|
15
14
|
- rvm: 2.6
|
16
15
|
env: COVERAGE=Summary
|
16
|
+
- rvm: 2.7
|
17
17
|
- rvm: ruby-head
|
18
18
|
- rvm: jruby-head
|
19
19
|
- rvm: truffleruby
|
20
20
|
allow_failures:
|
21
|
-
- rvm:
|
22
|
-
- rvm:
|
23
|
-
- rvm:
|
21
|
+
- rvm: truffleruby
|
22
|
+
- rvm: ruby-head
|
23
|
+
- rvm: jruby-head
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Trenni is a templating system built loosely on top of XHTML markup. It uses efficient native parsers where possible and compiles templates into efficient Ruby. It also includes a markup builder to assist with the generation of pleasantly formatted markup which is compatible with the included parsers.
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://travis-ci.com/ioquatix/trenni.svg?branch=master)](https://travis-ci.com/ioquatix/trenni)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/ioquatix/trenni.svg)](https://codeclimate.com/github/ioquatix/trenni)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/ioquatix/trenni/badge.svg)](https://coveralls.io/r/ioquatix/trenni)
|
8
8
|
|
data/Rakefile
CHANGED
data/benchmark/call_vs_yield.rb
CHANGED
data/benchmark/io_vs_string.rb
CHANGED
data/ext/Rakefile
CHANGED
data/ext/trenni/extconf.rb
CHANGED
data/lib/trenni.rb
CHANGED
data/lib/trenni/buffer.rb
CHANGED
data/lib/trenni/builder.rb
CHANGED
data/lib/trenni/entities.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
# line 1 "markup.rl"
|
3
4
|
# Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
@@ -434,6 +435,7 @@ module Trenni
|
|
434
435
|
# line 214 "markup.rl"
|
435
436
|
def self.parse_markup(buffer, delegate, entities)
|
436
437
|
data = buffer.read
|
438
|
+
encoding = buffer.encoding
|
437
439
|
bytes = data.bytes
|
438
440
|
p = 0
|
439
441
|
# Must set pe here or it gets incorrectly set to data.length
|
@@ -606,7 +608,7 @@ module Trenni
|
|
606
608
|
# line 32 "markup.rl"
|
607
609
|
begin
|
608
610
|
|
609
|
-
pcdata =
|
611
|
+
pcdata = String.new.force_encoding(encoding)
|
610
612
|
has_entities = false
|
611
613
|
end
|
612
614
|
# line 49 "markup.rl"
|
@@ -618,7 +620,7 @@ module Trenni
|
|
618
620
|
# line 32 "markup.rl"
|
619
621
|
begin
|
620
622
|
|
621
|
-
pcdata =
|
623
|
+
pcdata = String.new.force_encoding(encoding)
|
622
624
|
has_entities = false
|
623
625
|
end
|
624
626
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -716,7 +718,7 @@ module Trenni
|
|
716
718
|
begin
|
717
719
|
|
718
720
|
has_value = false
|
719
|
-
pcdata =
|
721
|
+
pcdata = String.new.force_encoding(encoding)
|
720
722
|
end
|
721
723
|
# line 24 "markup.rl"
|
722
724
|
begin
|
@@ -804,7 +806,7 @@ module Trenni
|
|
804
806
|
# line 32 "markup.rl"
|
805
807
|
begin
|
806
808
|
|
807
|
-
pcdata =
|
809
|
+
pcdata = String.new.force_encoding(encoding)
|
808
810
|
has_entities = false
|
809
811
|
end
|
810
812
|
# line 49 "markup.rl"
|
@@ -820,7 +822,7 @@ module Trenni
|
|
820
822
|
# line 32 "markup.rl"
|
821
823
|
begin
|
822
824
|
|
823
|
-
pcdata =
|
825
|
+
pcdata = String.new.force_encoding(encoding)
|
824
826
|
has_entities = false
|
825
827
|
end
|
826
828
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -891,7 +893,7 @@ module Trenni
|
|
891
893
|
# line 32 "markup.rl"
|
892
894
|
begin
|
893
895
|
|
894
|
-
pcdata =
|
896
|
+
pcdata = String.new.force_encoding(encoding)
|
895
897
|
has_entities = false
|
896
898
|
end
|
897
899
|
# line 49 "markup.rl"
|
@@ -913,7 +915,7 @@ module Trenni
|
|
913
915
|
# line 32 "markup.rl"
|
914
916
|
begin
|
915
917
|
|
916
|
-
pcdata =
|
918
|
+
pcdata = String.new.force_encoding(encoding)
|
917
919
|
has_entities = false
|
918
920
|
end
|
919
921
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -940,7 +942,7 @@ module Trenni
|
|
940
942
|
# line 32 "markup.rl"
|
941
943
|
begin
|
942
944
|
|
943
|
-
pcdata =
|
945
|
+
pcdata = String.new.force_encoding(encoding)
|
944
946
|
has_entities = false
|
945
947
|
end
|
946
948
|
# line 49 "markup.rl"
|
@@ -962,7 +964,7 @@ module Trenni
|
|
962
964
|
# line 32 "markup.rl"
|
963
965
|
begin
|
964
966
|
|
965
|
-
pcdata =
|
967
|
+
pcdata = String.new.force_encoding(encoding)
|
966
968
|
has_entities = false
|
967
969
|
end
|
968
970
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -988,7 +990,7 @@ module Trenni
|
|
988
990
|
# line 32 "markup.rl"
|
989
991
|
begin
|
990
992
|
|
991
|
-
pcdata =
|
993
|
+
pcdata = String.new.force_encoding(encoding)
|
992
994
|
has_entities = false
|
993
995
|
end
|
994
996
|
# line 49 "markup.rl"
|
@@ -1009,7 +1011,7 @@ module Trenni
|
|
1009
1011
|
# line 32 "markup.rl"
|
1010
1012
|
begin
|
1011
1013
|
|
1012
|
-
pcdata =
|
1014
|
+
pcdata = String.new.force_encoding(encoding)
|
1013
1015
|
has_entities = false
|
1014
1016
|
end
|
1015
1017
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -1035,7 +1037,7 @@ module Trenni
|
|
1035
1037
|
# line 32 "markup.rl"
|
1036
1038
|
begin
|
1037
1039
|
|
1038
|
-
pcdata =
|
1040
|
+
pcdata = String.new.force_encoding(encoding)
|
1039
1041
|
has_entities = false
|
1040
1042
|
end
|
1041
1043
|
# line 49 "markup.rl"
|
@@ -1056,7 +1058,7 @@ module Trenni
|
|
1056
1058
|
# line 32 "markup.rl"
|
1057
1059
|
begin
|
1058
1060
|
|
1059
|
-
pcdata =
|
1061
|
+
pcdata = String.new.force_encoding(encoding)
|
1060
1062
|
has_entities = false
|
1061
1063
|
end
|
1062
1064
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -1082,7 +1084,7 @@ module Trenni
|
|
1082
1084
|
# line 32 "markup.rl"
|
1083
1085
|
begin
|
1084
1086
|
|
1085
|
-
pcdata =
|
1087
|
+
pcdata = String.new.force_encoding(encoding)
|
1086
1088
|
has_entities = false
|
1087
1089
|
end
|
1088
1090
|
# line 49 "markup.rl"
|
@@ -1103,7 +1105,7 @@ module Trenni
|
|
1103
1105
|
# line 32 "markup.rl"
|
1104
1106
|
begin
|
1105
1107
|
|
1106
|
-
pcdata =
|
1108
|
+
pcdata = String.new.force_encoding(encoding)
|
1107
1109
|
has_entities = false
|
1108
1110
|
end
|
1109
1111
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
@@ -1130,7 +1132,7 @@ module Trenni
|
|
1130
1132
|
# line 32 "markup.rl"
|
1131
1133
|
begin
|
1132
1134
|
|
1133
|
-
pcdata =
|
1135
|
+
pcdata = String.new.force_encoding(encoding)
|
1134
1136
|
has_entities = false
|
1135
1137
|
end
|
1136
1138
|
# line 49 "markup.rl"
|
@@ -1152,7 +1154,7 @@ module Trenni
|
|
1152
1154
|
# line 32 "markup.rl"
|
1153
1155
|
begin
|
1154
1156
|
|
1155
|
-
pcdata =
|
1157
|
+
pcdata = String.new.force_encoding(encoding)
|
1156
1158
|
has_entities = false
|
1157
1159
|
end
|
1158
1160
|
# line 10 "/Users/samuel/Documents/Programming/ioquatix/trenni/parsers/trenni/entities.rl"
|
data/lib/trenni/markup.rb
CHANGED
data/lib/trenni/native.rb
CHANGED
data/lib/trenni/parse_error.rb
CHANGED
data/lib/trenni/parsers.rb
CHANGED
data/lib/trenni/strings.rb
CHANGED
data/lib/trenni/tag.rb
CHANGED
data/lib/trenni/template.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -123,7 +125,7 @@ module Trenni
|
|
123
125
|
end
|
124
126
|
|
125
127
|
def to_proc(scope = @binding.dup)
|
126
|
-
@compiled_proc ||= eval("
|
128
|
+
@compiled_proc ||= eval("\# frozen_string_literals: true\nproc{|#{OUT}|;#{code}}", scope, @buffer.path, 0).freeze
|
127
129
|
end
|
128
130
|
|
129
131
|
protected
|
data/lib/trenni/uri.rb
CHANGED
data/lib/trenni/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
4
|
#
|
3
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -19,5 +21,5 @@
|
|
19
21
|
# THE SOFTWARE.
|
20
22
|
|
21
23
|
module Trenni
|
22
|
-
VERSION = "3.
|
24
|
+
VERSION = "3.8.0"
|
23
25
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/trenni/builder_spec.rb
CHANGED
data/spec/trenni/corpus/large.rb
CHANGED
data/spec/trenni/markup_spec.rb
CHANGED
data/spec/trenni/strings_spec.rb
CHANGED
data/spec/trenni/tag_spec.rb
CHANGED
data/spec/trenni/uri_spec.rb
CHANGED
data/tasks/entities.rake
CHANGED
data/tasks/parsers.rake
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
PARSERS_DIRECTORY = File.expand_path("../parsers", __dir__)
|
3
4
|
FALLBACK_DIRECTORY = File.expand_path("../lib/trenni/fallback", __dir__)
|
@@ -10,7 +11,7 @@ task :generate_fallback_parsers do
|
|
10
11
|
sh("ragel", "-I", PARSERS_DIRECTORY, "-R", parser_path, "-F1")
|
11
12
|
end
|
12
13
|
|
13
|
-
sh("ruby-beautify", "--tabs", "--overwrite", *Dir.glob("*.rb"))
|
14
|
+
# sh("ruby-beautify", "--tabs", "--overwrite", *Dir.glob("*.rb"))
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
data/trenni.gemspec
CHANGED
@@ -1,28 +1,31 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
require_relative 'lib/trenni/version'
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
|
-
spec.name
|
6
|
-
spec.platform
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
10
|
-
spec.description
|
5
|
+
spec.name = "trenni"
|
6
|
+
spec.platform = Gem::Platform::RUBY
|
7
|
+
spec.version = Trenni::VERSION
|
8
|
+
spec.authors = ["Samuel Williams"]
|
9
|
+
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
10
|
+
spec.description = <<-EOF
|
11
11
|
Trenni is a templating system built on top of SGML/XML. It uses efficient
|
12
12
|
native parsers where possible and compiles templates into efficient Ruby.
|
13
13
|
|
14
14
|
In addition, Trenni includes an SGML/XML builder to assist with the generation
|
15
15
|
of pleasantly formatted markup which is compatible with the included parsers.
|
16
16
|
EOF
|
17
|
-
|
18
|
-
spec.
|
19
|
-
|
20
|
-
spec.
|
21
|
-
spec.
|
22
|
-
|
17
|
+
|
18
|
+
spec.summary = "A fast native templating system that compiles directly to Ruby code."
|
19
|
+
|
20
|
+
spec.homepage = "https://github.com/ioquatix/trenni"
|
21
|
+
spec.metadata["funding_uri"] = "https://github.com/sponsors/ioquatix"
|
22
|
+
|
23
|
+
spec.files = `git ls-files`.split($/)
|
24
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
25
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
26
|
spec.require_paths = ["lib"]
|
24
27
|
|
25
|
-
spec.required_ruby_version =
|
28
|
+
spec.required_ruby_version = "~> 2.4"
|
26
29
|
|
27
30
|
spec.extensions = %w[ext/Rakefile]
|
28
31
|
spec.add_dependency "rake-compiler"
|
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.8.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:
|
11
|
+
date: 2020-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -154,7 +154,8 @@ files:
|
|
154
154
|
- trenni.gemspec
|
155
155
|
homepage: https://github.com/ioquatix/trenni
|
156
156
|
licenses: []
|
157
|
-
metadata:
|
157
|
+
metadata:
|
158
|
+
funding_uri: https://github.com/sponsors/ioquatix
|
158
159
|
post_install_message:
|
159
160
|
rdoc_options: []
|
160
161
|
require_paths:
|
@@ -163,14 +164,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
164
|
requirements:
|
164
165
|
- - "~>"
|
165
166
|
- !ruby/object:Gem::Version
|
166
|
-
version: '2.
|
167
|
+
version: '2.4'
|
167
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
169
|
requirements:
|
169
170
|
- - ">="
|
170
171
|
- !ruby/object:Gem::Version
|
171
172
|
version: '0'
|
172
173
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.1.2
|
174
175
|
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: A fast native templating system that compiles directly to Ruby code.
|