awestruct 0.4.8 → 0.5.0.cr

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/lib/awestruct/astruct.rb +4 -0
  2. data/lib/awestruct/astruct_mixin.rb +3 -0
  3. data/lib/awestruct/cli/auto.rb +6 -6
  4. data/lib/awestruct/cli/deploy.rb +3 -3
  5. data/lib/awestruct/cli/generate.rb +5 -3
  6. data/lib/awestruct/cli/init.rb +1 -1
  7. data/lib/awestruct/cli/invoker.rb +10 -3
  8. data/lib/awestruct/cli/manifest.rb +18 -17
  9. data/lib/awestruct/cli/options.rb +7 -6
  10. data/lib/awestruct/cli/server.rb +7 -14
  11. data/lib/awestruct/config.rb +7 -1
  12. data/lib/awestruct/config/default-site.yml +30 -0
  13. data/lib/awestruct/context_helper.rb +7 -7
  14. data/lib/awestruct/dependencies.rb +14 -11
  15. data/lib/awestruct/deploy/base_deploy.rb +2 -2
  16. data/lib/awestruct/deploy/github_pages_deploy.rb +1 -1
  17. data/lib/awestruct/deploy/rsync_deploy.rb +11 -15
  18. data/lib/awestruct/deploy/s3_deploy.rb +9 -0
  19. data/lib/awestruct/engine.rb +72 -21
  20. data/lib/awestruct/extensions/minify.rb +21 -20
  21. data/lib/awestruct/extensions/paginator.rb +5 -5
  22. data/lib/awestruct/extensions/partial.rb +1 -1
  23. data/lib/awestruct/extensions/pipeline.rb +5 -1
  24. data/lib/awestruct/extensions/posts.rb +8 -4
  25. data/lib/awestruct/extensions/relative.rb +7 -2
  26. data/lib/awestruct/extensions/remotePartial.rb +1 -1
  27. data/lib/awestruct/extensions/sitemap.rb +1 -1
  28. data/lib/awestruct/frameworks/bootstrap/base_index.html.haml +1 -1
  29. data/lib/awestruct/frameworks/bootstrap/base_layout.html.haml +1 -1
  30. data/lib/awestruct/handler_chains.rb +8 -23
  31. data/lib/awestruct/handlers/asciidoctor_handler.rb +114 -0
  32. data/lib/awestruct/handlers/base_tilt_handler.rb +114 -0
  33. data/lib/awestruct/handlers/css_tilt_handler.rb +43 -0
  34. data/lib/awestruct/handlers/front_matter_handler.rb +1 -1
  35. data/lib/awestruct/handlers/interpolation_handler.rb +3 -3
  36. data/lib/awestruct/handlers/layout_handler.rb +6 -4
  37. data/lib/awestruct/handlers/restructuredtext_handler.rb +5 -5
  38. data/lib/awestruct/handlers/template/asciidoc.rb +41 -0
  39. data/lib/awestruct/handlers/template/mustache.rb +25 -0
  40. data/lib/awestruct/handlers/tilt_handler.rb +73 -0
  41. data/lib/awestruct/layouts.rb +1 -1
  42. data/lib/awestruct/logger.rb +59 -0
  43. data/lib/awestruct/page.rb +16 -3
  44. data/lib/awestruct/page_loader.rb +5 -5
  45. data/lib/awestruct/version.rb +1 -1
  46. data/man/awestruct.1 +163 -0
  47. data/spec/asciidoc_handler_spec.rb +75 -0
  48. data/spec/astruct_spec.rb +52 -0
  49. data/spec/coffeescript_handler_spec.rb +23 -0
  50. data/spec/config_spec.rb +22 -0
  51. data/spec/context_helper_spec.rb +115 -0
  52. data/spec/deploy_spec.rb +41 -0
  53. data/spec/disqus_spec.rb +43 -0
  54. data/spec/engine_spec.rb +115 -0
  55. data/spec/erb_handler_spec.rb +52 -0
  56. data/spec/file_handler_spec.rb +57 -0
  57. data/spec/front_matter_handler_spec.rb +42 -0
  58. data/spec/github_pages_deploy_spec.rb +56 -0
  59. data/spec/haml_handler_spec.rb +93 -0
  60. data/spec/handler_chain_spec.rb +44 -0
  61. data/spec/handler_chains_spec.rb +25 -0
  62. data/spec/interpolation_handler_spec.rb +35 -0
  63. data/spec/invoker_spec.rb +74 -0
  64. data/spec/javascript_handler_spec.rb +23 -0
  65. data/spec/layout_handler_spec.rb +77 -0
  66. data/spec/layouts_spec.rb +32 -0
  67. data/spec/less_handler_spec.rb +33 -0
  68. data/spec/markdown_handler_spec.rb +41 -0
  69. data/spec/minify_spec.rb +61 -0
  70. data/spec/mustache_handler_spec.rb +29 -0
  71. data/spec/options_spec.rb +97 -0
  72. data/spec/orgmode_handler_spec.rb +24 -0
  73. data/spec/page_delegating_handler_spec.rb +79 -0
  74. data/spec/page_loader_spec.rb +43 -0
  75. data/spec/page_loader_spec_for_layouts.rb +36 -0
  76. data/spec/page_spec.rb +65 -0
  77. data/spec/pipeline_spec.rb +12 -0
  78. data/spec/posts_archive_spec.rb +108 -0
  79. data/spec/redirect_handler_spec.rb +32 -0
  80. data/spec/restructuredtext_handler_spec.rb +22 -0
  81. data/spec/rsync_deploy_spec.rb +9 -0
  82. data/spec/sass_handler_spec.rb +23 -0
  83. data/spec/scss_handler_spec.rb +23 -0
  84. data/spec/server_spec.rb +45 -0
  85. data/spec/slim_handler_spec.rb +81 -0
  86. data/spec/spec_helper.rb +18 -0
  87. data/spec/support/nokogiri_matchers.rb +21 -0
  88. data/spec/support/shared_handler_example.rb +98 -0
  89. data/spec/test-data/engine/_config/arbitrary.yml +2 -0
  90. data/spec/test-data/engine/_config/other.yml +1 -0
  91. data/spec/test-data/engine/_config/site.yml +14 -0
  92. data/spec/test-data/front-matter-file-no-content.txt +2 -0
  93. data/spec/test-data/front-matter-file-no-front.txt +1 -0
  94. data/spec/test-data/front-matter-file.txt +4 -0
  95. data/spec/test-data/handlers/asciidoc-page.ad +3 -0
  96. data/spec/test-data/handlers/asciidoc-page.adoc +3 -0
  97. data/spec/test-data/handlers/asciidoc-page.asciidoc +3 -0
  98. data/spec/test-data/handlers/asciidoctor_with_front_matter.ad +6 -0
  99. data/spec/test-data/handlers/asciidoctor_with_headers.ad +8 -0
  100. data/spec/test-data/handlers/coffeescript-page.coffee +8 -0
  101. data/spec/test-data/handlers/erb-page.html.erb +6 -0
  102. data/spec/test-data/handlers/erb-page.xml.erb +2 -0
  103. data/spec/test-data/handlers/erb-utf-page.html.erb +2 -0
  104. data/spec/test-data/handlers/haml-layout-two.html.haml +7 -0
  105. data/spec/test-data/handlers/haml-layout.html.haml +4 -0
  106. data/spec/test-data/handlers/haml-page.atom.haml +4 -0
  107. data/spec/test-data/handlers/haml-page.html.haml +2 -0
  108. data/spec/test-data/handlers/haml-page.xml.haml +1 -0
  109. data/spec/test-data/handlers/haml-with-markdown-page.html.haml +6 -0
  110. data/spec/test-data/handlers/haml-with-textile-page.html.haml +6 -0
  111. data/spec/test-data/handlers/haml-with-utf.html.haml +2 -0
  112. data/spec/test-data/handlers/haml-with-variables.html.haml +2 -0
  113. data/spec/test-data/handlers/inner-page.html.haml +4 -0
  114. data/spec/test-data/handlers/javascript-page.js +1 -0
  115. data/spec/test-data/handlers/less-page-include.less +1 -0
  116. data/spec/test-data/handlers/less-page-with-import.less +4 -0
  117. data/spec/test-data/handlers/less-page.less +4 -0
  118. data/spec/test-data/handlers/markdown-page.markdown +2 -0
  119. data/spec/test-data/handlers/markdown-page.md +2 -0
  120. data/spec/test-data/handlers/markdown-page.mkd +2 -0
  121. data/spec/test-data/handlers/mustache-page.html.mustache +2 -0
  122. data/spec/test-data/handlers/mustache-page.xml.mustache +1 -0
  123. data/spec/test-data/handlers/orgmode-page.org +6 -0
  124. data/spec/test-data/handlers/outer-layout.html.haml +2 -0
  125. data/spec/test-data/handlers/outside_relative/git_keep +3 -0
  126. data/spec/test-data/handlers/redirect-page.redirect +1 -0
  127. data/spec/test-data/handlers/restructuredtext-page.rst +8 -0
  128. data/spec/test-data/handlers/sass-page-include.sass +1 -0
  129. data/spec/test-data/handlers/sass-page.sass +4 -0
  130. data/spec/test-data/handlers/scss-page-include.scss +1 -0
  131. data/spec/test-data/handlers/scss-page.scss +5 -0
  132. data/spec/test-data/handlers/simple-redirect-page.redirect +1 -0
  133. data/spec/test-data/handlers/slim-page.atom.slim +4 -0
  134. data/spec/test-data/handlers/slim-page.html.slim +1 -0
  135. data/spec/test-data/handlers/slim-page.xml.slim +1 -0
  136. data/spec/test-data/handlers/slim-with-markdown-page.html.slim +5 -0
  137. data/spec/test-data/handlers/slim-with-utf.html.slim +2 -0
  138. data/spec/test-data/handlers/slim-with-variables.html.slim +1 -0
  139. data/spec/test-data/handlers/textile-page.textile +1 -0
  140. data/spec/test-data/images/logo.png +0 -0
  141. data/spec/test-data/index.html +242 -0
  142. data/spec/test-data/javascript/bootstrap-dropdown.js +92 -0
  143. data/spec/test-data/out-of-site/page-three.html.haml +2 -0
  144. data/spec/test-data/page-loader/_layouts/layout-one.md +2 -0
  145. data/spec/test-data/page-loader/_layouts/layout-two.html.haml +2 -0
  146. data/spec/test-data/page-loader/page-draft.md +5 -0
  147. data/spec/test-data/page-loader/page-one.md +2 -0
  148. data/spec/test-data/page-loader/page-two.html.haml +2 -0
  149. data/spec/test-data/simple-data.yaml +1 -0
  150. data/spec/test-data/simple-file.txt +1 -0
  151. data/spec/test-data/stylesheets/screen.css +688 -0
  152. data/spec/textile_handler_spec.rb +22 -0
  153. data/spec/tilt_handler_spec.rb +81 -0
  154. data/spec/yaml_handler_spec.rb +21 -0
  155. metadata +243 -202
  156. data/lib/awestruct/handlers/asciidoc_handler.rb +0 -86
  157. data/lib/awestruct/handlers/base_sass_handler.rb +0 -42
  158. data/lib/awestruct/handlers/coffeescript_handler.rb +0 -48
  159. data/lib/awestruct/handlers/erb_handler.rb +0 -43
  160. data/lib/awestruct/handlers/haml_handler.rb +0 -54
  161. data/lib/awestruct/handlers/less_handler.rb +0 -37
  162. data/lib/awestruct/handlers/markdown_handler.rb +0 -50
  163. data/lib/awestruct/handlers/mustache_handler.rb +0 -44
  164. data/lib/awestruct/handlers/orgmode_handler.rb +0 -48
  165. data/lib/awestruct/handlers/sass_handler.rb +0 -21
  166. data/lib/awestruct/handlers/scss_handler.rb +0 -21
  167. data/lib/awestruct/handlers/textile_handler.rb +0 -58
@@ -1,21 +0,0 @@
1
-
2
- require 'awestruct/handler_chain'
3
- require 'awestruct/handlers/base_sass_handler'
4
- require 'awestruct/handlers/file_handler'
5
-
6
- module Awestruct
7
- module Handlers
8
- class SassHandler < BaseSassHandler
9
-
10
- CHAIN = Awestruct::HandlerChain.new( /\.sass$/,
11
- Awestruct::Handlers::FileHandler,
12
- Awestruct::Handlers::SassHandler
13
- )
14
-
15
- def initialize(site, delegate)
16
- super( site, delegate, :sass )
17
- end
18
-
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
-
2
- require 'awestruct/handler_chain'
3
- require 'awestruct/handlers/base_sass_handler'
4
- require 'awestruct/handlers/file_handler'
5
-
6
- module Awestruct
7
- module Handlers
8
- class ScssHandler < BaseSassHandler
9
-
10
- CHAIN = Awestruct::HandlerChain.new( /\.scss$/,
11
- Awestruct::Handlers::FileHandler,
12
- Awestruct::Handlers::ScssHandler
13
- )
14
-
15
- def initialize(site, delegate)
16
- super( site, delegate, :scss )
17
- end
18
-
19
- end
20
- end
21
- end
@@ -1,58 +0,0 @@
1
-
2
- require 'awestruct/handler_chain'
3
- require 'awestruct/handlers/base_handler'
4
- require 'awestruct/handlers/file_handler'
5
- require 'awestruct/handlers/front_matter_handler'
6
- require 'awestruct/handlers/interpolation_handler'
7
- require 'awestruct/handlers/layout_handler'
8
- require 'redcloth'
9
-
10
- module Awestruct
11
- module Handlers
12
- class TextileHandler < BaseHandler
13
-
14
- CHAIN = Awestruct::HandlerChain.new( /\.textile$/,
15
- Awestruct::Handlers::FileHandler,
16
- Awestruct::Handlers::FrontMatterHandler,
17
- Awestruct::Handlers::InterpolationHandler,
18
- Awestruct::Handlers::TextileHandler,
19
- Awestruct::Handlers::LayoutHandler
20
- )
21
-
22
-
23
-
24
- def initialize(site, delegate)
25
- super( site, delegate )
26
- end
27
-
28
- def simple_name
29
- File.basename( relative_source_path, '.textile' )
30
- end
31
-
32
- def output_filename
33
- File.basename( relative_source_path, '.textile' ) + '.html'
34
- end
35
-
36
- def output_extension
37
- '.html'
38
- end
39
-
40
- def content_syntax
41
- :textile
42
- end
43
-
44
- def rendered_content(context, with_layouts=true)
45
- rendered = ''
46
- # security and rendering restrictions
47
- # ex. site.textile = ['no_span_caps']
48
- restrictions = (site.textile || []).map { |r| r.to_sym }
49
- # a module of rule functions is included in RedCloth using RedCloth.send(:include, MyRules)
50
- # rule functions on that module are activated by setting the property site.textile_rules
51
- # ex. site.textile_rules = ['emoticons']
52
- rules = context.site.textile_rules ? context.site.textile_rules.map { |r| r.to_sym } : []
53
- RedCloth.new( delegate.rendered_content( context, with_layouts ), restrictions ).to_html(*rules)
54
- end
55
-
56
- end
57
- end
58
- end