malt 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/History.rdoc +18 -0
  2. data/README.rdoc +6 -2
  3. data/lib/malt.rb +9 -0
  4. data/lib/malt/engines/abstract.rb +7 -7
  5. data/lib/malt/engines/bluecloth.rb +3 -3
  6. data/lib/malt/engines/builder.rb +72 -0
  7. data/lib/malt/engines/erb.rb +2 -0
  8. data/lib/malt/engines/erector.rb +59 -0
  9. data/lib/malt/engines/haml.rb +2 -2
  10. data/lib/malt/engines/kramdown.rb +6 -4
  11. data/lib/malt/engines/less.rb +8 -8
  12. data/lib/malt/engines/markaby.rb +51 -0
  13. data/lib/malt/engines/mustache.rb +44 -0
  14. data/lib/malt/engines/radius.rb +4 -4
  15. data/lib/malt/engines/ragtag.rb +49 -0
  16. data/lib/malt/engines/rdiscount.rb +1 -1
  17. data/lib/malt/engines/rdoc.rb +3 -3
  18. data/lib/malt/engines/redcloth.rb +1 -1
  19. data/lib/malt/engines/sass.rb +8 -8
  20. data/lib/malt/engines/tenjin.rb +6 -6
  21. data/lib/malt/formats/abstract.rb +8 -2
  22. data/lib/malt/formats/builder.rb +56 -0
  23. data/lib/malt/formats/css.rb +8 -8
  24. data/lib/malt/formats/erector.rb +53 -0
  25. data/lib/malt/formats/haml.rb +2 -2
  26. data/lib/malt/formats/html.rb +3 -3
  27. data/lib/malt/formats/latex.rb +4 -4
  28. data/lib/malt/formats/less.rb +5 -5
  29. data/lib/malt/formats/liquid.rb +11 -1
  30. data/lib/malt/formats/markaby.rb +53 -0
  31. data/lib/malt/formats/markdown.rb +6 -6
  32. data/lib/malt/formats/mustache.rb +34 -0
  33. data/lib/malt/formats/pdf.rb +2 -2
  34. data/lib/malt/formats/radius.rb +4 -4
  35. data/lib/malt/formats/{rtals.rb → ragtag.rb} +13 -9
  36. data/lib/malt/formats/rdoc.rb +4 -4
  37. data/lib/malt/formats/ruby.rb +2 -2
  38. data/lib/malt/formats/sass.rb +10 -0
  39. data/lib/malt/formats/scss.rb +10 -0
  40. data/lib/malt/formats/tenjin.rb +4 -4
  41. data/lib/malt/formats/textile.rb +12 -12
  42. data/lib/malt/formats/xml.rb +29 -0
  43. data/lib/malt/formats/yaml.rb +2 -2
  44. data/lib/malt/meta/data.rb +4 -4
  45. data/lib/malt/meta/{gemfile → package} +6 -2
  46. data/lib/malt/render.rb +37 -9
  47. data/meta/data.rb +4 -4
  48. data/meta/{gemfile → package} +6 -2
  49. data/qed/03_formats/08_ragtag.rdoc +19 -0
  50. data/qed/03_formats/17_markaby.rdoc +50 -0
  51. data/qed/03_formats/18_builder.rb +50 -0
  52. data/qed/03_formats/19_erector.rb +50 -0
  53. data/qed/03_formats/20_mustache.rdoc +54 -0
  54. data/{test/samples/sample.md → qed/samples/sample.markdown} +0 -0
  55. data/{test → qed}/samples/sample.rdoc +0 -0
  56. metadata +81 -12
  57. data/lib/malt/engines/rtals.rb +0 -46
  58. data/qed/03_formats/08_rtal.rdoc +0 -15
@@ -1,46 +0,0 @@
1
- require 'malt/engines/abstract'
2
-
3
- module Malt::Engine
4
-
5
- # RTALS
6
- #
7
- # http://github.com/rubyworks/rtals
8
- #
9
- class RTALS < Abstract
10
-
11
- default :rtal
12
-
13
- #
14
- def render(params, &yld)
15
- text = params[:text]
16
- file = params[:file]
17
- data = params[:data]
18
- format = params[:format]
19
-
20
- case format
21
- when :html, :xml, nil
22
- data = make_binding(data, &yld)
23
- intermediate(params).compile(data).to_s
24
- else
25
- super(params, &yld)
26
- end
27
- end
28
-
29
- #
30
- def intermediate(params)
31
- text = params[:text]
32
- ::RTAL.new(text)
33
- end
34
-
35
- private
36
-
37
- # Load Haml library if not already loaded.
38
- def initialize_engine
39
- return if defined? ::RTAL
40
- require_library 'rtals'
41
- end
42
-
43
- end
44
-
45
- end
46
-
@@ -1,15 +0,0 @@
1
- == RTAL
2
-
3
- Lets say we have a Rtals document called 'test.rtal' containing:
4
-
5
- <h1>Example<span replace="title">DUMMY</span></h1>
6
- <p>This is an example of a Rtals template.</p>
7
-
8
- We can render Rtal documents via the +render+ method, as we can any format.
9
-
10
- data = { :title=>"Document" }
11
-
12
- html = Malt.render(:file=>'tmp/test.rtal', :data=>data)
13
-
14
- html.assert.include?('<h1>Example <span>Document</span></h1>')
15
-