rango 0.2.3 → 0.2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. data/.gitignore +2 -2
  2. data/CHANGELOG +9 -0
  3. data/CONTRIBUTORS +0 -1
  4. data/Gemfile +2 -6
  5. data/lib/rango.rb +10 -7
  6. data/lib/rango/cli.rb +1 -1
  7. data/lib/rango/contrib/pagination/adapters/sequel.rb +6 -2
  8. data/lib/rango/controller.rb +24 -20
  9. data/lib/rango/core_ext.rb +54 -59
  10. data/lib/rango/exceptions.rb +2 -2
  11. data/lib/rango/gv/router.rb +1 -1
  12. data/lib/rango/gv/scaffolding.rb +0 -1
  13. data/lib/rango/mailer.rb +20 -40
  14. data/lib/rango/mixins/action_args.rb +8 -7
  15. data/lib/rango/mixins/filters.rb +1 -0
  16. data/lib/rango/mixins/message.rb +37 -33
  17. data/lib/rango/mixins/rack-flash.rb +44 -0
  18. data/{benchmarks/stubs/merb-app/spec/spec.opts → lib/rango/orm/tasks/ripple.nake} +0 -0
  19. data/lib/rango/rack/request.rb +12 -15
  20. data/lib/rango/router.rb +7 -3
  21. data/lib/rango/router/adapters/crudtree.rb +8 -1
  22. data/lib/rango/router/adapters/rack_mount.rb +5 -1
  23. data/lib/rango/router/adapters/usher.rb +5 -2
  24. data/lib/rango/stacks/controller.rb +0 -1
  25. data/lib/rango/templates/exts/haml.rb +14 -15
  26. data/lib/rango/templates/exts/tilt.rb +16 -23
  27. data/lib/rango/templates/helpers.rb +10 -1
  28. data/lib/rango/templates/template.rb +4 -4
  29. data/lib/rango/utils.rb +4 -2
  30. data/lib/rango/version.rb +5 -0
  31. data/rango.gemspec +3 -2
  32. data/{benchmarks/stubs/merb-core/spec/spec.opts → spec/rango/cli_spec.rb} +0 -0
  33. data/{benchmarks/stubs/rails/log/development.log → spec/rango/contrib/pagination/adapters/sequel_spec.rb} +0 -0
  34. data/spec/rango/controller_spec.rb +12 -0
  35. data/spec/rango/core_ext_spec.rb +61 -0
  36. data/spec/rango/environments_spec.rb +1 -0
  37. data/spec/rango/exceptions_spec.rb +1 -28
  38. data/{benchmarks/stubs/rails/log/production.log → spec/rango/mailer_spec.rb} +0 -0
  39. data/spec/rango/mixins/action_args_spec.rb +0 -4
  40. data/spec/rango/mixins/message_spec.rb +20 -10
  41. data/{benchmarks/stubs/rails/log/server.log → spec/rango/mixins/rack-flash_spec.rb} +0 -0
  42. data/spec/rango/rack/request_spec.rb +11 -0
  43. data/{benchmarks/stubs/rails/log/test.log → spec/rango/router/adapters/crudtree_spec.rb} +0 -0
  44. data/spec/rango/templates/helpers_spec.rb +19 -5
  45. data/spec/rango/templates/template_spec.rb +1 -20
  46. data/{benchmarks/stubs/rails/public/favicon.ico → spec/rango/version_spec.rb} +0 -0
  47. data/spec/spec_helper.rb +18 -4
  48. data/stubs/stack/content/%name%.gemspec.rbt +0 -0
  49. data/stubs/stack/content/%name%.pre.gemspec.rbt +1 -2
  50. data/stubs/stack/content/.gitignore +2 -5
  51. data/stubs/stack/content/Gemfile.rbt +23 -46
  52. data/stubs/stack/content/config.ru.rbt +9 -21
  53. data/stubs/stack/content/init.rb.rbt +10 -10
  54. data/stubs/stack/content/lib/%name%.rb.rbt +37 -4
  55. data/stubs/stack/content/lib/%name%/initializers/01_database.rb.rbt +16 -0
  56. data/stubs/stack/content/lib/%name%/initializers/05_templates.rb.rbt +13 -0
  57. data/stubs/stack/content/lib/%name%/initializers/10_pagination.rb.rbt +8 -0
  58. data/stubs/stack/content/lib/%name%/initializers/15_warden.rb.rbt +26 -0
  59. data/stubs/stack/content/lib/%name%/initializers/45_middlewares.rb.rbt +17 -0
  60. data/stubs/stack/content/lib/%name%/initializers/50_router.rb.rbt +7 -0
  61. data/stubs/stack/content/lib/%name%/{initializers/urls.rb.rbt → urls.rb.rbt} +3 -0
  62. data/stubs/stack/content/lib/%name%/views.rb.rbt +4 -1
  63. data/stubs/stack/content/templates/index.html.haml +1 -1
  64. data/{gems → vendor}/cache/abstract-1.0.0.gem +0 -0
  65. data/vendor/cache/code-cleaner-0.8.2.gem +0 -0
  66. data/{gems → vendor}/cache/erubis-2.6.5.gem +0 -0
  67. data/vendor/cache/haml-2.2.21.gem +0 -0
  68. data/{gems → vendor}/cache/nake-0.0.8.gem +0 -0
  69. data/vendor/cache/rack-1.1.0.gem +0 -0
  70. data/{gems → vendor}/cache/rspec-1.3.0.gem +0 -0
  71. data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
  72. data/vendor/cache/tilt-0.8.gem +0 -0
  73. metadata +63 -239
  74. data/benchmarks/stubs/merb-app/.gitignore +0 -21
  75. data/benchmarks/stubs/merb-app/Rakefile +0 -35
  76. data/benchmarks/stubs/merb-app/app/controllers/application.rb +0 -4
  77. data/benchmarks/stubs/merb-app/app/controllers/exceptions.rb +0 -15
  78. data/benchmarks/stubs/merb-app/app/helpers/global_helpers.rb +0 -7
  79. data/benchmarks/stubs/merb-app/app/models/user.rb +0 -19
  80. data/benchmarks/stubs/merb-app/app/views/exceptions/not_acceptable.html.erb +0 -63
  81. data/benchmarks/stubs/merb-app/app/views/exceptions/not_found.html.erb +0 -47
  82. data/benchmarks/stubs/merb-app/app/views/layout/application.html.erb +0 -12
  83. data/benchmarks/stubs/merb-app/autotest/discover.rb +0 -4
  84. data/benchmarks/stubs/merb-app/autotest/merb.rb +0 -154
  85. data/benchmarks/stubs/merb-app/autotest/merb_rspec.rb +0 -167
  86. data/benchmarks/stubs/merb-app/config/database.yml +0 -33
  87. data/benchmarks/stubs/merb-app/config/dependencies.rb +0 -36
  88. data/benchmarks/stubs/merb-app/config/environments/development.rb +0 -17
  89. data/benchmarks/stubs/merb-app/config/environments/production.rb +0 -12
  90. data/benchmarks/stubs/merb-app/config/environments/rake.rb +0 -13
  91. data/benchmarks/stubs/merb-app/config/environments/staging.rb +0 -12
  92. data/benchmarks/stubs/merb-app/config/environments/test.rb +0 -14
  93. data/benchmarks/stubs/merb-app/config/init.rb +0 -26
  94. data/benchmarks/stubs/merb-app/config/rack.rb +0 -13
  95. data/benchmarks/stubs/merb-app/config/router.rb +0 -46
  96. data/benchmarks/stubs/merb-app/doc/rdoc/generators/merb_generator.rb +0 -1364
  97. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/api_grease.js +0 -640
  98. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/index.html.erb +0 -37
  99. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.css +0 -252
  100. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb.rb +0 -353
  101. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/merb_doc_styles.css +0 -492
  102. data/benchmarks/stubs/merb-app/doc/rdoc/generators/template/merb/prototype.js +0 -2515
  103. data/benchmarks/stubs/merb-app/merb/merb-auth/setup.rb +0 -46
  104. data/benchmarks/stubs/merb-app/merb/merb-auth/strategies.rb +0 -13
  105. data/benchmarks/stubs/merb-app/merb/session/session.rb +0 -11
  106. data/benchmarks/stubs/merb-app/public/.htaccess +0 -17
  107. data/benchmarks/stubs/merb-app/public/favicon.ico +0 -0
  108. data/benchmarks/stubs/merb-app/public/images/merb.jpg +0 -0
  109. data/benchmarks/stubs/merb-app/public/javascripts/application.js +0 -1
  110. data/benchmarks/stubs/merb-app/public/javascripts/jquery.js +0 -19
  111. data/benchmarks/stubs/merb-app/public/merb.fcgi +0 -22
  112. data/benchmarks/stubs/merb-app/public/robots.txt +0 -5
  113. data/benchmarks/stubs/merb-app/public/stylesheets/master.css +0 -119
  114. data/benchmarks/stubs/merb-app/spec/spec_helper.rb +0 -27
  115. data/benchmarks/stubs/merb-app/tasks/doc.thor +0 -151
  116. data/benchmarks/stubs/merb-app/tasks/merb.thor/app_script.rb +0 -33
  117. data/benchmarks/stubs/merb-app/tasks/merb.thor/common.rb +0 -70
  118. data/benchmarks/stubs/merb-app/tasks/merb.thor/gem_ext.rb +0 -127
  119. data/benchmarks/stubs/merb-app/tasks/merb.thor/main.thor +0 -152
  120. data/benchmarks/stubs/merb-app/tasks/merb.thor/ops.rb +0 -95
  121. data/benchmarks/stubs/merb-app/tasks/merb.thor/utils.rb +0 -42
  122. data/benchmarks/stubs/merb-core/.gitignore +0 -21
  123. data/benchmarks/stubs/merb-core/Rakefile +0 -35
  124. data/benchmarks/stubs/merb-core/app/controllers/application.rb +0 -4
  125. data/benchmarks/stubs/merb-core/app/controllers/exceptions.rb +0 -15
  126. data/benchmarks/stubs/merb-core/app/helpers/global_helpers.rb +0 -7
  127. data/benchmarks/stubs/merb-core/app/views/exceptions/not_acceptable.html.erb +0 -63
  128. data/benchmarks/stubs/merb-core/app/views/exceptions/not_found.html.erb +0 -47
  129. data/benchmarks/stubs/merb-core/app/views/layout/application.html.erb +0 -12
  130. data/benchmarks/stubs/merb-core/autotest/discover.rb +0 -1
  131. data/benchmarks/stubs/merb-core/autotest/merb.rb +0 -151
  132. data/benchmarks/stubs/merb-core/autotest/merb_rspec.rb +0 -167
  133. data/benchmarks/stubs/merb-core/config/environments/development.rb +0 -17
  134. data/benchmarks/stubs/merb-core/config/environments/production.rb +0 -12
  135. data/benchmarks/stubs/merb-core/config/environments/rake.rb +0 -13
  136. data/benchmarks/stubs/merb-core/config/environments/staging.rb +0 -12
  137. data/benchmarks/stubs/merb-core/config/environments/test.rb +0 -14
  138. data/benchmarks/stubs/merb-core/config/init.rb +0 -27
  139. data/benchmarks/stubs/merb-core/config/rack.rb +0 -13
  140. data/benchmarks/stubs/merb-core/config/router.rb +0 -43
  141. data/benchmarks/stubs/merb-core/doc/rdoc/generators/merb_generator.rb +0 -1364
  142. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/api_grease.js +0 -640
  143. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/index.html.erb +0 -37
  144. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.css +0 -252
  145. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb.rb +0 -353
  146. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/merb_doc_styles.css +0 -492
  147. data/benchmarks/stubs/merb-core/doc/rdoc/generators/template/merb/prototype.js +0 -2515
  148. data/benchmarks/stubs/merb-core/public/.htaccess +0 -17
  149. data/benchmarks/stubs/merb-core/public/favicon.ico +0 -0
  150. data/benchmarks/stubs/merb-core/public/images/merb.jpg +0 -0
  151. data/benchmarks/stubs/merb-core/public/javascripts/application.js +0 -1
  152. data/benchmarks/stubs/merb-core/public/merb.fcgi +0 -22
  153. data/benchmarks/stubs/merb-core/public/robots.txt +0 -5
  154. data/benchmarks/stubs/merb-core/public/stylesheets/master.css +0 -119
  155. data/benchmarks/stubs/merb-core/spec/spec_helper.rb +0 -22
  156. data/benchmarks/stubs/merb-core/tasks/merb.thor/app_script.rb +0 -33
  157. data/benchmarks/stubs/merb-core/tasks/merb.thor/common.rb +0 -70
  158. data/benchmarks/stubs/merb-core/tasks/merb.thor/gem_ext.rb +0 -127
  159. data/benchmarks/stubs/merb-core/tasks/merb.thor/main.thor +0 -152
  160. data/benchmarks/stubs/merb-core/tasks/merb.thor/ops.rb +0 -95
  161. data/benchmarks/stubs/merb-core/tasks/merb.thor/utils.rb +0 -42
  162. data/benchmarks/stubs/merb-flat/.gitignore +0 -21
  163. data/benchmarks/stubs/merb-flat/README.txt +0 -10
  164. data/benchmarks/stubs/merb-flat/Rakefile +0 -35
  165. data/benchmarks/stubs/merb-flat/application.rb +0 -17
  166. data/benchmarks/stubs/merb-flat/config/framework.rb +0 -9
  167. data/benchmarks/stubs/merb-flat/config/init.rb +0 -42
  168. data/benchmarks/stubs/merb-flat/spec/spec_helper.rb +0 -26
  169. data/benchmarks/stubs/merb-flat/tasks/merb.thor/app_script.rb +0 -33
  170. data/benchmarks/stubs/merb-flat/tasks/merb.thor/common.rb +0 -70
  171. data/benchmarks/stubs/merb-flat/tasks/merb.thor/gem_ext.rb +0 -127
  172. data/benchmarks/stubs/merb-flat/tasks/merb.thor/main.thor +0 -152
  173. data/benchmarks/stubs/merb-flat/tasks/merb.thor/ops.rb +0 -95
  174. data/benchmarks/stubs/merb-flat/tasks/merb.thor/utils.rb +0 -42
  175. data/benchmarks/stubs/merb-flat/views/foo.html.erb +0 -3
  176. data/benchmarks/stubs/merb-very-flat/.gitignore +0 -21
  177. data/benchmarks/stubs/merb-very-flat/Rakefile +0 -35
  178. data/benchmarks/stubs/merb-very-flat/merb-very-flat.rb +0 -61
  179. data/benchmarks/stubs/merb-very-flat/spec/spec_helper.rb +0 -26
  180. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/app_script.rb +0 -33
  181. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/common.rb +0 -70
  182. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/gem_ext.rb +0 -127
  183. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/main.thor +0 -152
  184. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/ops.rb +0 -95
  185. data/benchmarks/stubs/merb-very-flat/tasks/merb.thor/utils.rb +0 -42
  186. data/benchmarks/stubs/rails/README +0 -243
  187. data/benchmarks/stubs/rails/Rakefile +0 -10
  188. data/benchmarks/stubs/rails/app/controllers/application_controller.rb +0 -12
  189. data/benchmarks/stubs/rails/app/helpers/application_helper.rb +0 -5
  190. data/benchmarks/stubs/rails/config/boot.rb +0 -112
  191. data/benchmarks/stubs/rails/config/database.yml +0 -22
  192. data/benchmarks/stubs/rails/config/environment.rb +0 -43
  193. data/benchmarks/stubs/rails/config/environments/development.rb +0 -19
  194. data/benchmarks/stubs/rails/config/environments/production.rb +0 -30
  195. data/benchmarks/stubs/rails/config/environments/test.rb +0 -30
  196. data/benchmarks/stubs/rails/config/initializers/backtrace_silencers.rb +0 -9
  197. data/benchmarks/stubs/rails/config/initializers/inflections.rb +0 -12
  198. data/benchmarks/stubs/rails/config/initializers/mime_types.rb +0 -7
  199. data/benchmarks/stubs/rails/config/initializers/new_rails_defaults.rb +0 -21
  200. data/benchmarks/stubs/rails/config/initializers/session_store.rb +0 -17
  201. data/benchmarks/stubs/rails/config/locales/en.yml +0 -5
  202. data/benchmarks/stubs/rails/config/routes.rb +0 -45
  203. data/benchmarks/stubs/rails/doc/README_FOR_APP +0 -2
  204. data/benchmarks/stubs/rails/public/404.html +0 -30
  205. data/benchmarks/stubs/rails/public/422.html +0 -30
  206. data/benchmarks/stubs/rails/public/500.html +0 -30
  207. data/benchmarks/stubs/rails/public/images/rails.png +0 -0
  208. data/benchmarks/stubs/rails/public/index.html +0 -275
  209. data/benchmarks/stubs/rails/public/javascripts/application.js +0 -2
  210. data/benchmarks/stubs/rails/public/javascripts/controls.js +0 -963
  211. data/benchmarks/stubs/rails/public/javascripts/dragdrop.js +0 -973
  212. data/benchmarks/stubs/rails/public/javascripts/effects.js +0 -1128
  213. data/benchmarks/stubs/rails/public/javascripts/prototype.js +0 -4320
  214. data/benchmarks/stubs/rails/public/robots.txt +0 -5
  215. data/benchmarks/stubs/rails/script/about +0 -4
  216. data/benchmarks/stubs/rails/script/console +0 -3
  217. data/benchmarks/stubs/rails/script/dbconsole +0 -3
  218. data/benchmarks/stubs/rails/script/destroy +0 -3
  219. data/benchmarks/stubs/rails/script/generate +0 -3
  220. data/benchmarks/stubs/rails/script/performance/benchmarker +0 -3
  221. data/benchmarks/stubs/rails/script/performance/profiler +0 -3
  222. data/benchmarks/stubs/rails/script/plugin +0 -3
  223. data/benchmarks/stubs/rails/script/runner +0 -3
  224. data/benchmarks/stubs/rails/script/server +0 -3
  225. data/benchmarks/stubs/rails/test/performance/browsing_test.rb +0 -11
  226. data/benchmarks/stubs/rails/test/test_helper.rb +0 -40
  227. data/benchmarks/stubs/ramaze.rb +0 -0
  228. data/benchmarks/stubs/sinatra.rb +0 -11
  229. data/gems/cache/code-cleaner-0.1.gem +0 -0
  230. data/gems/cache/code-cleaner-0.2.gem +0 -0
  231. data/gems/cache/code-cleaner-0.3.gem +0 -0
  232. data/gems/cache/code-cleaner-0.4.gem +0 -0
  233. data/gems/cache/code-cleaner-0.5.gem +0 -0
  234. data/gems/cache/code-cleaner-0.6.gem +0 -0
  235. data/gems/cache/code-cleaner-0.7.gem +0 -0
  236. data/gems/cache/code-cleaner-0.8.1.gem +0 -0
  237. data/gems/cache/code-cleaner-0.8.gem +0 -0
  238. data/gems/cache/extlib-0.9.14.gem +0 -0
  239. data/gems/cache/haml-2.2.16.gem +0 -0
  240. data/gems/cache/haml-2.2.17.gem +0 -0
  241. data/gems/cache/nake-0.0.2.gem +0 -0
  242. data/gems/cache/nake-0.0.3.gem +0 -0
  243. data/gems/cache/nake-0.0.5.gem +0 -0
  244. data/gems/cache/nake-0.0.6.gem +0 -0
  245. data/gems/cache/rack-1.0.1.gem +0 -0
  246. data/gems/cache/rack-1.1.0.gem +0 -0
  247. data/gems/cache/rspec-1.2.9.gem +0 -0
  248. data/gems/cache/term-ansicolor-1.0.4.gem +0 -0
  249. data/gems/cache/tilt-0.4.gem +0 -0
  250. data/gems/cache/tilt-0.5.gem +0 -0
  251. data/lib/rango/forms/form.rb +0 -30
  252. data/lib/rango/helpers.rb +0 -31
  253. data/lib/rango/helpers/assets.rb +0 -46
  254. data/lib/rango/helpers/general.rb +0 -53
  255. data/lib/rango/helpers/syntax.rb +0 -30
  256. data/lib/rango/mixins/chainable.rb +0 -66
  257. data/lib/rango/mixins/http_caching.rb +0 -78
  258. data/lib/rango/router/adapters/rack_router.rb +0 -7
  259. data/lib/rango/templates/exts/erubis.rb +0 -65
  260. data/spec/rango/forms/form_spec.rb +0 -0
  261. data/spec/rango/helpers/assets_spec.rb +0 -0
  262. data/spec/rango/helpers/general_spec.rb +0 -0
  263. data/spec/rango/helpers/syntax_spec.rb +0 -0
  264. data/spec/rango/helpers_spec.rb +0 -0
  265. data/spec/rango/rack/middlewares/email_obfuscator_spec.rb +0 -0
  266. data/spec/rango/router/adapters/rack_router_spec.rb +0 -0
  267. data/spec/rango/templates/exts/erubis_spec.rb +0 -0
  268. data/spec/stubs/templates/_basic.html.erb +0 -6
  269. data/spec/stubs/templates/basic.html.erb +0 -6
  270. data/spec/stubs/templates/capture.html.erb +0 -11
  271. data/spec/stubs/templates/context.html.erb +0 -6
  272. data/spec/stubs/templates/erubis.html.erubis +0 -2
  273. data/spec/stubs/templates/exception.html.erb +0 -1
  274. data/spec/stubs/templates/inheritance/capture/erb/base.html.erb +0 -3
  275. data/spec/stubs/templates/inheritance/capture/erb/index.html.erb +0 -4
  276. data/spec/stubs/templates/inheritance/capture/erubis/base.html.erubis +0 -3
  277. data/spec/stubs/templates/inheritance/capture/erubis/index.html.erubis +0 -4
  278. data/stubs/stack/content/lib/%name%/config.rb.rbt +0 -0
  279. data/stubs/stack/content/lib/%name%/initializers/middlewares.rb.rbt +0 -5
  280. data/stubs/stack/content/rackup.rb.rbt +0 -41
  281. data/support/hooks/pre-commit +0 -12
@@ -1,7 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require "rack/router"
4
-
5
- Rango::Router.implement(:rack_router) do |env|
6
- env["rango.router.params"] = env["rack_router.params"]
7
- end
@@ -1,65 +0,0 @@
1
- # stolen from merb-core
2
-
3
- module Erubis
4
- # This adds support for embedding the return value of a block call:
5
- # <%= foo do %>...<% end =%>
6
- #
7
- # :api: private
8
- module Basic::Converter
9
- def convert_input(src, input)
10
- pat = @pattern
11
- regexp = pat.nil? || pat == '<% %>' ? DEFAULT_REGEXP : pattern_regexp(pat)
12
- pos = 0
13
- is_bol = true # is beginning of line
14
- input.scan(regexp) do |indicator, code, tailch, rspace|
15
- match = Regexp.last_match()
16
- len = match.begin(0) - pos
17
- text = input[pos, len]
18
- pos = match.end(0)
19
- ch = indicator ? indicator[0] : nil
20
- lspace = ch == ?= ? nil : detect_spaces_at_bol(text, is_bol)
21
- is_bol = rspace ? true : false
22
- add_text(src, text) if text && !text.empty?
23
- ## * when '<%= %>', do nothing
24
- ## * when '<% %>' or '<%# %>', delete spaces iff only spaces are around '<% %>'
25
- if ch == ?= # <%= %>
26
- rspace = nil if tailch && !tailch.empty?
27
- add_text(src, lspace) if lspace
28
- add_expr(src, code, indicator)
29
- add_text(src, rspace) if rspace
30
- elsif ch == ?\# # <%# %>
31
- n = code.count("\n") + (rspace ? 1 : 0)
32
- if @trim && lspace && rspace
33
- add_stmt(src, "\n" * n)
34
- else
35
- add_text(src, lspace) if lspace
36
- add_stmt(src, "\n" * n)
37
- add_text(src, rspace) if rspace
38
- end
39
- elsif ch == ?% # <%% %>
40
- s = "#{lspace}#{@prefix||='<%'}#{code}#{tailch}#{@postfix||='%>'}#{rspace}"
41
- add_text(src, s)
42
- else # <% %>
43
- if @trim && lspace && rspace
44
- if respond_to?(:add_stmt2)
45
- add_stmt2(src, "#{lspace}#{code}#{rspace}", tailch)
46
- else
47
- add_stmt(src, "#{lspace}#{code}#{rspace}")
48
- end
49
- else
50
- add_text(src, lspace) if lspace
51
- if respond_to?(:add_stmt2)
52
- add_stmt2(src, code, tailch)
53
- else
54
- add_stmt(src, code)
55
- end
56
- add_text(src, rspace) if rspace
57
- end
58
- end
59
- end
60
- #rest = $' || input # ruby1.8
61
- rest = pos == 0 ? input : input[pos..-1] # ruby
62
- add_text(src, rest)
63
- end
64
- end
65
- end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +0,0 @@
1
- <h1><%= @title %></h1>
2
- <ul>
3
- <% 3.times do |int| %>
4
- <li><%= int + 1 %>#</li>
5
- <% end %>
6
- </ul>
@@ -1,6 +0,0 @@
1
- <h1><%= @title %></h1>
2
- <ul>
3
- <% 3.times do |int| %>
4
- <li><%= int + 1 %>#</li>
5
- <% end %>
6
- </ul>
@@ -1,11 +0,0 @@
1
- <ul>
2
- <% 1.upto(3) do |step| %>
3
- <% @code = capture do %>
4
- <li><%= step %></li>
5
- <% end %>
6
- <% end %>
7
- </ul>
8
-
9
- <pre>
10
- <%= @code %>
11
- </pre>
@@ -1,6 +0,0 @@
1
- <h1>Hello <%= who || "World" %>!</h1>
2
- <ul>
3
- <% 3.times do |int| %>
4
- <li><%= int + 1 %>#</li>
5
- <% end %>
6
- </ul>
@@ -1,2 +0,0 @@
1
- <%= helper do %>
2
- <% end =%>
@@ -1 +0,0 @@
1
- <% raise %>
@@ -1,3 +0,0 @@
1
- <html>
2
- <body><%= block(:content) %></body>
3
- </html>
@@ -1,4 +0,0 @@
1
- <% extends "inheritance/capture/erubis/base.html" %>
2
- <% block(:content) do %>
3
- Hello!
4
- <% end %>
@@ -1,3 +0,0 @@
1
- <html>
2
- <body><%= block(:content) %></body>
3
- </html>
@@ -1,4 +0,0 @@
1
- <% extends "inheritance/capture/erubis/base.html" %>
2
- <% block(:content) do %>
3
- Hello!
4
- <% end %>
@@ -1,5 +0,0 @@
1
- # nepridavat middlewares ktere uz jsou v @ins
2
- # => global rack builder object
3
- # joshbuddy mel neco na insertovani middlewares
4
-
5
- # Rango.rackup.use
@@ -1,41 +0,0 @@
1
- <%= shebang "./init.rb" %>
2
- # encoding: utf-8
3
-
4
- require "rack"
5
- require "rango/rack/middlewares/basic"
6
-
7
- require_relative "urls"
8
-
9
- puts "~ Running rackup.rb"
10
-
11
- <% if @warden %>
12
-
13
- # warden authentication
14
- # wiki.github.com/hassox/warden/setup
15
- require "warden"
16
-
17
- # See also wiki.github.com/hassox/warden/callbacks
18
- Warden::Manager.serialize_into_session { |user| user.id }
19
- Warden::Manager.serialize_from_session { |key| User.get(id) }
20
-
21
- # Go to login
22
- Warden::Manager.before_failure do |env, opts|
23
- Login.route_to env, "login"
24
- end
25
-
26
- Warden::Strategies.add(:password) do
27
- def authenticate!
28
- User.new # TODO
29
- end
30
- end
31
- <% end %>
32
-
33
- # run config.ru
34
- if File.basename($0).eql?("init.rb")
35
- Rack::Builder.new do
36
- app = self.instance_eval(::File.read("config.ru"))
37
- Rack::Handler::Thin.run(app, Port: 4000)
38
- end
39
- else
40
- Rack::Builder.new { self.instance_eval ::File.read("config.ru") }
41
- end
@@ -1,12 +0,0 @@
1
- #!/bin/sh
2
-
3
- echo "Entering pre-commit hook ..."
4
-
5
- for file in $(git diff --staged --name-only); do
6
- echo "Normalizing $file ..."
7
- if test -f $file; then
8
- if ./script/normalize.rb "$file"; then
9
- git add $file # so the changes will be committed immediately
10
- fi
11
- fi
12
- done