trenni 3.10.0 → 3.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/bake/trenni/entities.rb +57 -0
  3. data/bake/trenni/parsers.rb +66 -0
  4. data/ext/.DS_Store +0 -0
  5. data/ext/tmp/.DS_Store +0 -0
  6. data/ext/tmp/x86_64-darwin16/lib/trenni/trenni.bundle +0 -0
  7. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/Makefile +264 -0
  8. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/escape.o +0 -0
  9. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/markup.o +0 -0
  10. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/mkmf.log +105 -0
  11. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/tag.o +0 -0
  12. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/template.o +0 -0
  13. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/trenni.bundle +0 -0
  14. data/ext/tmp/x86_64-darwin16/trenni/2.4.0/trenni.o +0 -0
  15. data/ext/tmp/x86_64-darwin18/lib/trenni/trenni.bundle +0 -0
  16. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/Makefile +266 -0
  17. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/escape.o +0 -0
  18. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/markup.o +0 -0
  19. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/mkmf.log +109 -0
  20. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/tag.o +0 -0
  21. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/template.o +0 -0
  22. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/trenni.bundle +0 -0
  23. data/ext/tmp/x86_64-darwin18/trenni/2.6.1/trenni.o +0 -0
  24. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/Makefile +266 -0
  25. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/escape.o +0 -0
  26. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/markup.o +0 -0
  27. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/mkmf.log +109 -0
  28. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/tag.o +0 -0
  29. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/template.o +0 -0
  30. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/trenni.bundle +0 -0
  31. data/ext/tmp/x86_64-darwin18/trenni/2.6.2/trenni.o +0 -0
  32. data/ext/tmp/x86_64-darwin19/lib/trenni/trenni.bundle +0 -0
  33. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/Makefile +267 -0
  34. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/escape.o +0 -0
  35. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/markup.o +0 -0
  36. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/mkmf.log +109 -0
  37. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/query.o +0 -0
  38. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/tag.o +0 -0
  39. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/template.o +0 -0
  40. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/trenni.bundle +0 -0
  41. data/ext/tmp/x86_64-darwin19/trenni/2.7.1/trenni.o +0 -0
  42. data/ext/trenni/.DS_Store +0 -0
  43. data/lib/.DS_Store +0 -0
  44. data/lib/trenni/.DS_Store +0 -0
  45. data/lib/trenni/builder.rb +14 -4
  46. data/lib/trenni/entities.rb +2082 -2084
  47. data/lib/trenni/entities.trenni +1 -3
  48. data/lib/trenni/template.rb +19 -9
  49. data/lib/trenni/version.rb +1 -1
  50. data/parsers/.DS_Store +0 -0
  51. data/spec/.DS_Store +0 -0
  52. data/spec/trenni/builder_spec.rb +1 -1
  53. data/spec/trenni/template_spec/.DS_Store +0 -0
  54. metadata +73 -58
  55. data/.editorconfig +0 -6
  56. data/.gitignore +0 -19
  57. data/.rspec +0 -5
  58. data/.travis.yml +0 -23
  59. data/Gemfile +0 -21
  60. data/README.md +0 -312
  61. data/Rakefile +0 -21
  62. data/benchmark/call_vs_yield.rb +0 -52
  63. data/benchmark/interpolation_vs_concat.rb +0 -30
  64. data/benchmark/io_vs_string.rb +0 -91
  65. data/entities.json +0 -2233
  66. data/tasks/entities.rake +0 -34
  67. data/tasks/parsers.rake +0 -44
  68. data/trenni.gemspec +0 -38
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- task :fetch_entities do
4
- require 'open-uri'
5
- require 'json'
6
-
7
- entites_json_path = File.expand_path("entities.json", __dir__)
8
-
9
- unless File.exist? entites_json_path
10
- url = "https://www.w3.org/TR/html5/entities.json"
11
- File.write(entites_json_path, open(url).read)
12
- end
13
-
14
- @entities = JSON.parse(File.read(entites_json_path)).delete_if{|string, _| !string.end_with? ';'}
15
- end
16
-
17
- task :update_entities => :fetch_entities do
18
- require 'trenni/template'
19
-
20
- paths = {
21
- 'ext/trenni/entities.rl' => 'ext/trenni/entities.trenni',
22
- 'lib/trenni/entities.rb' => 'lib/trenni/entities.trenni',
23
- }
24
-
25
- paths.each do |output_path, template_path|
26
- template = Trenni::Template.load_file(template_path)
27
-
28
- puts template.send(:code)
29
-
30
- #output = template.to_string(@entities)
31
-
32
- #File.write(output_path, output)
33
- end
34
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- PARSERS_DIRECTORY = File.expand_path("../parsers", __dir__)
4
- FALLBACK_DIRECTORY = File.expand_path("../lib/trenni/fallback", __dir__)
5
- EXTENSIONS_DIRECTORY = File.expand_path("../ext", __dir__)
6
- NATIVE_DIRECTORY = File.expand_path("../ext/trenni", __dir__)
7
-
8
- task :generate_fallback_parsers do
9
- Dir.chdir(FALLBACK_DIRECTORY) do
10
- Dir.glob("*.rl").each do |parser_path|
11
- sh("ragel", "-I", PARSERS_DIRECTORY, "-R", parser_path, "-F1")
12
- end
13
-
14
- # sh("ruby-beautify", "--tabs", "--overwrite", *Dir.glob("*.rb"))
15
- end
16
- end
17
-
18
- task :generate_native_parsers do
19
- Dir.chdir(NATIVE_DIRECTORY) do
20
- Dir.glob("*.rl").each do |parser_path|
21
- sh("ragel", "-I", PARSERS_DIRECTORY, "-C", parser_path, "-G2")
22
- end
23
- end
24
- end
25
-
26
- task :compile do
27
- system("rake", "compile", chdir: EXTENSIONS_DIRECTORY)
28
- end
29
-
30
- task :generate_parsers => [:generate_native_parsers, :generate_fallback_parsers, :compile]
31
-
32
- task :visualize_parsers do
33
- Dir.chdir(FALLBACK_DIRECTORY) do
34
- Dir.glob("*.rl").each do |parser_path|
35
- dot_path = parser_path + ".dot"
36
- sh("ragel", "-I", PARSERS_DIRECTORY, "-Vp", parser_path, "-o", dot_path)
37
-
38
- pdf_path = parser_path + ".pdf"
39
- sh("dot", "-Tpdf", "-o", pdf_path, dot_path)
40
-
41
- sh("open", pdf_path) rescue nil
42
- end
43
- end
44
- end
@@ -1,38 +0,0 @@
1
-
2
- require_relative 'lib/trenni/version'
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = "trenni"
6
- spec.platform = Gem::Platform::RUBY
7
- spec.license = "MIT"
8
- spec.version = Trenni::VERSION
9
- spec.authors = ["Samuel Williams"]
10
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
11
- spec.description = <<-EOF
12
- Trenni is a templating system built on top of SGML/XML. It uses efficient
13
- native parsers where possible and compiles templates into efficient Ruby.
14
-
15
- In addition, Trenni includes an SGML/XML builder to assist with the generation
16
- of pleasantly formatted markup which is compatible with the included parsers.
17
- EOF
18
-
19
- spec.summary = "A fast native templating system that compiles directly to Ruby code."
20
-
21
- spec.homepage = "https://github.com/ioquatix/trenni"
22
- spec.metadata["funding_uri"] = "https://github.com/sponsors/ioquatix"
23
-
24
- spec.files = `git ls-files`.split($/)
25
- spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
26
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
27
- spec.require_paths = ["lib"]
28
-
29
- spec.required_ruby_version = "~> 2.4"
30
-
31
- spec.extensions = %w[ext/Rakefile]
32
- spec.add_dependency "rake-compiler"
33
-
34
- spec.add_development_dependency "rack"
35
- spec.add_development_dependency "bundler"
36
- spec.add_development_dependency "rspec", "~> 3.4"
37
- spec.add_development_dependency "rake"
38
- end