middleman-core 3.2.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. checksums.yaml +4 -4
  2. data/features/cli_init.feature +18 -8
  3. data/features/helpers_select_tag.feature +1 -1
  4. data/features/layouts_dir.feature +8 -0
  5. data/features/markdown_redcarpet.feature +2 -2
  6. data/fixtures/asciidoc-app/source/layouts/default.erb +0 -1
  7. data/fixtures/capture-html-app/source/capture_html_haml.html.haml +1 -1
  8. data/fixtures/content-for-app/source/content_for_haml.html.haml +1 -1
  9. data/fixtures/frontmatter-settings-app/source/layouts/override.erb +1 -2
  10. data/fixtures/frontmatter-settings-neighbor-app/source/layouts/override.erb +1 -2
  11. data/fixtures/layouts-dir-app/source/ambiguous.html.erb +5 -0
  12. data/fixtures/layouts-dir-app/source/layouts/other.erb +3 -0
  13. data/fixtures/layouts-dir-app/source/other.erb +3 -0
  14. data/fixtures/link-to-app/source/link_to_haml.html.haml +1 -1
  15. data/fixtures/link-to-app/source/link_to_slim.html.slim +1 -1
  16. data/fixtures/nested-layout-app/source/layouts/inner_haml.haml +1 -1
  17. data/fixtures/nested-layout-app/source/layouts/inner_slim.slim +1 -1
  18. data/fixtures/nested-layout-app/source/layouts/outer_haml.haml +1 -1
  19. data/fixtures/nested-layout-app/source/layouts/outer_slim.slim +1 -1
  20. data/lib/middleman-core/application.rb +12 -3
  21. data/lib/middleman-core/cli/build.rb +5 -3
  22. data/lib/middleman-core/cli/console.rb +1 -1
  23. data/lib/middleman-core/cli/init.rb +1 -1
  24. data/lib/middleman-core/core_extensions.rb +0 -1
  25. data/lib/middleman-core/core_extensions/file_watcher.rb +11 -11
  26. data/lib/middleman-core/core_extensions/rendering.rb +40 -66
  27. data/lib/middleman-core/extension.rb +167 -0
  28. data/lib/middleman-core/extensions.rb +2 -151
  29. data/lib/middleman-core/logger.rb +2 -2
  30. data/lib/middleman-core/meta_pages/assets/config.css +13 -0
  31. data/lib/middleman-core/meta_pages/assets/meta.css +19 -3
  32. data/lib/middleman-core/meta_pages/assets/sitemap.css +18 -1
  33. data/lib/middleman-core/meta_pages/config_setting.rb +7 -9
  34. data/lib/middleman-core/meta_pages/sitemap_resource.rb +24 -15
  35. data/lib/middleman-core/meta_pages/sitemap_tree.rb +5 -1
  36. data/lib/middleman-core/meta_pages/templates/config.html.erb +2 -2
  37. data/lib/middleman-core/meta_pages/templates/index.html.erb +18 -8
  38. data/lib/middleman-core/meta_pages/templates/sitemap.html.erb +4 -5
  39. data/lib/middleman-core/preview_server.rb +6 -3
  40. data/lib/middleman-core/renderers/erb.rb +12 -14
  41. data/lib/middleman-core/renderers/haml.rb +10 -0
  42. data/lib/middleman-core/renderers/markdown.rb +5 -1
  43. data/lib/middleman-core/renderers/sass.rb +0 -4
  44. data/lib/middleman-core/renderers/slim.rb +16 -3
  45. data/lib/middleman-core/sitemap/resource.rb +1 -1
  46. data/lib/middleman-core/step_definitions.rb +2 -1
  47. data/lib/middleman-core/templates.rb +3 -1
  48. data/lib/middleman-core/templates/shared/Gemfile.tt +4 -1
  49. data/lib/middleman-core/templates/shared/config.tt +3 -1
  50. data/lib/middleman-core/templates/shared/gitignore +2 -1
  51. data/lib/middleman-core/util.rb +22 -16
  52. data/lib/middleman-core/version.rb +1 -1
  53. data/lib/middleman-more/core_extensions/compass.rb +3 -3
  54. data/lib/middleman-more/core_extensions/default_helpers.rb +18 -15
  55. data/lib/middleman-more/extensions/asset_hash.rb +1 -0
  56. data/middleman-core.gemspec +9 -6
  57. metadata +69 -227
  58. data/features/sass_cache_path.feature +0 -22
  59. data/fixtures/sass-cache-path-custom-app/config.rb +0 -3
  60. data/fixtures/sass-cache-path-custom-app/source/stylesheets/plain.css.sass +0 -4
  61. data/fixtures/sass-cache-path-default-app/config.rb +0 -3
  62. data/fixtures/sass-cache-path-default-app/source/stylesheets/plain.css.sass +0 -4
  63. data/lib/vendored-middleman-deps/hooks-0.2.0/CHANGES.textile +0 -9
  64. data/lib/vendored-middleman-deps/hooks-0.2.0/Gemfile +0 -3
  65. data/lib/vendored-middleman-deps/hooks-0.2.0/README.rdoc +0 -107
  66. data/lib/vendored-middleman-deps/hooks-0.2.0/Rakefile +0 -12
  67. data/lib/vendored-middleman-deps/hooks-0.2.0/hooks.gemspec +0 -22
  68. data/lib/vendored-middleman-deps/hooks-0.2.0/lib/hooks.rb +0 -109
  69. data/lib/vendored-middleman-deps/hooks-0.2.0/lib/hooks/inheritable_attribute.rb +0 -33
  70. data/lib/vendored-middleman-deps/hooks-0.2.0/test/hooks_test.rb +0 -141
  71. data/lib/vendored-middleman-deps/hooks-0.2.0/test/inheritable_attribute_test.rb +0 -55
  72. data/lib/vendored-middleman-deps/hooks-0.2.0/test/test_helper.rb +0 -10
  73. data/lib/vendored-middleman-deps/padrino-core-0.11.4/.document +0 -5
  74. data/lib/vendored-middleman-deps/padrino-core-0.11.4/.gitignore +0 -22
  75. data/lib/vendored-middleman-deps/padrino-core-0.11.4/.yardopts +0 -1
  76. data/lib/vendored-middleman-deps/padrino-core-0.11.4/LICENSE.txt +0 -20
  77. data/lib/vendored-middleman-deps/padrino-core-0.11.4/README.rdoc +0 -294
  78. data/lib/vendored-middleman-deps/padrino-core-0.11.4/Rakefile +0 -5
  79. data/lib/vendored-middleman-deps/padrino-core-0.11.4/bin/padrino +0 -9
  80. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core.rb +0 -200
  81. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application.rb +0 -297
  82. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/flash.rb +0 -229
  83. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/rendering.rb +0 -317
  84. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/rendering/extensions/erubis.rb +0 -64
  85. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/rendering/extensions/haml.rb +0 -28
  86. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/rendering/extensions/slim.rb +0 -14
  87. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/routing.rb +0 -1077
  88. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/application/showexceptions.rb +0 -21
  89. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/caller.rb +0 -53
  90. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/adapter.rb +0 -24
  91. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/base.rb +0 -159
  92. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/console.rb +0 -20
  93. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/rake.rb +0 -47
  94. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/cli/rake_tasks.rb +0 -52
  95. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/command.rb +0 -38
  96. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/images/404.png +0 -0
  97. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/images/500.png +0 -0
  98. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/loader.rb +0 -224
  99. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/cs.yml +0 -33
  100. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/da.yml +0 -33
  101. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/de.yml +0 -33
  102. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/en.yml +0 -33
  103. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/es.yml +0 -33
  104. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/fr.yml +0 -33
  105. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/hu.yml +0 -33
  106. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/it.yml +0 -39
  107. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/ja.yml +0 -33
  108. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/lv.yml +0 -33
  109. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/nl.yml +0 -33
  110. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/no.yml +0 -33
  111. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/pl.yml +0 -33
  112. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/pt_br.yml +0 -39
  113. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/ro.yml +0 -33
  114. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/ru.yml +0 -34
  115. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/sv.yml +0 -33
  116. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/tr.yml +0 -33
  117. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/uk.yml +0 -33
  118. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/zh_cn.yml +0 -33
  119. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/locale/zh_tw.yml +0 -33
  120. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/logger.rb +0 -438
  121. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/module.rb +0 -58
  122. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/mounter.rb +0 -234
  123. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/reloader.rb +0 -341
  124. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/router.rb +0 -95
  125. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/server.rb +0 -77
  126. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/support_lite.rb +0 -260
  127. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/tasks.rb +0 -21
  128. data/lib/vendored-middleman-deps/padrino-core-0.11.4/lib/padrino-core/version.rb +0 -20
  129. data/lib/vendored-middleman-deps/padrino-core-0.11.4/padrino-core.gemspec +0 -43
  130. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/app_gem/Gemfile +0 -4
  131. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/app_gem/app/app.rb +0 -3
  132. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/app_gem/app_gem.gemspec +0 -17
  133. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/app_gem/lib/app_gem.rb +0 -7
  134. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/app_gem/lib/app_gem/version.rb +0 -3
  135. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/apps/.components +0 -6
  136. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/apps/.gitignore +0 -7
  137. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/apps/complex.rb +0 -32
  138. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/apps/simple.rb +0 -33
  139. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/a.rb +0 -9
  140. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/b.rb +0 -4
  141. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/c.rb +0 -1
  142. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/circular/e.rb +0 -13
  143. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/circular/f.rb +0 -2
  144. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/circular/g.rb +0 -2
  145. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/fixtures/dependencies/d.rb +0 -4
  146. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/helper.rb +0 -83
  147. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/mini_shoulda.rb +0 -45
  148. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_application.rb +0 -125
  149. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_core.rb +0 -77
  150. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_csrf_protection.rb +0 -80
  151. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_dependencies.rb +0 -44
  152. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_filters.rb +0 -348
  153. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_flash.rb +0 -168
  154. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_locale.rb +0 -21
  155. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_logger.rb +0 -210
  156. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_mounter.rb +0 -199
  157. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_reloader_complex.rb +0 -75
  158. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_reloader_simple.rb +0 -98
  159. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_rendering.rb +0 -545
  160. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_rendering_extensions.rb +0 -14
  161. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_restful_routing.rb +0 -33
  162. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_router.rb +0 -146
  163. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_routing.rb +0 -1927
  164. data/lib/vendored-middleman-deps/padrino-core-0.11.4/test/test_support_lite.rb +0 -56
  165. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/.document +0 -5
  166. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/.gitignore +0 -21
  167. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/.yardopts +0 -1
  168. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/LICENSE.txt +0 -20
  169. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/README.rdoc +0 -239
  170. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/Rakefile +0 -5
  171. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers.rb +0 -57
  172. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/asset_tag_helpers.rb +0 -401
  173. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/breadcrumb_helpers.rb +0 -183
  174. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/form_builder/abstract_form_builder.rb +0 -317
  175. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -40
  176. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/form_helpers.rb +0 -919
  177. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/format_helpers.rb +0 -372
  178. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/cs.yml +0 -103
  179. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/da.yml +0 -91
  180. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/de.yml +0 -81
  181. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/en.yml +0 -103
  182. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/es.yml +0 -103
  183. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/fr.yml +0 -79
  184. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/hu.yml +0 -103
  185. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/it.yml +0 -89
  186. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/ja.yml +0 -103
  187. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/lv.yml +0 -103
  188. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/nl.yml +0 -82
  189. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/no.yml +0 -91
  190. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/pl.yml +0 -95
  191. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/pt_br.yml +0 -103
  192. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/ro.yml +0 -103
  193. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/ru.yml +0 -103
  194. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/sv.yml +0 -103
  195. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/tr.yml +0 -103
  196. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/uk.yml +0 -103
  197. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/zh_cn.yml +0 -103
  198. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/locale/zh_tw.yml +0 -103
  199. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/number_helpers.rb +0 -283
  200. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/output_helpers.rb +0 -207
  201. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -96
  202. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/output_helpers/erb_handler.rb +0 -78
  203. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -63
  204. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/output_helpers/slim_handler.rb +0 -78
  205. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/render_helpers.rb +0 -59
  206. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/tag_helpers.rb +0 -292
  207. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/lib/padrino-helpers/translation_helpers.rb +0 -36
  208. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/padrino-helpers.gemspec +0 -27
  209. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/app.rb +0 -84
  210. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/button_to.erb +0 -8
  211. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/button_to.haml +0 -5
  212. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/button_to.slim +0 -6
  213. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/capture_concat.erb +0 -14
  214. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/capture_concat.haml +0 -12
  215. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/capture_concat.slim +0 -12
  216. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_for.erb +0 -14
  217. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_for.haml +0 -12
  218. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_for.slim +0 -12
  219. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_tag.erb +0 -11
  220. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_tag.haml +0 -9
  221. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/content_tag.slim +0 -9
  222. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/current_engine.erb +0 -5
  223. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/current_engine.haml +0 -5
  224. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/current_engine.slim +0 -5
  225. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/fields_for.erb +0 -20
  226. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/fields_for.haml +0 -15
  227. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/fields_for.slim +0 -15
  228. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_for.erb +0 -72
  229. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_for.haml +0 -59
  230. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_for.slim +0 -59
  231. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_tag.erb +0 -95
  232. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_tag.haml +0 -78
  233. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/form_tag.slim +0 -79
  234. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/link_to.erb +0 -5
  235. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/link_to.haml +0 -4
  236. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/link_to.slim +0 -4
  237. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/mail_to.erb +0 -3
  238. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/mail_to.haml +0 -3
  239. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/mail_to.slim +0 -3
  240. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/meta_tag.erb +0 -3
  241. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/meta_tag.haml +0 -3
  242. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/meta_tag.slim +0 -3
  243. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/partials/_erb.erb +0 -1
  244. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/partials/_haml.haml +0 -1
  245. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
  246. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/simple_partial.erb +0 -1
  247. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/simple_partial.haml +0 -1
  248. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/markup_app/views/simple_partial.slim +0 -1
  249. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/app.rb +0 -58
  250. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/current_engine.haml +0 -5
  251. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/current_engines/_erb.erb +0 -1
  252. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/current_engines/_haml.haml +0 -1
  253. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/current_engines/_slim.slim +0 -1
  254. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/double_capture_erb.erb +0 -3
  255. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/double_capture_haml.haml +0 -2
  256. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/double_capture_slim.slim +0 -2
  257. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/erb/test.erb +0 -1
  258. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/explicit_engine.haml +0 -5
  259. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/haml/test.haml +0 -1
  260. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/template/_user.haml +0 -7
  261. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/template/haml_template.haml +0 -1
  262. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/fixtures/render_app/views/template/some_template.haml +0 -2
  263. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/helper.rb +0 -67
  264. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_asset_tag_helpers.rb +0 -359
  265. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_breadcrumb_helpers.rb +0 -134
  266. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_form_builder.rb +0 -1178
  267. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_form_helpers.rb +0 -1030
  268. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_format_helpers.rb +0 -241
  269. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_locale.rb +0 -20
  270. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_number_helpers.rb +0 -143
  271. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_output_helpers.rb +0 -154
  272. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_render_helpers.rb +0 -94
  273. data/lib/vendored-middleman-deps/padrino-helpers-0.11.4/test/test_tag_helpers.rb +0 -117
@@ -1,372 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- module Padrino
3
- module Helpers
4
- ###
5
- # Helpers related to formatting or manipulating text within templates.
6
- #
7
- module FormatHelpers
8
- ##
9
- # Returns escaped text to protect against malicious content.
10
- #
11
- # @param [String] text
12
- # Unsanitized HTML string that needs to be escaped.
13
- #
14
- # @return [String] HTML with escaped characters.
15
- #
16
- # @example
17
- # escape_html("<b>Hey<b>") => "&lt;b&gt;Hey&lt;b;gt;"
18
- # h("Me & Bob") => "Me &amp; Bob"
19
- #
20
- def escape_html(text)
21
- Rack::Utils.escape_html(text).html_safe
22
- end
23
- alias h escape_html
24
- alias sanitize_html escape_html
25
-
26
- ##
27
- # Returns escaped text to protect against malicious content.
28
- #
29
- # @param [String] text
30
- # Unsanitized HTML string that needs to be escaped.
31
- # @param [String] blank_text
32
- # Text to return if escaped text is blank.
33
- #
34
- # @return [String] HTML with escaped characters or the value specified if blank.
35
- #
36
- # @example
37
- # h!("Me & Bob") => "Me &amp; Bob"
38
- # h!("", "Whoops") => "Whoops"
39
- #
40
- def h!(text, blank_text = '&nbsp;')
41
- return blank_text.html_safe if text.nil? || text.empty?
42
- h(text)
43
- end
44
-
45
- ##
46
- # Strips all HTML tags from the html.
47
- #
48
- # @param [String] html
49
- # The HTML for which to strip tags.
50
- #
51
- # @return [String] HTML with tags stripped.
52
- #
53
- # @example
54
- # strip_tags("<b>Hey</b>") => "Hey"
55
- #
56
- def strip_tags(html)
57
- html.gsub(/<\/?[^>]*>/, "") if html
58
- end
59
-
60
- ##
61
- # Returns text transformed into HTML using simple formatting rules. Two or more consecutive newlines(\n\n) are considered
62
- # as a paragraph and wrapped in <p> or your own tags. One newline (\n) is considered as a linebreak and a <br /> tag is appended.
63
- # This method does not remove the newlines from the text.
64
- #
65
- # @param [String] text
66
- # The simple text to be formatted.
67
- # @param [Hash] options
68
- # Formatting options for the text. Can accept html options for the wrapper tag.
69
- # @option options [Symbol] :tag (p)
70
- # The html tag to use for formatting newlines.
71
- #
72
- # @return [String] The text formatted as simple HTML.
73
- #
74
- # @example
75
- # simple_format("hello\nworld") # => "<p>hello<br/>world</p>"
76
- # simple_format("hello\nworld", :tag => :div, :class => :foo) # => "<div class="foo">hello<br/>world</div>"
77
- #
78
- def simple_format(text, options={})
79
- t = options.delete(:tag) || :p
80
- start_tag = tag(t, options, true)
81
- text = escape_html(text.to_s.dup)
82
- text.gsub!(/\r\n?/, "\n") # \r\n and \r -> \n
83
- text.gsub!(/\n\n+/, "</#{t}>\n\n#{start_tag}") # 2+ newline -> paragraph
84
- text.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
85
- text.insert 0, start_tag
86
- text << "</#{t}>"
87
- text.html_safe
88
- end
89
-
90
- ##
91
- # Attempts to pluralize the singular word unless count is 1. If plural is supplied, it will use that when count is > 1,
92
- # otherwise it will use inflector to determine the plural form.
93
- #
94
- # @param [Fixnum] count
95
- # The count which determines pluralization.
96
- # @param [String] singular
97
- # The word to be pluralized if appropriate based on +count+.
98
- # @param [String] plural
99
- # Explicit pluralized word to be used; if not specified uses inflector.
100
- #
101
- # @return [String] The properly pluralized word.
102
- #
103
- # @example
104
- # pluralize(2, 'person') => '2 people'
105
- #
106
- def pluralize(count, singular, plural = nil)
107
- "#{count || 0} " + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))
108
- end
109
-
110
- ##
111
- # Truncates a given text after a given :length if text is longer than :length (defaults to 30).
112
- # The last characters will be replaced with the :omission (defaults to "…") for a total length not exceeding :length.
113
- #
114
- # @param [String] text
115
- # The text to be truncated.
116
- # @param [Hash] options
117
- # Formatting options for the truncation.
118
- # @option options [Fixnum] :length (30)
119
- # The number of characters before truncation occurs.
120
- # @option options [String] :omission ("...")
121
- # The characters that are placed after the truncated text.
122
- #
123
- # @return [String] The text truncated after the given number of characters.
124
- #
125
- # @example
126
- # truncate("Once upon a time in a world far far away", :length => 8) => "Once upon..."
127
- #
128
- def truncate(text, options={})
129
- options.reverse_merge!(:length => 30, :omission => "...")
130
- if text
131
- len = options[:length] - options[:omission].length
132
- chars = text
133
- (chars.length > options[:length] ? chars[0...len] + options[:omission] : text).to_s
134
- end
135
- end
136
-
137
- ##
138
- # Truncates words of a given text after a given :length if number of words in text is more than :length (defaults to 30).
139
- # The last words will be replaced with the :omission (defaults to "…") for a total number of words not exceeding :length.
140
- #
141
- # @param [String] text
142
- # The text to be truncated.
143
- # @param [Hash] options
144
- # Formatting options for the truncation.
145
- # @option options [Fixnum] :length (30)
146
- # The number of words before truncation occurs.
147
- # @option options [String] :omission ("...")
148
- # The characters that are placed after the truncated text.
149
- #
150
- # @return [String] The text truncated after the given number of words.
151
- #
152
- # @example
153
- # truncate_words("Once upon a time in a world far far away", :length => 8) => "Once upon a time in a world far..."
154
- #
155
- def truncate_words(text, options={})
156
- options.reverse_merge!(:length => 30, :omission => "...")
157
- if text
158
- words = text.split()
159
- words[0..(options[:length]-1)].join(' ') + (words.length > options[:length] ? options[:omission] : '')
160
- end
161
- end
162
-
163
- ##
164
- # Wraps the text into lines no longer than line_width width.
165
- # This method breaks on the first whitespace character that does not exceed line_width (which is 80 by default).
166
- #
167
- # @overload word_wrap(text, options={})
168
- # @param [String] text
169
- # The text to be wrapped.
170
- # @param [Hash] options
171
- # Formatting options for the wrapping.
172
- # @option options [Fixnum] :line_width (80)
173
- # The line width before a wrap should occur.
174
- #
175
- # @return [String] The text with line wraps for lines longer then +line_width+.
176
- #
177
- # @example
178
- # word_wrap('Once upon a time', :line_width => 8) => "Once upon\na time"
179
- #
180
- def word_wrap(text, *args)
181
- options = args.extract_options!
182
- unless args.blank?
183
- options[:line_width] = args[0] || 80
184
- end
185
- options.reverse_merge!(:line_width => 80)
186
-
187
- text.split("\n").map do |line|
188
- line.length > options[:line_width] ? line.gsub(/(.{1,#{options[:line_width]}})(\s+|$)/, "\\1\n").strip : line
189
- end * "\n"
190
- end
191
-
192
- ##
193
- # Highlights one or more words everywhere in text by inserting it into a :highlighter string.
194
- #
195
- # The highlighter can be customized by passing :+highlighter+ as a single-quoted string
196
- # with \1 where the phrase is to be inserted.
197
- #
198
- # @overload highlight(text, words, options={})
199
- # @param [String] text
200
- # The text that will be searched.
201
- # @param [String] words
202
- # The words to be highlighted in the +text+.
203
- # @param [Hash] options
204
- # Formatting options for the highlight.
205
- # @option options [String] :highlighter ('<strong class="highlight">\1</strong>')
206
- # The html pattern for wrapping the highlighted words.
207
- #
208
- # @return [String] The text with the words specified wrapped with highlighted spans.
209
- #
210
- # @example
211
- # highlight('Lorem ipsum dolor sit amet', 'dolor')
212
- # # => Lorem ipsum <strong class="highlight">dolor</strong> sit amet
213
- #
214
- # highlight('Lorem ipsum dolor sit amet', 'dolor', :highlighter => '<span class="custom">\1</span>')
215
- # # => Lorem ipsum <strong class="custom">dolor</strong> sit amet
216
- #
217
- def highlight(text, words, *args)
218
- options = args.extract_options!
219
- options.reverse_merge!(:highlighter => '<strong class="highlight">\1</strong>')
220
-
221
- if text.blank? || words.blank?
222
- text
223
- else
224
- match = Array(words).map { |p| Regexp.escape(p) }.join('|')
225
- text.gsub(/(#{match})(?!(?:[^<]*?)(?:["'])[^<>]*>)/i, options[:highlighter])
226
- end
227
- end
228
-
229
- ##
230
- # Reports the approximate distance in time between two Time or Date objects or integers as seconds.
231
- # Set +include_seconds+ to true if you want more detailed approximations when distance < 1 min, 29 secs
232
- # Distances are reported based on the following table:
233
- #
234
- # 0 <-> 29 secs # => less than a minute
235
- # 30 secs <-> 1 min, 29 secs # => 1 minute
236
- # 1 min, 30 secs <-> 44 mins, 29 secs # => [2..44] minutes
237
- # 44 mins, 30 secs <-> 89 mins, 29 secs # => about 1 hour
238
- # 89 mins, 29 secs <-> 23 hrs, 59 mins, 29 secs # => about [2..24] hours
239
- # 23 hrs, 59 mins, 29 secs <-> 47 hrs, 59 mins, 29 secs # => 1 day
240
- # 47 hrs, 59 mins, 29 secs <-> 29 days, 23 hrs, 59 mins, 29 secs # => [2..29] days
241
- # 29 days, 23 hrs, 59 mins, 30 secs <-> 59 days, 23 hrs, 59 mins, 29 secs # => about 1 month
242
- # 59 days, 23 hrs, 59 mins, 30 secs <-> 1 yr minus 1 sec # => [2..12] months
243
- # 1 yr <-> 1 yr, 3 months # => about 1 year
244
- # 1 yr, 3 months <-> 1 yr, 9 months # => over 1 year
245
- # 1 yr, 9 months <-> 2 yr minus 1 sec # => almost 2 years
246
- # 2 yrs <-> max time or date # => (same rules as 1 yr)
247
- #
248
- # With +include_seconds+ = true and the difference < 1 minute 29 seconds:
249
- # 0-4 secs # => less than 5 seconds
250
- # 5-9 secs # => less than 10 seconds
251
- # 10-19 secs # => less than 20 seconds
252
- # 20-39 secs # => half a minute
253
- # 40-59 secs # => less than a minute
254
- # 60-89 secs # => 1 minute
255
- #
256
- # @param [Time] from_time
257
- # The time to be compared against +to_time+ in order to approximate the distance.
258
- # @param [Time] to_time
259
- # The time to be compared against +from_time+ in order to approximate the distance.
260
- # @param [Boolean] include_seconds
261
- # Set true for more detailed approximations.
262
- # @param [Hash] options
263
- # Flags for the approximation.
264
- # @option options [String] :locale
265
- # The translation locale to be used for approximating the time.
266
- #
267
- # @return [String] The time formatted as a relative string.
268
- #
269
- # @example
270
- # from_time = Time.now
271
- # distance_of_time_in_words(from_time, from_time + 50.minutes) # => about 1 hour
272
- # distance_of_time_in_words(from_time, 50.minutes.from_now) # => about 1 hour
273
- # distance_of_time_in_words(from_time, from_time + 15.seconds) # => less than a minute
274
- # distance_of_time_in_words(from_time, from_time + 15.seconds, true) # => less than 20 seconds
275
- # distance_of_time_in_words(from_time, 3.years.from_now) # => about 3 years
276
- # distance_of_time_in_words(from_time, from_time + 60.hours) # => about 3 days
277
- # distance_of_time_in_words(from_time, from_time + 45.seconds, true) # => less than a minute
278
- # distance_of_time_in_words(from_time, from_time - 45.seconds, true) # => less than a minute
279
- # distance_of_time_in_words(from_time, 76.seconds.from_now) # => 1 minute
280
- # distance_of_time_in_words(from_time, from_time + 1.year + 3.days) # => about 1 year
281
- # distance_of_time_in_words(from_time, from_time + 3.years + 6.months) # => over 3 years
282
- # distance_of_time_in_words(from_time, from_time + 4.years + 9.days + 30.minutes + 5.seconds) # => about 4 years
283
- # to_time = Time.now + 6.years + 19.days
284
- # distance_of_time_in_words(from_time, to_time, true) # => about 6 years
285
- # distance_of_time_in_words(to_time, from_time, true) # => about 6 years
286
- # distance_of_time_in_words(Time.now, Time.now) # => less than a minute
287
- #
288
- def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false, options = {})
289
- from_time = from_time.to_time if from_time.respond_to?(:to_time)
290
- to_time = to_time.to_time if to_time.respond_to?(:to_time)
291
- distance_in_minutes = (((to_time.to_i - from_time.to_i).abs)/60).round
292
- distance_in_seconds = ((to_time.to_i - from_time.to_i).abs).round
293
-
294
- I18n.with_options :locale => options[:locale], :scope => :'datetime.distance_in_words' do |locale|
295
- case distance_in_minutes
296
- when 0..1
297
- return distance_in_minutes == 0 ?
298
- locale.t(:less_than_x_minutes, :count => 1) :
299
- locale.t(:x_minutes, :count => distance_in_minutes) unless include_seconds
300
-
301
- case distance_in_seconds
302
- when 0..4 then locale.t :less_than_x_seconds, :count => 5
303
- when 5..9 then locale.t :less_than_x_seconds, :count => 10
304
- when 10..19 then locale.t :less_than_x_seconds, :count => 20
305
- when 20..39 then locale.t :half_a_minute
306
- when 40..59 then locale.t :less_than_x_minutes, :count => 1
307
- else locale.t :x_minutes, :count => 1
308
- end
309
-
310
- when 2..44 then locale.t :x_minutes, :count => distance_in_minutes
311
- when 45..89 then locale.t :about_x_hours, :count => 1
312
- when 90..1439 then locale.t :about_x_hours, :count => (distance_in_minutes.to_f / 60.0).round
313
- when 1440..2529 then locale.t :x_days, :count => 1
314
- when 2530..43199 then locale.t :x_days, :count => (distance_in_minutes.to_f / 1440.0).round
315
- when 43200..86399 then locale.t :about_x_months, :count => 1
316
- when 86400..525599 then locale.t :x_months, :count => (distance_in_minutes.to_f / 43200.0).round
317
- else
318
- distance_in_years = distance_in_minutes / 525600
319
- minute_offset_for_leap_year = (distance_in_years / 4) * 1440
320
- remainder = ((distance_in_minutes - minute_offset_for_leap_year) % 525600)
321
- if remainder < 131400
322
- locale.t(:about_x_years, :count => distance_in_years)
323
- elsif remainder < 394200
324
- locale.t(:over_x_years, :count => distance_in_years)
325
- else
326
- locale.t(:almost_x_years, :count => distance_in_years + 1)
327
- end
328
- end
329
- end
330
- end
331
-
332
- ##
333
- # Like distance_of_time_in_words, but where <tt>to_time</tt> is fixed to <tt>Time.now</tt>.
334
- #
335
- # @param [Time] from_time
336
- # The time to be compared against now in order to approximate the distance.
337
- # @param [Boolean] include_seconds
338
- # Set true for more detailed approximations.
339
- #
340
- # @return [String] The time formatted as a relative string.
341
- #
342
- # @example
343
- # time_ago_in_words(3.minutes.from_now) # => 3 minutes
344
- # time_ago_in_words(Time.now - 15.hours) # => 15 hours
345
- # time_ago_in_words(Time.now) # => less than a minute
346
- #
347
- def time_ago_in_words(from_time, include_seconds = false)
348
- distance_of_time_in_words(from_time, Time.now, include_seconds)
349
- end
350
-
351
- ##
352
- # Used in xxxx.js.erb files to escape html so that it can be passed to javascript from Padrino.
353
- #
354
- # @param [String] html
355
- # The HTML content to be escaped into javascript compatible format.
356
- #
357
- # @return [String] The html escaped for javascript passing.
358
- #
359
- # @example
360
- # js_escape_html("<h1>Hey</h1>")
361
- #
362
- def js_escape_html(html_content)
363
- return '' unless html_content
364
- javascript_mapping = { '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" }
365
- escaped_content = html_content.gsub(/(\\|<\/|\r\n|[\n\r"'])/){ |m| javascript_mapping[m] }
366
- escaped_content = escaped_content.html_safe if html_content.html_safe?
367
- escaped_content
368
- end
369
- alias :escape_javascript :js_escape_html
370
- end
371
- end
372
- end
@@ -1,103 +0,0 @@
1
- cs:
2
- number:
3
- # Used in number_with_delimiter().
4
- # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'.
5
- format:
6
- # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5).
7
- separator: ","
8
- # Delimits thousands (e.g. 1,000,000 is a million) (always in groups of three).
9
- delimiter: " "
10
- # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00).
11
- precision: 3
12
-
13
- # Used in number_to_currency().
14
- currency:
15
- format:
16
- # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00).
17
- format: "%n %u"
18
- unit: "Kč"
19
- # These three are to override number.format and are optional.
20
- separator: ","
21
- delimiter: " "
22
- precision: 2
23
-
24
- # Used in number_to_percentage().
25
- percentage:
26
- format:
27
- # These three are to override number.format and are optional.
28
- # separator:
29
- delimiter: ""
30
- # precision:
31
-
32
- # Used in number_to_precision()
33
- precision:
34
- format:
35
- # These three are to override number.format and are optional.
36
- # separator:
37
- delimiter: ""
38
- # precision:
39
-
40
- # Used in number_to_human_size().
41
- human:
42
- format:
43
- # These three are to override number.format and are optional.
44
- # separator:
45
- delimiter: ""
46
- precision: 1
47
- storage_units:
48
- # Storage units output formatting.
49
- # %u is the storage unit, %n is the number (default: 2 MB)
50
- format: "%n %u"
51
- units:
52
- byte:
53
- one: "Byte"
54
- other: "Bytes"
55
- kb: "KB"
56
- mb: "MB"
57
- gb: "GB"
58
- tb: "TB"
59
-
60
- # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words().
61
- datetime:
62
- distance_in_words:
63
- half_a_minute: "půl minutou"
64
- less_than_x_seconds:
65
- one: "asi před sekundou"
66
- other: "asi před %{count} sekundami"
67
- x_seconds:
68
- one: "sekundou"
69
- other: "%{count} sekundami"
70
- less_than_x_minutes:
71
- one: "před necelou minutou"
72
- other: "před ani ne %{count} minutami"
73
- x_minutes:
74
- one: "minutou"
75
- other: "%{count} minutami"
76
- about_x_hours:
77
- one: "asi hodinou"
78
- other: "asi %{count} hodinami"
79
- x_days:
80
- one: "24 hodinami"
81
- other: "%{count} dny"
82
- about_x_months:
83
- one: "asi měsícem"
84
- other: "asi %{count} měsíci"
85
- x_months:
86
- one: "měsícem"
87
- other: "%{count} měsíci"
88
- about_x_years:
89
- one: "asi rokem"
90
- other: "asi %{count} roky"
91
- over_x_years:
92
- one: "více než před rokem"
93
- other: "více než %{count} roky"
94
- almost_x_years:
95
- one: "skoro rokem"
96
- other: "almost %{count} roků"
97
- models:
98
- errors:
99
- template:
100
- header:
101
- one: "Při ukládání %{model} došlo k chybě a nebylo jej možné uložit"
102
- other: "Při ukládání %{model} došlo ke %{count} chybám a nebylo možné jej uložit"
103
- body: "Následující pole obsahují chybně vyplněné údaje:"