temple 0.8.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +34 -0
  3. data/.gitignore +1 -0
  4. data/CHANGES +25 -1
  5. data/Gemfile +0 -1
  6. data/README.md +1 -1
  7. data/Rakefile +4 -11
  8. data/lib/temple/erb/engine.rb +2 -0
  9. data/lib/temple/erb/parser.rb +1 -1
  10. data/lib/temple/filters/ambles.rb +21 -0
  11. data/lib/temple/filters/string_splitter.rb +12 -1
  12. data/lib/temple/generator.rb +1 -1
  13. data/lib/temple/generators/rails_output_buffer.rb +3 -4
  14. data/lib/temple/mixins/grammar_dsl.rb +2 -1
  15. data/lib/temple/templates/rails.rb +6 -2
  16. data/lib/temple/templates/tilt.rb +1 -9
  17. data/lib/temple/utils.rb +4 -15
  18. data/lib/temple/version.rb +1 -1
  19. data/lib/temple.rb +1 -0
  20. data/spec/engine_spec.rb +189 -0
  21. data/{test/test_erb.rb → spec/erb_spec.rb} +12 -12
  22. data/spec/filter_spec.rb +29 -0
  23. data/{test/filters/test_code_merger.rb → spec/filters/code_merger_spec.rb} +7 -7
  24. data/{test/filters/test_control_flow.rb → spec/filters/control_flow_spec.rb} +13 -13
  25. data/{test/filters/test_dynamic_inliner.rb → spec/filters/dynamic_inliner_spec.rb} +18 -18
  26. data/{test/filters/test_eraser.rb → spec/filters/eraser_spec.rb} +9 -9
  27. data/{test/filters/test_escapable.rb → spec/filters/escapable_spec.rb} +10 -10
  28. data/{test/filters/test_multi_flattener.rb → spec/filters/multi_flattener_spec.rb} +4 -4
  29. data/{test/filters/test_static_analyzer.rb → spec/filters/static_analyzer_spec.rb} +6 -8
  30. data/{test/filters/test_static_merger.rb → spec/filters/static_merger_spec.rb} +7 -7
  31. data/spec/filters/string_splitter_spec.rb +50 -0
  32. data/spec/generator_spec.rb +158 -0
  33. data/spec/grammar_spec.rb +47 -0
  34. data/{test/html/test_attribute_merger.rb → spec/html/attribute_merger_spec.rb} +11 -11
  35. data/{test/html/test_attribute_remover.rb → spec/html/attribute_remover_spec.rb} +7 -7
  36. data/{test/html/test_attribute_sorter.rb → spec/html/attribute_sorter_spec.rb} +7 -7
  37. data/{test/html/test_fast.rb → spec/html/fast_spec.rb} +23 -23
  38. data/{test/html/test_pretty.rb → spec/html/pretty_spec.rb} +7 -7
  39. data/spec/map_spec.rb +39 -0
  40. data/{test/mixins/test_dispatcher.rb → spec/mixins/dispatcher_spec.rb} +12 -12
  41. data/{test/mixins/test_grammar_dsl.rb → spec/mixins/grammar_dsl_spec.rb} +19 -19
  42. data/{test/helper.rb → spec/spec_helper.rb} +5 -6
  43. data/{test/test_static_analyzer.rb → spec/static_analyzer_spec.rb} +6 -6
  44. data/spec/utils_spec.rb +39 -0
  45. data/temple.gemspec +3 -4
  46. metadata +34 -59
  47. data/.travis.yml +0 -30
  48. data/test/filters/test_string_splitter.rb +0 -25
  49. data/test/test_engine.rb +0 -189
  50. data/test/test_filter.rb +0 -29
  51. data/test/test_generator.rb +0 -158
  52. data/test/test_grammar.rb +0 -47
  53. data/test/test_map.rb +0 -39
  54. data/test/test_utils.rb +0 -39
data/test/test_utils.rb DELETED
@@ -1,39 +0,0 @@
1
- require 'helper'
2
-
3
- class UniqueTest
4
- include Temple::Utils
5
- end
6
-
7
- describe Temple::Utils do
8
- it 'has empty_exp?' do
9
- Temple::Utils.empty_exp?([:multi]).should.be.true
10
- Temple::Utils.empty_exp?([:multi, [:multi]]).should.be.true
11
- Temple::Utils.empty_exp?([:multi, [:multi, [:newline]], [:newline]]).should.be.true
12
- Temple::Utils.empty_exp?([:multi]).should.be.true
13
- Temple::Utils.empty_exp?([:multi, [:multi, [:static, 'text']]]).should.be.false
14
- Temple::Utils.empty_exp?([:multi, [:newline], [:multi, [:dynamic, 'text']]]).should.be.false
15
- end
16
-
17
- it 'has unique_name' do
18
- u = UniqueTest.new
19
- u.unique_name.should.equal '_uniquetest1'
20
- u.unique_name.should.equal '_uniquetest2'
21
- UniqueTest.new.unique_name.should.equal '_uniquetest1'
22
- end
23
-
24
- it 'has escape_html' do
25
- Temple::Utils.escape_html('<').should.equal '&lt;'
26
- end
27
-
28
- it 'should escape unsafe html strings' do
29
- with_html_safe do
30
- Temple::Utils.escape_html_safe('<').should.equal '&lt;'
31
- end
32
- end
33
-
34
- it 'should not escape safe html strings' do
35
- with_html_safe do
36
- Temple::Utils.escape_html_safe('<'.html_safe).should.equal '<'
37
- end
38
- end
39
- end