rango 0.0.6 → 0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (524) hide show
  1. data/doc/0.0.3/Array.html +354 -0
  2. data/doc/0.0.3/AttributeMixin.html +697 -0
  3. data/doc/0.0.3/Class.html +102 -0
  4. data/doc/0.0.3/ColoredString.html +476 -0
  5. data/doc/0.0.3/Enumerable.html +256 -0
  6. data/doc/0.0.3/File.html +909 -0
  7. data/doc/0.0.3/Hash.html +1586 -0
  8. data/doc/0.0.3/Kernel.html +956 -0
  9. data/doc/0.0.3/OS.html +740 -0
  10. data/doc/0.0.3/Object.html +466 -0
  11. data/doc/0.0.3/ObjectSpace.html +184 -0
  12. data/doc/0.0.3/Path.html +2499 -0
  13. data/doc/0.0.3/Range.html +190 -0
  14. data/doc/0.0.3/Rango.html +379 -0
  15. data/doc/0.0.3/Rango/ApplicationMixin.html +396 -0
  16. data/doc/0.0.3/Rango/Bundling.html +23 -0
  17. data/doc/0.0.3/Rango/Bundling/RequireStrategy.html +283 -0
  18. data/doc/0.0.3/Rango/Bundling/Strategy.html +703 -0
  19. data/doc/0.0.3/Rango/CLI.html +23 -0
  20. data/doc/0.0.3/Rango/CLI/Generator.html +762 -0
  21. data/doc/0.0.3/Rango/CLI/Templater.html +258 -0
  22. data/doc/0.0.3/Rango/CallableStrategy.html +300 -0
  23. data/doc/0.0.3/Rango/Chainable.html +181 -0
  24. data/doc/0.0.3/Rango/Configurable.html +199 -0
  25. data/doc/0.0.3/Rango/Controller.html +962 -0
  26. data/doc/0.0.3/Rango/ControllerMixin.html +860 -0
  27. data/doc/0.0.3/Rango/ControllerStrategy.html +264 -0
  28. data/doc/0.0.3/Rango/DependencyStrategy.html +116 -0
  29. data/doc/0.0.3/Rango/Dispatcher.html +305 -0
  30. data/doc/0.0.3/Rango/Form.html +162 -0
  31. data/doc/0.0.3/Rango/GemDependencyStrategy.html +210 -0
  32. data/doc/0.0.3/Rango/Generator.html +93 -0
  33. data/doc/0.0.3/Rango/GenericViews.html +128 -0
  34. data/doc/0.0.3/Rango/GitDependencyStrategy.html +224 -0
  35. data/doc/0.0.3/Rango/GithubDependencyStrategy.html +118 -0
  36. data/doc/0.0.3/Rango/Handler.html +474 -0
  37. data/doc/0.0.3/Rango/Helpers.html +1335 -0
  38. data/doc/0.0.3/Rango/Hookable.html +202 -0
  39. data/doc/0.0.3/Rango/ImportMixin.html +755 -0
  40. data/doc/0.0.3/Rango/Logger.html +920 -0
  41. data/doc/0.0.3/Rango/Mini.html +117 -0
  42. data/doc/0.0.3/Rango/ModelForm.html +42 -0
  43. data/doc/0.0.3/Rango/Project.html +516 -0
  44. data/doc/0.0.3/Rango/RenderMixin.html +23 -0
  45. data/doc/0.0.3/Rango/Request.html +1177 -0
  46. data/doc/0.0.3/Rango/Route.html +751 -0
  47. data/doc/0.0.3/Rango/Router.html +42 -0
  48. data/doc/0.0.3/Rango/Router/Dispatcher.html +311 -0
  49. data/doc/0.0.3/Rango/RouterStrategy.html +258 -0
  50. data/doc/0.0.3/Rango/Session.html +23 -0
  51. data/doc/0.0.3/Rango/Settings.html +23 -0
  52. data/doc/0.0.3/Rango/Settings/Erubis.html +23 -0
  53. data/doc/0.0.3/Rango/Settings/Framework.html +254 -0
  54. data/doc/0.0.3/Rango/Settings/Haml.html +23 -0
  55. data/doc/0.0.3/Rango/Settings/Template.html +23 -0
  56. data/doc/0.0.3/Rango/SimpleTemplate.html +187 -0
  57. data/doc/0.0.3/Rango/StrategyMixin.html +261 -0
  58. data/doc/0.0.3/Rango/Tasks.html +219 -0
  59. data/doc/0.0.3/Rango/Template.html +95 -0
  60. data/doc/0.0.3/Rango/Template/Adapter.html +90 -0
  61. data/doc/0.0.3/Rango/Templates.html +116 -0
  62. data/doc/0.0.3/Rango/Templates/Adapter.html +128 -0
  63. data/doc/0.0.3/Rango/Templates/Template.html +636 -0
  64. data/doc/0.0.3/Rango/Templates/TemplateHelpers.html +328 -0
  65. data/doc/0.0.3/RangoThor.html +205 -0
  66. data/doc/0.0.3/String.html +307 -0
  67. data/doc/0.0.3/Time.html +193 -0
  68. data/doc/0.0.3/TimeDSL.html +601 -0
  69. data/doc/0.0.3/all-methods.html +1908 -0
  70. data/doc/0.0.3/all-namespaces.html +114 -0
  71. data/doc/0.0.3/app.js +18 -0
  72. data/doc/0.0.3/head/Array.html +354 -0
  73. data/doc/0.0.3/head/AttributeMixin.html +697 -0
  74. data/doc/0.0.3/head/Class.html +102 -0
  75. data/doc/0.0.3/head/ColoredString.html +476 -0
  76. data/doc/0.0.3/head/Enumerable.html +256 -0
  77. data/doc/0.0.3/head/File.html +909 -0
  78. data/doc/0.0.3/head/Hash.html +1586 -0
  79. data/doc/0.0.3/head/Kernel.html +956 -0
  80. data/doc/0.0.3/head/OS.html +740 -0
  81. data/doc/0.0.3/head/Object.html +466 -0
  82. data/doc/0.0.3/head/ObjectSpace.html +184 -0
  83. data/doc/0.0.3/head/Path.html +2499 -0
  84. data/doc/0.0.3/head/Range.html +190 -0
  85. data/doc/0.0.3/head/Rango.html +379 -0
  86. data/doc/0.0.3/head/Rango/ApplicationMixin.html +396 -0
  87. data/doc/0.0.3/head/Rango/Bundling.html +23 -0
  88. data/doc/0.0.3/head/Rango/Bundling/RequireStrategy.html +283 -0
  89. data/doc/0.0.3/head/Rango/Bundling/Strategy.html +703 -0
  90. data/doc/0.0.3/head/Rango/CLI.html +23 -0
  91. data/doc/0.0.3/head/Rango/CLI/Generator.html +762 -0
  92. data/doc/0.0.3/head/Rango/CLI/Templater.html +258 -0
  93. data/doc/0.0.3/head/Rango/CallableStrategy.html +300 -0
  94. data/doc/0.0.3/head/Rango/Chainable.html +181 -0
  95. data/doc/0.0.3/head/Rango/Configurable.html +199 -0
  96. data/doc/0.0.3/head/Rango/Controller.html +962 -0
  97. data/doc/0.0.3/head/Rango/ControllerMixin.html +860 -0
  98. data/doc/0.0.3/head/Rango/ControllerStrategy.html +264 -0
  99. data/doc/0.0.3/head/Rango/DependencyStrategy.html +116 -0
  100. data/doc/0.0.3/head/Rango/Dispatcher.html +305 -0
  101. data/doc/0.0.3/head/Rango/Form.html +162 -0
  102. data/doc/0.0.3/head/Rango/GemDependencyStrategy.html +210 -0
  103. data/doc/0.0.3/head/Rango/Generator.html +93 -0
  104. data/doc/0.0.3/head/Rango/GenericViews.html +128 -0
  105. data/doc/0.0.3/head/Rango/GitDependencyStrategy.html +224 -0
  106. data/doc/0.0.3/head/Rango/GithubDependencyStrategy.html +118 -0
  107. data/doc/0.0.3/head/Rango/Handler.html +474 -0
  108. data/doc/0.0.3/head/Rango/Helpers.html +1335 -0
  109. data/doc/0.0.3/head/Rango/Hookable.html +202 -0
  110. data/doc/0.0.3/head/Rango/ImportMixin.html +755 -0
  111. data/doc/0.0.3/head/Rango/Logger.html +920 -0
  112. data/doc/0.0.3/head/Rango/Mini.html +117 -0
  113. data/doc/0.0.3/head/Rango/ModelForm.html +42 -0
  114. data/doc/0.0.3/head/Rango/Project.html +516 -0
  115. data/doc/0.0.3/head/Rango/RenderMixin.html +23 -0
  116. data/doc/0.0.3/head/Rango/Request.html +1177 -0
  117. data/doc/0.0.3/head/Rango/Route.html +751 -0
  118. data/doc/0.0.3/head/Rango/Router.html +42 -0
  119. data/doc/0.0.3/head/Rango/Router/Dispatcher.html +311 -0
  120. data/doc/0.0.3/head/Rango/RouterStrategy.html +258 -0
  121. data/doc/0.0.3/head/Rango/Session.html +23 -0
  122. data/doc/0.0.3/head/Rango/Settings.html +23 -0
  123. data/doc/0.0.3/head/Rango/Settings/Erubis.html +23 -0
  124. data/doc/0.0.3/head/Rango/Settings/Framework.html +254 -0
  125. data/doc/0.0.3/head/Rango/Settings/Haml.html +23 -0
  126. data/doc/0.0.3/head/Rango/Settings/Template.html +23 -0
  127. data/doc/0.0.3/head/Rango/SimpleTemplate.html +187 -0
  128. data/doc/0.0.3/head/Rango/StrategyMixin.html +261 -0
  129. data/doc/0.0.3/head/Rango/Tasks.html +219 -0
  130. data/doc/0.0.3/head/Rango/Template.html +95 -0
  131. data/doc/0.0.3/head/Rango/Template/Adapter.html +90 -0
  132. data/doc/0.0.3/head/Rango/Templates.html +116 -0
  133. data/doc/0.0.3/head/Rango/Templates/Adapter.html +128 -0
  134. data/doc/0.0.3/head/Rango/Templates/Template.html +636 -0
  135. data/doc/0.0.3/head/Rango/Templates/TemplateHelpers.html +328 -0
  136. data/doc/0.0.3/head/RangoThor.html +205 -0
  137. data/doc/0.0.3/head/String.html +307 -0
  138. data/doc/0.0.3/head/Time.html +193 -0
  139. data/doc/0.0.3/head/TimeDSL.html +601 -0
  140. data/doc/0.0.3/head/all-methods.html +1908 -0
  141. data/doc/0.0.3/head/all-namespaces.html +114 -0
  142. data/doc/0.0.3/head/app.js +18 -0
  143. data/doc/0.0.3/head/index.html +18 -0
  144. data/doc/0.0.3/head/jquery.js +11 -0
  145. data/doc/0.0.3/head/readme.html +36 -0
  146. data/doc/0.0.3/head/style.css +68 -0
  147. data/doc/0.0.3/head/syntax_highlight.css +21 -0
  148. data/doc/0.0.3/index.html +18 -0
  149. data/doc/0.0.3/jquery.js +11 -0
  150. data/doc/0.0.3/readme.html +36 -0
  151. data/doc/0.0.3/style.css +68 -0
  152. data/doc/0.0.3/syntax_highlight.css +21 -0
  153. data/doc/0.0.4/Array.html +354 -0
  154. data/doc/0.0.4/AttributeMixin.html +697 -0
  155. data/doc/0.0.4/Class.html +102 -0
  156. data/doc/0.0.4/ColoredString.html +476 -0
  157. data/doc/0.0.4/Enumerable.html +256 -0
  158. data/doc/0.0.4/File.html +909 -0
  159. data/doc/0.0.4/Hash.html +1586 -0
  160. data/doc/0.0.4/Kernel.html +956 -0
  161. data/doc/0.0.4/OS.html +740 -0
  162. data/doc/0.0.4/Object.html +466 -0
  163. data/doc/0.0.4/ObjectSpace.html +184 -0
  164. data/doc/0.0.4/Path.html +2499 -0
  165. data/doc/0.0.4/Range.html +190 -0
  166. data/doc/0.0.4/Rango.html +379 -0
  167. data/doc/0.0.4/Rango/ApplicationMixin.html +396 -0
  168. data/doc/0.0.4/Rango/Bundling.html +23 -0
  169. data/doc/0.0.4/Rango/Bundling/RequireStrategy.html +283 -0
  170. data/doc/0.0.4/Rango/Bundling/Strategy.html +703 -0
  171. data/doc/0.0.4/Rango/CLI.html +23 -0
  172. data/doc/0.0.4/Rango/CLI/Generator.html +762 -0
  173. data/doc/0.0.4/Rango/CLI/Templater.html +258 -0
  174. data/doc/0.0.4/Rango/CallableStrategy.html +300 -0
  175. data/doc/0.0.4/Rango/Chainable.html +181 -0
  176. data/doc/0.0.4/Rango/Configurable.html +199 -0
  177. data/doc/0.0.4/Rango/Controller.html +962 -0
  178. data/doc/0.0.4/Rango/ControllerMixin.html +860 -0
  179. data/doc/0.0.4/Rango/ControllerStrategy.html +264 -0
  180. data/doc/0.0.4/Rango/DependencyStrategy.html +116 -0
  181. data/doc/0.0.4/Rango/Dispatcher.html +305 -0
  182. data/doc/0.0.4/Rango/Form.html +162 -0
  183. data/doc/0.0.4/Rango/GemDependencyStrategy.html +210 -0
  184. data/doc/0.0.4/Rango/Generator.html +93 -0
  185. data/doc/0.0.4/Rango/GenericViews.html +128 -0
  186. data/doc/0.0.4/Rango/GitDependencyStrategy.html +224 -0
  187. data/doc/0.0.4/Rango/GithubDependencyStrategy.html +118 -0
  188. data/doc/0.0.4/Rango/Handler.html +474 -0
  189. data/doc/0.0.4/Rango/Helpers.html +1335 -0
  190. data/doc/0.0.4/Rango/Hookable.html +202 -0
  191. data/doc/0.0.4/Rango/ImportMixin.html +755 -0
  192. data/doc/0.0.4/Rango/Logger.html +920 -0
  193. data/doc/0.0.4/Rango/Mini.html +117 -0
  194. data/doc/0.0.4/Rango/ModelForm.html +42 -0
  195. data/doc/0.0.4/Rango/Project.html +516 -0
  196. data/doc/0.0.4/Rango/RenderMixin.html +23 -0
  197. data/doc/0.0.4/Rango/Request.html +1177 -0
  198. data/doc/0.0.4/Rango/Route.html +751 -0
  199. data/doc/0.0.4/Rango/Router.html +42 -0
  200. data/doc/0.0.4/Rango/Router/Dispatcher.html +311 -0
  201. data/doc/0.0.4/Rango/RouterStrategy.html +258 -0
  202. data/doc/0.0.4/Rango/Session.html +23 -0
  203. data/doc/0.0.4/Rango/Settings.html +23 -0
  204. data/doc/0.0.4/Rango/Settings/Erubis.html +23 -0
  205. data/doc/0.0.4/Rango/Settings/Framework.html +254 -0
  206. data/doc/0.0.4/Rango/Settings/Haml.html +23 -0
  207. data/doc/0.0.4/Rango/Settings/Template.html +23 -0
  208. data/doc/0.0.4/Rango/SimpleTemplate.html +187 -0
  209. data/doc/0.0.4/Rango/StrategyMixin.html +261 -0
  210. data/doc/0.0.4/Rango/Tasks.html +219 -0
  211. data/doc/0.0.4/Rango/Template.html +95 -0
  212. data/doc/0.0.4/Rango/Template/Adapter.html +90 -0
  213. data/doc/0.0.4/Rango/Templates.html +116 -0
  214. data/doc/0.0.4/Rango/Templates/Adapter.html +128 -0
  215. data/doc/0.0.4/Rango/Templates/Template.html +636 -0
  216. data/doc/0.0.4/Rango/Templates/TemplateHelpers.html +328 -0
  217. data/doc/0.0.4/RangoThor.html +205 -0
  218. data/doc/0.0.4/String.html +307 -0
  219. data/doc/0.0.4/Time.html +193 -0
  220. data/doc/0.0.4/TimeDSL.html +601 -0
  221. data/doc/0.0.4/all-methods.html +1908 -0
  222. data/doc/0.0.4/all-namespaces.html +114 -0
  223. data/doc/0.0.4/app.js +18 -0
  224. data/doc/0.0.4/head/Array.html +354 -0
  225. data/doc/0.0.4/head/AttributeMixin.html +697 -0
  226. data/doc/0.0.4/head/Class.html +102 -0
  227. data/doc/0.0.4/head/ColoredString.html +476 -0
  228. data/doc/0.0.4/head/Enumerable.html +256 -0
  229. data/doc/0.0.4/head/File.html +909 -0
  230. data/doc/0.0.4/head/Hash.html +1586 -0
  231. data/doc/0.0.4/head/Kernel.html +956 -0
  232. data/doc/0.0.4/head/OS.html +740 -0
  233. data/doc/0.0.4/head/Object.html +466 -0
  234. data/doc/0.0.4/head/ObjectSpace.html +184 -0
  235. data/doc/0.0.4/head/Path.html +2499 -0
  236. data/doc/0.0.4/head/Range.html +190 -0
  237. data/doc/0.0.4/head/Rango.html +379 -0
  238. data/doc/0.0.4/head/Rango/ApplicationMixin.html +396 -0
  239. data/doc/0.0.4/head/Rango/Bundling.html +23 -0
  240. data/doc/0.0.4/head/Rango/Bundling/RequireStrategy.html +283 -0
  241. data/doc/0.0.4/head/Rango/Bundling/Strategy.html +703 -0
  242. data/doc/0.0.4/head/Rango/CLI.html +23 -0
  243. data/doc/0.0.4/head/Rango/CLI/Generator.html +762 -0
  244. data/doc/0.0.4/head/Rango/CLI/Templater.html +258 -0
  245. data/doc/0.0.4/head/Rango/CallableStrategy.html +300 -0
  246. data/doc/0.0.4/head/Rango/Chainable.html +181 -0
  247. data/doc/0.0.4/head/Rango/Configurable.html +199 -0
  248. data/doc/0.0.4/head/Rango/Controller.html +962 -0
  249. data/doc/0.0.4/head/Rango/ControllerMixin.html +860 -0
  250. data/doc/0.0.4/head/Rango/ControllerStrategy.html +264 -0
  251. data/doc/0.0.4/head/Rango/DependencyStrategy.html +116 -0
  252. data/doc/0.0.4/head/Rango/Dispatcher.html +305 -0
  253. data/doc/0.0.4/head/Rango/Form.html +162 -0
  254. data/doc/0.0.4/head/Rango/GemDependencyStrategy.html +210 -0
  255. data/doc/0.0.4/head/Rango/Generator.html +93 -0
  256. data/doc/0.0.4/head/Rango/GenericViews.html +128 -0
  257. data/doc/0.0.4/head/Rango/GitDependencyStrategy.html +224 -0
  258. data/doc/0.0.4/head/Rango/GithubDependencyStrategy.html +118 -0
  259. data/doc/0.0.4/head/Rango/Handler.html +474 -0
  260. data/doc/0.0.4/head/Rango/Helpers.html +1335 -0
  261. data/doc/0.0.4/head/Rango/Hookable.html +202 -0
  262. data/doc/0.0.4/head/Rango/ImportMixin.html +755 -0
  263. data/doc/0.0.4/head/Rango/Logger.html +920 -0
  264. data/doc/0.0.4/head/Rango/Mini.html +117 -0
  265. data/doc/0.0.4/head/Rango/ModelForm.html +42 -0
  266. data/doc/0.0.4/head/Rango/Project.html +516 -0
  267. data/doc/0.0.4/head/Rango/RenderMixin.html +23 -0
  268. data/doc/0.0.4/head/Rango/Request.html +1177 -0
  269. data/doc/0.0.4/head/Rango/Route.html +751 -0
  270. data/doc/0.0.4/head/Rango/Router.html +42 -0
  271. data/doc/0.0.4/head/Rango/Router/Dispatcher.html +311 -0
  272. data/doc/0.0.4/head/Rango/RouterStrategy.html +258 -0
  273. data/doc/0.0.4/head/Rango/Session.html +23 -0
  274. data/doc/0.0.4/head/Rango/Settings.html +23 -0
  275. data/doc/0.0.4/head/Rango/Settings/Erubis.html +23 -0
  276. data/doc/0.0.4/head/Rango/Settings/Framework.html +254 -0
  277. data/doc/0.0.4/head/Rango/Settings/Haml.html +23 -0
  278. data/doc/0.0.4/head/Rango/Settings/Template.html +23 -0
  279. data/doc/0.0.4/head/Rango/SimpleTemplate.html +187 -0
  280. data/doc/0.0.4/head/Rango/StrategyMixin.html +261 -0
  281. data/doc/0.0.4/head/Rango/Tasks.html +219 -0
  282. data/doc/0.0.4/head/Rango/Template.html +95 -0
  283. data/doc/0.0.4/head/Rango/Template/Adapter.html +90 -0
  284. data/doc/0.0.4/head/Rango/Templates.html +116 -0
  285. data/doc/0.0.4/head/Rango/Templates/Adapter.html +128 -0
  286. data/doc/0.0.4/head/Rango/Templates/Template.html +636 -0
  287. data/doc/0.0.4/head/Rango/Templates/TemplateHelpers.html +328 -0
  288. data/doc/0.0.4/head/RangoThor.html +205 -0
  289. data/doc/0.0.4/head/String.html +307 -0
  290. data/doc/0.0.4/head/Time.html +193 -0
  291. data/doc/0.0.4/head/TimeDSL.html +601 -0
  292. data/doc/0.0.4/head/all-methods.html +1908 -0
  293. data/doc/0.0.4/head/all-namespaces.html +114 -0
  294. data/doc/0.0.4/head/app.js +18 -0
  295. data/doc/0.0.4/head/index.html +18 -0
  296. data/doc/0.0.4/head/jquery.js +11 -0
  297. data/doc/0.0.4/head/readme.html +36 -0
  298. data/doc/0.0.4/head/style.css +68 -0
  299. data/doc/0.0.4/head/syntax_highlight.css +21 -0
  300. data/doc/0.0.4/index.html +18 -0
  301. data/doc/0.0.4/jquery.js +11 -0
  302. data/doc/0.0.4/readme.html +36 -0
  303. data/doc/0.0.4/style.css +68 -0
  304. data/doc/0.0.4/syntax_highlight.css +21 -0
  305. data/doc/0.0.5/Array.html +354 -0
  306. data/doc/0.0.5/AttributeMixin.html +697 -0
  307. data/doc/0.0.5/Class.html +102 -0
  308. data/doc/0.0.5/ColoredString.html +476 -0
  309. data/doc/0.0.5/Enumerable.html +256 -0
  310. data/doc/0.0.5/File.html +909 -0
  311. data/doc/0.0.5/Hash.html +1586 -0
  312. data/doc/0.0.5/Kernel.html +956 -0
  313. data/doc/0.0.5/OS.html +740 -0
  314. data/doc/0.0.5/Object.html +466 -0
  315. data/doc/0.0.5/ObjectSpace.html +184 -0
  316. data/doc/0.0.5/Path.html +2499 -0
  317. data/doc/0.0.5/Range.html +190 -0
  318. data/doc/0.0.5/Rango.html +379 -0
  319. data/doc/0.0.5/Rango/ApplicationMixin.html +396 -0
  320. data/doc/0.0.5/Rango/Bundling.html +23 -0
  321. data/doc/0.0.5/Rango/Bundling/RequireStrategy.html +283 -0
  322. data/doc/0.0.5/Rango/Bundling/Strategy.html +703 -0
  323. data/doc/0.0.5/Rango/CLI.html +23 -0
  324. data/doc/0.0.5/Rango/CLI/Generator.html +762 -0
  325. data/doc/0.0.5/Rango/CLI/Templater.html +258 -0
  326. data/doc/0.0.5/Rango/CallableStrategy.html +300 -0
  327. data/doc/0.0.5/Rango/Chainable.html +181 -0
  328. data/doc/0.0.5/Rango/Configurable.html +199 -0
  329. data/doc/0.0.5/Rango/Controller.html +962 -0
  330. data/doc/0.0.5/Rango/ControllerMixin.html +860 -0
  331. data/doc/0.0.5/Rango/ControllerStrategy.html +264 -0
  332. data/doc/0.0.5/Rango/DependencyStrategy.html +116 -0
  333. data/doc/0.0.5/Rango/Dispatcher.html +305 -0
  334. data/doc/0.0.5/Rango/Form.html +162 -0
  335. data/doc/0.0.5/Rango/GemDependencyStrategy.html +210 -0
  336. data/doc/0.0.5/Rango/Generator.html +93 -0
  337. data/doc/0.0.5/Rango/GenericViews.html +128 -0
  338. data/doc/0.0.5/Rango/GitDependencyStrategy.html +224 -0
  339. data/doc/0.0.5/Rango/GithubDependencyStrategy.html +118 -0
  340. data/doc/0.0.5/Rango/Handler.html +474 -0
  341. data/doc/0.0.5/Rango/Helpers.html +1335 -0
  342. data/doc/0.0.5/Rango/Hookable.html +202 -0
  343. data/doc/0.0.5/Rango/ImportMixin.html +755 -0
  344. data/doc/0.0.5/Rango/Logger.html +920 -0
  345. data/doc/0.0.5/Rango/Mini.html +117 -0
  346. data/doc/0.0.5/Rango/ModelForm.html +42 -0
  347. data/doc/0.0.5/Rango/Project.html +516 -0
  348. data/doc/0.0.5/Rango/RenderMixin.html +23 -0
  349. data/doc/0.0.5/Rango/Request.html +1177 -0
  350. data/doc/0.0.5/Rango/Route.html +751 -0
  351. data/doc/0.0.5/Rango/Router.html +42 -0
  352. data/doc/0.0.5/Rango/Router/Dispatcher.html +311 -0
  353. data/doc/0.0.5/Rango/RouterStrategy.html +258 -0
  354. data/doc/0.0.5/Rango/Session.html +23 -0
  355. data/doc/0.0.5/Rango/Settings.html +23 -0
  356. data/doc/0.0.5/Rango/Settings/Erubis.html +23 -0
  357. data/doc/0.0.5/Rango/Settings/Framework.html +254 -0
  358. data/doc/0.0.5/Rango/Settings/Haml.html +23 -0
  359. data/doc/0.0.5/Rango/Settings/Template.html +23 -0
  360. data/doc/0.0.5/Rango/SimpleTemplate.html +187 -0
  361. data/doc/0.0.5/Rango/StrategyMixin.html +261 -0
  362. data/doc/0.0.5/Rango/Tasks.html +219 -0
  363. data/doc/0.0.5/Rango/Template.html +95 -0
  364. data/doc/0.0.5/Rango/Template/Adapter.html +90 -0
  365. data/doc/0.0.5/Rango/Templates.html +116 -0
  366. data/doc/0.0.5/Rango/Templates/Adapter.html +128 -0
  367. data/doc/0.0.5/Rango/Templates/Template.html +636 -0
  368. data/doc/0.0.5/Rango/Templates/TemplateHelpers.html +328 -0
  369. data/doc/0.0.5/RangoThor.html +205 -0
  370. data/doc/0.0.5/String.html +307 -0
  371. data/doc/0.0.5/Time.html +193 -0
  372. data/doc/0.0.5/TimeDSL.html +601 -0
  373. data/doc/0.0.5/all-methods.html +2092 -0
  374. data/doc/0.0.5/all-namespaces.html +126 -0
  375. data/doc/0.0.5/app.js +18 -0
  376. data/doc/0.0.5/index.html +18 -0
  377. data/doc/0.0.5/jquery.js +11 -0
  378. data/doc/0.0.5/readme.html +36 -0
  379. data/doc/0.0.5/style.css +68 -0
  380. data/doc/0.0.5/syntax_highlight.css +21 -0
  381. data/doc/head/Array.html +354 -0
  382. data/doc/head/AttributeMixin.html +697 -0
  383. data/doc/head/Class.html +102 -0
  384. data/doc/head/ColoredString.html +476 -0
  385. data/doc/head/Enumerable.html +256 -0
  386. data/doc/head/File.html +909 -0
  387. data/doc/head/Hash.html +1586 -0
  388. data/doc/head/Kernel.html +956 -0
  389. data/doc/head/OS.html +740 -0
  390. data/doc/head/Object.html +466 -0
  391. data/doc/head/ObjectSpace.html +184 -0
  392. data/doc/head/Path.html +2499 -0
  393. data/doc/head/Range.html +190 -0
  394. data/doc/head/Rango.html +379 -0
  395. data/doc/head/Rango/ApplicationMixin.html +396 -0
  396. data/doc/head/Rango/Bundling.html +23 -0
  397. data/doc/head/Rango/Bundling/RequireStrategy.html +283 -0
  398. data/doc/head/Rango/Bundling/Strategy.html +703 -0
  399. data/doc/head/Rango/CLI.html +23 -0
  400. data/doc/head/Rango/CLI/Generator.html +762 -0
  401. data/doc/head/Rango/CLI/Templater.html +258 -0
  402. data/doc/head/Rango/CallableStrategy.html +300 -0
  403. data/doc/head/Rango/Chainable.html +181 -0
  404. data/doc/head/Rango/Configurable.html +199 -0
  405. data/doc/head/Rango/Controller.html +962 -0
  406. data/doc/head/Rango/ControllerMixin.html +860 -0
  407. data/doc/head/Rango/ControllerStrategy.html +264 -0
  408. data/doc/head/Rango/DependencyStrategy.html +116 -0
  409. data/doc/head/Rango/Dispatcher.html +305 -0
  410. data/doc/head/Rango/Form.html +162 -0
  411. data/doc/head/Rango/GemDependencyStrategy.html +210 -0
  412. data/doc/head/Rango/Generator.html +93 -0
  413. data/doc/head/Rango/GenericViews.html +128 -0
  414. data/doc/head/Rango/GitDependencyStrategy.html +224 -0
  415. data/doc/head/Rango/GithubDependencyStrategy.html +118 -0
  416. data/doc/head/Rango/Handler.html +474 -0
  417. data/doc/head/Rango/Helpers.html +1335 -0
  418. data/doc/head/Rango/Hookable.html +202 -0
  419. data/doc/head/Rango/ImportMixin.html +755 -0
  420. data/doc/head/Rango/Logger.html +920 -0
  421. data/doc/head/Rango/Mini.html +117 -0
  422. data/doc/head/Rango/ModelForm.html +42 -0
  423. data/doc/head/Rango/Project.html +516 -0
  424. data/doc/head/Rango/RenderMixin.html +23 -0
  425. data/doc/head/Rango/Request.html +1177 -0
  426. data/doc/head/Rango/Route.html +751 -0
  427. data/doc/head/Rango/Router.html +42 -0
  428. data/doc/head/Rango/Router/Dispatcher.html +311 -0
  429. data/doc/head/Rango/RouterStrategy.html +258 -0
  430. data/doc/head/Rango/Session.html +23 -0
  431. data/doc/head/Rango/Settings.html +23 -0
  432. data/doc/head/Rango/Settings/Erubis.html +23 -0
  433. data/doc/head/Rango/Settings/Framework.html +254 -0
  434. data/doc/head/Rango/Settings/Haml.html +23 -0
  435. data/doc/head/Rango/Settings/Template.html +23 -0
  436. data/doc/head/Rango/SimpleTemplate.html +187 -0
  437. data/doc/head/Rango/StrategyMixin.html +261 -0
  438. data/doc/head/Rango/Tasks.html +219 -0
  439. data/doc/head/Rango/Template.html +95 -0
  440. data/doc/head/Rango/Template/Adapter.html +90 -0
  441. data/doc/head/Rango/Templates.html +116 -0
  442. data/doc/head/Rango/Templates/Adapter.html +128 -0
  443. data/doc/head/Rango/Templates/Template.html +636 -0
  444. data/doc/head/Rango/Templates/TemplateHelpers.html +328 -0
  445. data/doc/head/RangoThor.html +205 -0
  446. data/doc/head/String.html +307 -0
  447. data/doc/head/Time.html +193 -0
  448. data/doc/head/TimeDSL.html +601 -0
  449. data/doc/head/all-methods.html +2092 -0
  450. data/doc/head/all-namespaces.html +126 -0
  451. data/doc/head/app.js +18 -0
  452. data/doc/head/index.html +18 -0
  453. data/doc/head/jquery.js +11 -0
  454. data/doc/head/readme.html +36 -0
  455. data/doc/head/style.css +68 -0
  456. data/doc/head/syntax_highlight.css +21 -0
  457. data/doc/versions/0.0.1/Rango.html +1025 -0
  458. data/doc/versions/0.0.1/Rango/CallableStrategy.html +166 -0
  459. data/doc/versions/0.0.1/Rango/ControllerStrategy.html +180 -0
  460. data/doc/versions/0.0.1/Rango/Route.html +340 -0
  461. data/doc/versions/0.0.1/Rango/Router.html +502 -0
  462. data/doc/versions/0.0.1/Rango/RouterStrategy.html +94 -0
  463. data/doc/versions/0.0.1/Rango/Template.html +28 -0
  464. data/doc/versions/0.0.1/Rango/Template/Adapter.html +90 -0
  465. data/doc/versions/0.0.1/all-methods.html +228 -0
  466. data/doc/versions/0.0.1/all-namespaces.html +36 -0
  467. data/doc/versions/0.0.1/app.js +18 -0
  468. data/doc/versions/0.0.1/index.html +18 -0
  469. data/doc/versions/0.0.1/jquery.js +11 -0
  470. data/doc/versions/0.0.1/readme.html +137 -0
  471. data/doc/versions/0.0.1/style.css +68 -0
  472. data/doc/versions/0.0.1/syntax_highlight.css +21 -0
  473. data/lib/rango/contrib/pagination.rb +2 -1
  474. data/lib/rango/contrib/pagination/_pagination.html.haml +4 -4
  475. data/lib/rango/contrib/pagination/helpers.rb +0 -10
  476. data/lib/rango/gv.rb +0 -3
  477. data/lib/rango/helpers/merb-helpers/form/builder.rb +1 -0
  478. data/lib/rango/mixins/render.rb +0 -3
  479. data/lib/rango/orm/tasks/{datamapper.rake → datamapper.thor} +16 -9
  480. data/lib/rango/orm/tasks/{sequel.rake → sequel.thor} +0 -0
  481. data/lib/rango/rango.rb +4 -17
  482. data/lib/rango/router.rb +0 -9
  483. data/lib/rango/router/adapters/usher.rb +1 -1
  484. data/lib/rango/settings/erubis.rb +0 -2
  485. data/lib/rango/settings/haml.rb +0 -6
  486. data/lib/rango/settings/template.rb +1 -3
  487. data/lib/rango/templates/adapter.rb +1 -1
  488. data/lib/rango/templates/erubis.rb +2 -2
  489. data/lib/rango/templates/template.rb +1 -3
  490. data/lib/rango/templates/templates.txt +1 -1
  491. data/lib/rango/{utils.rb → testing.rb} +1 -1
  492. data/rango-0.0.6.pre.gem +0 -0
  493. data/rango.gemspec +1 -1
  494. data/rango.pre.gemspec +48 -0
  495. data/stubs/app/content/init.rb.rbt +0 -3
  496. data/stubs/app/content/models.rb.rbt +1 -9
  497. data/stubs/app/content/views.rb.rbt +4 -13
  498. data/stubs/app/setup.rb +3 -4
  499. data/stubs/project/content/{Gemfile.rbt → Gemfile} +4 -55
  500. data/stubs/project/content/Rakefile +9 -0
  501. data/stubs/project/content/config.ru.rbt +5 -33
  502. data/stubs/project/content/init.rb.rbt +3 -29
  503. data/stubs/project/content/spec/spec_helper.rb +6 -17
  504. data/stubs/project/content/templates/base.html.haml.rbt +22 -9
  505. data/stubs/project/postprocess.rb +1 -7
  506. data/stubs/project/setup.rb +1 -4
  507. data/vendor/cli/Rakefile +1 -19
  508. data/vendor/media-path/Rakefile +1 -19
  509. data/vendor/rack/Rakefile +2 -1
  510. data/vendor/rack/lib/rack.rb +1 -0
  511. data/vendor/rack/lib/rack/auth/openid.rb +487 -0
  512. data/vendor/rack/test/spec_rack_auth_openid.rb +84 -0
  513. data/vendor/rubyexts/Rakefile +1 -19
  514. data/vendor/rubyexts/lib/rubyexts/kernel.rb +1 -1
  515. data/vendor/simple-templater/lib/simple-templater/helpers.rb +1 -1
  516. metadata +486 -16
  517. data/lib/rango/router/adapters/rack_mount.rb +0 -17
  518. data/lib/rango/tasks/spec.rake +0 -7
  519. data/stubs/project/content/Rakefile.rbt +0 -12
  520. data/stubs/project/content/spec/%name%/init_spec.rb.rbt +0 -7
  521. data/stubs/project/content/spec/%name%/models_spec.rb.rbt +0 -10
  522. data/stubs/project/content/spec/%name%/views_spec.rb.rbt +0 -22
  523. data/stubs/project/content/spec/spec.opts +0 -5
  524. data/stubs/project/content/templates/index.html.haml +0 -24
@@ -1,26 +1,15 @@
1
- # encoding: utf-8
1
+ require_relative "../init"
2
2
 
3
- # NOTE: we don't have to require spec, webrat,
4
- # rack/test or whatever, it's bundler job to do it
3
+ require "spec"
4
+ require "webrat"
5
+ require "rack/test"
6
+ require "rango/testing"
5
7
 
6
- # load test environment include dependencies
7
- RANGO_ENV = "test"
8
- require_relative "../init.rb"
8
+ Rango::Testing.load_rackup
9
9
 
10
- # load config.ru
11
- Rango::Utils.load_rackup
12
-
13
- # webrat
14
- Webrat.configure do |config|
15
- config.mode = :rack
16
- end
17
-
18
- # rspec
19
10
  Spec::Runner.configure do |config|
20
11
  config.include Rack::Test::Methods
21
- config.include Webrat::Matchers
22
12
 
23
- # for rack-test
24
13
  def app
25
14
  Project.router
26
15
  end
@@ -1,16 +1,29 @@
1
1
  !!! 1.0 Strict
2
2
  %html{html_attrs("en")}
3
3
  %head
4
- %title= block(:title)
4
+ %title= block("title")
5
5
  %meta{"http-equiv" => "content-type", content: "text/html; charset=utf-8"}
6
6
  %meta{"http-equiv" => "content-language", content: "en-us"}
7
- %meta{name: "description", content: block(:description, "")}
8
- %meta{name: "keywords", content: block(:keywords, "")}
9
- %meta{name: "author", content: "<%= ENV["USER"] %>"}
10
- = javascripts *block(:javascripts, Array.new)
11
- = stylesheets *block(:stylesheets, Array.new)
12
- = block(:head)
7
+ %meta{name: "description", content: block("description", "")}
8
+ %meta{name: "keywords", content: block("keywords", "")}
9
+ %meta{name: "author", content: "AUTHOR"}
10
+ / = pupu :blueprint, plugins: ["fancy-type"]
11
+ / = pupu :flash
12
+ / = pupu :autocompleter, type: "request"
13
+ / = pupu :mootools#, more: true
14
+ = javascripts *block("javascripts", Array.new)
15
+ = stylesheets *block("stylesheets", Array.new)
16
+ = block "head"
13
17
  %body
14
18
  .container
15
- %h1!= block(:title)
16
- != block(:content)
19
+ %h1 Title
20
+ %h2.alt subtitle
21
+ %hr
22
+ %div.span-16
23
+ %div.span-14.last= block "content"
24
+ %h3 Menu
25
+ %ul
26
+ %li= link_to "Why Rango?", "/why-rango"
27
+ %div.span-8
28
+ %hr
29
+ == &copy; #{copyright(2009)} AUTHOR, created by <a href="http://101ideas.cz">101Ideas.cz</a>, graphics by <a href="http://josefrichter.com">JosefRichter.com</a>.
@@ -8,15 +8,9 @@ require "simple-templater/hooks/postprocess/git_repository"
8
8
 
9
9
  if RubyExts::Platform.unix?
10
10
  sh "chmod +x init.rb"
11
- sh "chmod +x config.ru"
11
+ sh "chmod +x config.ru"
12
12
  end
13
13
 
14
14
  hook do |generator, context|
15
15
  generator.after(Hooks::GitRepository)
16
- # TODO: this is probably not the best way how to do it
17
- args = Array.new
18
- args.push("--orm=#{context[:orm]}") if context[:orm]
19
- args.push("--models=#{context[:models].join(",")}") unless context[:models].empty?
20
- args.push("--controllers=#{context[:controllers].join(",")}") unless context[:controllers].empty?
21
- sh "rango create app #{context[:name]} #{args.join(" ")}"
22
16
  end
@@ -4,12 +4,9 @@
4
4
  # You can update context hash and register hooks. Don't forget to use merge! instead of merge, because you are
5
5
  # manipulating with one object, rather than returning new one.
6
6
 
7
- # rango create app blog --models=post,tag --controllers=posts,tags --router=usher|rack-router|rack-mount --template-engine=erubis
7
+ # rango create app blog --models=post,tag --controllers=posts,tags
8
8
  hook do |generator, context|
9
9
  models = context[:models] || Array.new
10
10
  controllers = context[:controllers] || Array.new
11
11
  context.merge!(models: models, controllers: controllers)
12
- context[:orm] = "datamapper" unless context[:orm]
13
- context[:router] = "usher" unless context[:router]
14
- context[:template_engine] = "haml" unless context[:template_engine]
15
12
  end
data/vendor/cli/Rakefile CHANGED
@@ -32,21 +32,6 @@ task :gem do
32
32
  sh "gem build cli.gemspec"
33
33
  end
34
34
 
35
- namespace :gem do
36
- task :prerelease do
37
- require_relative "lib/cli"
38
- gemspec = Dir["*.gemspec"].first
39
- content = File.read(gemspec)
40
- prename = "#{gemspec.split(".").first}.pre.gemspec"
41
- version = CLI::VERSION.sub(/^(\d+)\.(\d+)\.\d+$/) { "#$1.#{$1.to_i + 1}" }
42
- File.open(prename, "w") do |file|
43
- file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
44
- end
45
- sh "gem build #{prename}"
46
- rm prename
47
- end
48
- end
49
-
50
35
  desc "Release new version of cli"
51
36
  task release: ["release:tag", "release:gemcutter"]
52
37
 
@@ -61,13 +46,10 @@ namespace :release do
61
46
  end
62
47
 
63
48
  desc "Push gem to Gemcutter"
64
- task :gemcutter do
49
+ task :gemcutter => :gem do
65
50
  puts "Pushing to Gemcutter ..."
66
51
  sh "gem push #{Dir["*.gem"].last}"
67
52
  end
68
-
69
- desc "Create and push prerelease gem"
70
- task :pre => ["gem:prerelease", :gemcutter]
71
53
  end
72
54
 
73
55
  desc "Run specs"
@@ -32,21 +32,6 @@ task :gem do
32
32
  sh "gem build media-path.gemspec"
33
33
  end
34
34
 
35
- namespace :gem do
36
- task :prerelease do
37
- require_relative "lib/media-path"
38
- gemspec = Dir["*.gemspec"].first
39
- content = File.read(gemspec)
40
- prename = "#{gemspec.split(".").first}.pre.gemspec"
41
- version = MediaPath::VERSION.sub(/^(\d+)\.(\d+)\.\d+$/) { "#$1.#{$1.to_i + 1}" }
42
- File.open(prename, "w") do |file|
43
- file.puts(content.gsub(/(\w+::VERSION)/, "'#{version}.pre'"))
44
- end
45
- sh "gem build #{prename}"
46
- rm prename
47
- end
48
- end
49
-
50
35
  desc "Release new version of media-path"
51
36
  task release: ["release:tag", "release:gemcutter"]
52
37
 
@@ -61,13 +46,10 @@ namespace :release do
61
46
  end
62
47
 
63
48
  desc "Push gem to Gemcutter"
64
- task :gemcutter do
49
+ task :gemcutter => :gem do
65
50
  puts "Pushing to Gemcutter ..."
66
51
  sh "gem push #{Dir["*.gem"].last}"
67
52
  end
68
-
69
- desc "Create and push prerelease gem"
70
- task :pre => ["gem:prerelease", :gemcutter]
71
53
  end
72
54
 
73
55
  desc "Run specs"
data/vendor/rack/Rakefile CHANGED
@@ -86,7 +86,7 @@ end
86
86
 
87
87
  desc "Run all the fast tests"
88
88
  task :test do
89
- sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS'] || '-t "^(?!Rack::Handler|Rack::Adapter|Rack::Session::Memcache)"'}"
89
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS'] || '-t "^(?!Rack::Handler|Rack::Adapter|Rack::Session::Memcache|Rack::Auth::OpenID)"'}"
90
90
  end
91
91
 
92
92
  desc "Run all the tests"
@@ -135,6 +135,7 @@ Also see http://rack.rubyforge.org.
135
135
  s.add_development_dependency 'fcgi'
136
136
  s.add_development_dependency 'memcache-client'
137
137
  s.add_development_dependency 'mongrel'
138
+ s.add_development_dependency 'ruby-openid', '~> 2.0.0'
138
139
  s.add_development_dependency 'thin'
139
140
  end
140
141
 
@@ -59,6 +59,7 @@ module Rack
59
59
  autoload :Basic, "rack/auth/basic"
60
60
  autoload :AbstractRequest, "rack/auth/abstract/request"
61
61
  autoload :AbstractHandler, "rack/auth/abstract/handler"
62
+ autoload :OpenID, "rack/auth/openid"
62
63
  module Digest
63
64
  autoload :MD5, "rack/auth/digest/md5"
64
65
  autoload :Nonce, "rack/auth/digest/nonce"
@@ -0,0 +1,487 @@
1
+ # AUTHOR: Scytrin dai Kinthra <scytrin@gmail.com>; blink#ruby-lang@irc.freenode.net
2
+
3
+ gem 'ruby-openid', '~> 2' if defined? Gem
4
+ require 'rack/request'
5
+ require 'rack/utils'
6
+ require 'rack/auth/abstract/handler'
7
+
8
+ require 'uri'
9
+ require 'openid'
10
+ require 'openid/extension'
11
+ require 'openid/store/memory'
12
+
13
+ module Rack
14
+ class Request
15
+ def openid_request
16
+ @env['rack.auth.openid.request']
17
+ end
18
+
19
+ def openid_response
20
+ @env['rack.auth.openid.response']
21
+ end
22
+ end
23
+
24
+ module Auth
25
+
26
+ # Rack::Auth::OpenID provides a simple method for setting up an OpenID
27
+ # Consumer. It requires the ruby-openid library from janrain to operate,
28
+ # as well as a rack method of session management.
29
+ #
30
+ # The ruby-openid home page is at http://openidenabled.com/ruby-openid/.
31
+ #
32
+ # The OpenID specifications can be found at
33
+ # http://openid.net/specs/openid-authentication-1_1.html
34
+ # and
35
+ # http://openid.net/specs/openid-authentication-2_0.html. Documentation
36
+ # for published OpenID extensions and related topics can be found at
37
+ # http://openid.net/developers/specs/.
38
+ #
39
+ # It is recommended to read through the OpenID spec, as well as
40
+ # ruby-openid's documentation, to understand what exactly goes on. However
41
+ # a setup as simple as the presented examples is enough to provide
42
+ # Consumer functionality.
43
+ #
44
+ # This library strongly intends to utilize the OpenID 2.0 features of the
45
+ # ruby-openid library, which provides OpenID 1.0 compatiblity.
46
+ #
47
+ # NOTE: Due to the amount of data that this library stores in the
48
+ # session, Rack::Session::Cookie may fault.
49
+ #
50
+ # == Examples
51
+ #
52
+ # simple_oid = OpenID.new('http://mysite.com/')
53
+ #
54
+ # return_oid = OpenID.new('http://mysite.com/', {
55
+ # :return_to => 'http://mysite.com/openid'
56
+ # })
57
+ #
58
+ # complex_oid = OpenID.new('http://mysite.com/',
59
+ # :immediate => true,
60
+ # :extensions => {
61
+ # ::OpenID::SReg => [['email'],['nickname']]
62
+ # }
63
+ # )
64
+ #
65
+ # = Advanced
66
+ #
67
+ # Most of the functionality of this library is encapsulated such that
68
+ # expansion and overriding functions isn't difficult nor tricky.
69
+ # Alternately, to avoid opening up singleton objects or subclassing, a
70
+ # wrapper rack middleware can be composed to act upon Auth::OpenID's
71
+ # responses. See #check and #finish for locations of pertinent data.
72
+ #
73
+ # == Responses
74
+ #
75
+ # To change the responses that Auth::OpenID returns, override the methods
76
+ # #redirect, #bad_request, #unauthorized, #access_denied, and
77
+ # #foreign_server_failure.
78
+ #
79
+ # Additionally #confirm_post_params is used when the URI would exceed
80
+ # length limits on a GET request when doing the initial verification
81
+ # request.
82
+ #
83
+ # == Processing
84
+ #
85
+ # To change methods of processing completed transactions, override the
86
+ # methods #success, #setup_needed, #cancel, and #failure. Please ensure
87
+ # the returned object is a rack compatible response.
88
+ #
89
+ # The first argument is an OpenID::Response, the second is a
90
+ # Rack::Request of the current request, the last is the hash used in
91
+ # ruby-openid handling, which can be found manually at
92
+ # env['rack.session'][:openid].
93
+ #
94
+ # This is useful if you wanted to expand the processing done, such as
95
+ # setting up user accounts.
96
+ #
97
+ # oid_app = Rack::Auth::OpenID.new realm, :return_to => return_to
98
+ # def oid_app.success oid, request, session
99
+ # user = Models::User[oid.identity_url]
100
+ # user ||= Models::User.create_from_openid oid
101
+ # request['rack.session'][:user] = user.id
102
+ # redirect MyApp.site_home
103
+ # end
104
+ #
105
+ # site_map['/openid'] = oid_app
106
+ # map = Rack::URLMap.new site_map
107
+ # ...
108
+
109
+ class OpenID
110
+ # Raised if an incompatible session is being used.
111
+ class NoSession < RuntimeError; end
112
+ # Raised if an extension not matching specifications is provided.
113
+ class BadExtension < RuntimeError; end
114
+ # Possible statuses returned from consumer responses. See definitions
115
+ # in the ruby-openid library.
116
+ ValidStatus = [
117
+ ::OpenID::Consumer::SUCCESS,
118
+ ::OpenID::Consumer::FAILURE,
119
+ ::OpenID::Consumer::CANCEL,
120
+ ::OpenID::Consumer::SETUP_NEEDED
121
+ ]
122
+
123
+ # The first argument is the realm, identifying the site they are trusting
124
+ # with their identity. This is required, also treated as the trust_root
125
+ # in OpenID 1.x exchanges.
126
+ #
127
+ # The lits of acceptable options include :return_to, :session_key,
128
+ # :openid_param, :store, :immediate, :extensions.
129
+ #
130
+ # <tt>:return_to</tt> defines the url to return to after the client
131
+ # authenticates with the openid service provider. This url should point
132
+ # to where Rack::Auth::OpenID is mounted. If unprovided, the url of
133
+ # the current request is used.
134
+ #
135
+ # <tt>:session_key</tt> defines the key to the session hash in the env.
136
+ # The default is 'rack.session'.
137
+ #
138
+ # <tt>:openid_param</tt> defines at what key in the request parameters to
139
+ # find the identifier to resolve. As per the 2.0 spec, the default is
140
+ # 'openid_identifier'.
141
+ #
142
+ # <tt>:store</tt> defined what OpenID Store to use for persistant
143
+ # information. By default a Store::Memory is used.
144
+ #
145
+ # <tt>:immediate</tt> as true will make initial requests to be of an
146
+ # immediate type. This is false by default. See OpenID specification
147
+ # documentation.
148
+ #
149
+ # <tt>:extensions</tt> should be a hash of openid extension
150
+ # implementations. The key should be the extension module, the value
151
+ # should be an array of arguments for extension::Request.new().
152
+ # The hash is iterated over and passed to #add_extension for processing.
153
+ # Please see #add_extension for further documentation.
154
+
155
+ def initialize(realm, options={})
156
+ realm = URI(realm)
157
+ raise ArgumentError, "Invalid realm: #{realm}" \
158
+ unless realm.absolute? \
159
+ and realm.fragment.nil? \
160
+ and realm.scheme =~ /^https?$/ \
161
+ and realm.host =~ /^(\*\.)?#{URI::REGEXP::PATTERN::URIC_NO_SLASH}+/
162
+ realm.path = '/' if realm.path.empty?
163
+ @realm = realm.to_s
164
+
165
+ if ruri = options[:return_to]
166
+ ruri = URI(ruri)
167
+ raise ArgumentError, "Invalid return_to: #{ruri}" \
168
+ unless ruri.absolute? \
169
+ and ruri.scheme =~ /^https?$/ \
170
+ and ruri.fragment.nil?
171
+ raise ArgumentError, "return_to #{ruri} not within realm #{realm}" \
172
+ unless self.within_realm?(ruri)
173
+ @return_to = ruri.to_s
174
+ end
175
+
176
+ @session_key = options[:session_key] || 'rack.session'
177
+ @openid_param = options[:openid_param] || 'openid_identifier'
178
+ @store = options[:store] || ::OpenID::Store::Memory.new
179
+ @immediate = !!options[:immediate]
180
+
181
+ @extensions = {}
182
+ if extensions = options[:extensions]
183
+ extensions.each do |ext, args|
184
+ add_extension(ext, *args)
185
+ end
186
+ end
187
+
188
+ # Undocumented, semi-experimental
189
+ @anonymous = !!options[:anonymous]
190
+ end
191
+
192
+ attr_reader :realm, :return_to, :session_key, :openid_param, :store,
193
+ :immediate, :extensions
194
+
195
+ # Sets up and uses session data at <tt>:openid</tt> within the session.
196
+ # Errors in this setup will raise a NoSession exception.
197
+ #
198
+ # If the parameter 'openid.mode' is set, which implies a followup from
199
+ # the openid server, processing is passed to #finish and the result is
200
+ # returned. However, if there is no appropriate openid information in the
201
+ # session, a 400 error is returned.
202
+ #
203
+ # If the parameter specified by <tt>options[:openid_param]</tt> is
204
+ # present, processing is passed to #check and the result is returned.
205
+ #
206
+ # If neither of these conditions are met, #bad_request is called.
207
+
208
+ def call(env)
209
+ env['rack.auth.openid'] = self
210
+ env_session = env[@session_key]
211
+ unless env_session and env_session.is_a?(Hash)
212
+ raise NoSession, 'No compatible session.'
213
+ end
214
+ # let us work in our own namespace...
215
+ session = (env_session[:openid] ||= {})
216
+ unless session and session.is_a?(Hash)
217
+ raise NoSession, 'Incompatible openid session.'
218
+ end
219
+
220
+ request = Rack::Request.new(env)
221
+ consumer = ::OpenID::Consumer.new(session, @store)
222
+
223
+ if mode = request.GET['openid.mode']
224
+ finish(consumer, session, request)
225
+ elsif request.GET[@openid_param]
226
+ check(consumer, session, request)
227
+ else
228
+ bad_request
229
+ end
230
+ end
231
+
232
+ # As the first part of OpenID consumer action, #check retrieves the data
233
+ # required for completion.
234
+ #
235
+ # If all parameters fit within the max length of a URI, a 303 redirect
236
+ # will be returned. Otherwise #confirm_post_params will be called.
237
+ #
238
+ # Any messages from OpenID's request are logged to env['rack.errors']
239
+ #
240
+ # <tt>env['rack.auth.openid.request']</tt> is the openid checkid request
241
+ # instance.
242
+ #
243
+ # <tt>session[:openid_param]</tt> is set to the openid identifier
244
+ # provided by the user.
245
+ #
246
+ # <tt>session[:return_to]</tt> is set to the return_to uri given to the
247
+ # identity provider.
248
+
249
+ def check(consumer, session, req)
250
+ oid = consumer.begin(req.GET[@openid_param], @anonymous)
251
+ req.env['rack.auth.openid.request'] = oid
252
+ req.env['rack.errors'].puts(oid.message)
253
+ p oid if $DEBUG
254
+
255
+ ## Extension support
256
+ extensions.each do |ext,args|
257
+ oid.add_extension(ext::Request.new(*args))
258
+ end
259
+
260
+ session[:openid_param] = req.GET[openid_param]
261
+ return_to_uri = return_to ? return_to : req.url
262
+ session[:return_to] = return_to_uri
263
+ immediate = session.key?(:setup_needed) ? false : immediate
264
+
265
+ if oid.send_redirect?(realm, return_to_uri, immediate)
266
+ redirect(oid.redirect_url(realm, return_to_uri, immediate))
267
+ else
268
+ confirm_post_params(oid, realm, return_to_uri, immediate)
269
+ end
270
+ rescue ::OpenID::DiscoveryFailure => e
271
+ # thrown from inside OpenID::Consumer#begin by yadis stuff
272
+ req.env['rack.errors'].puts( [e.message, *e.backtrace]*"\n" )
273
+ return foreign_server_failure
274
+ end
275
+
276
+ # This is the final portion of authentication.
277
+ # If successful, a redirect to the realm is be returned.
278
+ # Data gathered from extensions are stored in session[:openid] with the
279
+ # extension's namespace uri as the key.
280
+ #
281
+ # Any messages from OpenID's response are logged to env['rack.errors']
282
+ #
283
+ # <tt>env['rack.auth.openid.response']</tt> will contain the openid
284
+ # response.
285
+
286
+ def finish(consumer, session, req)
287
+ oid = consumer.complete(req.GET, req.url)
288
+ req.env['rack.auth.openid.response'] = oid
289
+ req.env['rack.errors'].puts(oid.message)
290
+ p oid if $DEBUG
291
+
292
+ if ValidStatus.include?(oid.status)
293
+ __send__(oid.status, oid, req, session)
294
+ else
295
+ invalid_status(oid, req, session)
296
+ end
297
+ end
298
+
299
+ # The first argument should be the main extension module.
300
+ # The extension module should contain the constants:
301
+ # * class Request, should have OpenID::Extension as an ancestor
302
+ # * class Response, should have OpenID::Extension as an ancestor
303
+ # * string NS_URI, which defining the namespace of the extension
304
+ #
305
+ # All trailing arguments will be passed to extension::Request.new in
306
+ # #check.
307
+ # The openid response will be passed to
308
+ # extension::Response#from_success_response, oid#get_extension_args will
309
+ # be called on the result to attain the gathered data.
310
+ #
311
+ # This method returns the key at which the response data will be found in
312
+ # the session, which is the namespace uri by default.
313
+
314
+ def add_extension(ext, *args)
315
+ raise BadExtension unless valid_extension?(ext)
316
+ extensions[ext] = args
317
+ return ext::NS_URI
318
+ end
319
+
320
+ # Checks the validitity, in the context of usage, of a submitted
321
+ # extension.
322
+
323
+ def valid_extension?(ext)
324
+ if not %w[NS_URI Request Response].all?{|c| ext.const_defined?(c) }
325
+ raise ArgumentError, 'Extension is missing constants.'
326
+ elsif not ext::Response.respond_to?(:from_success_response)
327
+ raise ArgumentError, 'Response is missing required method.'
328
+ end
329
+ return true
330
+ rescue
331
+ return false
332
+ end
333
+
334
+ # Checks the provided uri to ensure it'd be considered within the realm.
335
+ # is currently not compatible with wildcard realms.
336
+
337
+ def within_realm? uri
338
+ uri = URI.parse(uri.to_s)
339
+ realm = URI.parse(self.realm)
340
+ return false unless uri.absolute?
341
+ return false unless uri.path[0, realm.path.size] == realm.path
342
+ return false unless uri.host == realm.host or realm.host[/^\*\./]
343
+ # for wildcard support, is awkward with URI limitations
344
+ realm_match = Regexp.escape(realm.host).
345
+ sub(/^\*\./,"^#{URI::REGEXP::PATTERN::URIC_NO_SLASH}+.")+'$'
346
+ return false unless uri.host.match(realm_match)
347
+ return true
348
+ end
349
+
350
+ alias_method :include?, :within_realm?
351
+
352
+ protected
353
+
354
+ # Returns an html form page for posting to an Identity Provider if the
355
+ # GET request would exceed the upper URI length limit.
356
+
357
+ def confirm_post_params(oid, realm, return_to, immediate)
358
+ response = Rack::Response.new '<html>'+
359
+ '<head><title>Confirm...</title></head>'+
360
+ '<body>'+oid.form_markup(realm, return_to, immediate)+'</body>'+
361
+ '</html>'
362
+ response.finish
363
+ end
364
+
365
+ # Returns a 303 redirect with the destination of that provided by the
366
+ # argument.
367
+
368
+ def redirect(uri)
369
+ [ 303, {'Content-Type'=>'text/plain', 'Content-Length'=>'0',
370
+ 'Location' => uri},
371
+ [] ]
372
+ end
373
+
374
+ # Returns an empty 400 response.
375
+
376
+ def bad_request
377
+ [ 400, {'Content-Type'=>'text/plain', 'Content-Length'=>'0'},
378
+ [''] ]
379
+ end
380
+
381
+ # Returns a basic unauthorized 401 response.
382
+
383
+ def unauthorized
384
+ [ 401, {'Content-Type' => 'text/plain', 'Content-Length' => '13'},
385
+ ['Unauthorized.'] ]
386
+ end
387
+
388
+ # Returns a basic access denied 403 response.
389
+
390
+ def access_denied
391
+ [ 403, {'Content-Type' => 'text/plain', 'Content-Length' => '14'},
392
+ ['Access denied.'] ]
393
+ end
394
+
395
+ # Returns a 503 response to be used if communication with the remote
396
+ # OpenID server fails.
397
+
398
+ def foreign_server_failure
399
+ [ 503, {'Content-Type'=>'text/plain', 'Content-Length' => '23'},
400
+ ['Foreign server failure.'] ]
401
+ end
402
+
403
+ private
404
+
405
+ # Called to complete processing on a successful transaction.
406
+ # Within the openid session, :openid_identity and :openid_identifier are
407
+ # set to the user friendly and the standard representation of the
408
+ # validated identity. All other data in the openid session is cleared.
409
+
410
+ def success(oid, request, session)
411
+ session.clear
412
+ session[:openid_identity] = oid.display_identifier
413
+ session[:openid_identifier] = oid.identity_url
414
+ extensions.keys.each do |ext|
415
+ label = ext.name[/[^:]+$/].downcase
416
+ response = ext::Response.from_success_response(oid)
417
+ session[label] = response.data
418
+ end
419
+ redirect(realm)
420
+ end
421
+
422
+ # Called if the Identity Provider indicates further setup by the user is
423
+ # required.
424
+ # The identifier is retrived from the openid session at :openid_param.
425
+ # And :setup_needed is set to true to prevent looping.
426
+
427
+ def setup_needed(oid, request, session)
428
+ identifier = session[:openid_param]
429
+ session[:setup_needed] = true
430
+ redirect(req.script_name + '?' + openid_param + '=' + identifier)
431
+ end
432
+
433
+ # Called if the user indicates they wish to cancel identification.
434
+ # Data within openid session is cleared.
435
+
436
+ def cancel(oid, request, session)
437
+ session.clear
438
+ access_denied
439
+ end
440
+
441
+ # Called if the Identity Provider indicates the user is unable to confirm
442
+ # their identity. Data within the openid session is left alone, in case
443
+ # of swarm auth attacks.
444
+
445
+ def failure(oid, request, session)
446
+ unauthorized
447
+ end
448
+
449
+ # To be called if there is no method for handling the OpenID response
450
+ # status.
451
+
452
+ def invalid_status(oid, request, session)
453
+ msg = 'Invalid status returned by the OpenID authorization reponse.'
454
+ [ 500,
455
+ {'Content-Type'=>'text/plain','Content-Length'=>msg.length.to_s},
456
+ [msg] ]
457
+ end
458
+ end
459
+
460
+ # A class developed out of the request to use OpenID as an authentication
461
+ # middleware. The request will be sent to the OpenID instance unless the
462
+ # block evaluates to true. For example in rackup, you can use it as such:
463
+ #
464
+ # use Rack::Session::Pool
465
+ # use Rack::Auth::OpenIDAuth, realm, openid_options do |env|
466
+ # env['rack.session'][:authkey] == a_string
467
+ # end
468
+ # run RackApp
469
+ #
470
+ # Or simply:
471
+ #
472
+ # app = Rack::Auth::OpenIDAuth.new app, realm, openid_options, &auth
473
+
474
+ class OpenIDAuth < Rack::Auth::AbstractHandler
475
+ attr_reader :oid
476
+ def initialize(app, realm, options={}, &auth)
477
+ @oid = OpenID.new(realm, options)
478
+ super(app, &auth)
479
+ end
480
+
481
+ def call(env)
482
+ to = @authenticator.call(env) ? @app : @oid
483
+ to.call(env)
484
+ end
485
+ end
486
+ end
487
+ end