typus 0.9.39 → 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (424) hide show
  1. data/CHANGELOG +104 -0
  2. data/Gemfile +17 -0
  3. data/Gemfile.lock +96 -0
  4. data/MIT-LICENSE +1 -1
  5. data/README.rdoc +45 -0
  6. data/Rakefile +19 -48
  7. data/app/controllers/admin/account_controller.rb +54 -0
  8. data/app/controllers/admin/dashboard_controller.rb +7 -0
  9. data/app/controllers/admin/resource_controller.rb +8 -0
  10. data/app/controllers/admin/resources_controller.rb +307 -0
  11. data/app/controllers/admin/session_controller.rb +38 -0
  12. data/app/controllers/admin_controller.rb +26 -0
  13. data/app/helpers/admin/dashboard_helper.rb +38 -0
  14. data/app/helpers/admin/filters_helper.rb +81 -0
  15. data/app/helpers/admin/form_helper.rb +68 -261
  16. data/app/helpers/admin/preview_helper.rb +48 -0
  17. data/app/helpers/admin/relationships_helper.rb +192 -0
  18. data/app/helpers/admin/resources_helper.rb +80 -0
  19. data/app/helpers/admin/search_helper.rb +19 -0
  20. data/app/helpers/admin/sidebar_helper.rb +32 -210
  21. data/app/helpers/admin/table_helper.rb +207 -200
  22. data/app/helpers/admin_helper.rb +56 -0
  23. data/app/mailers/admin/mailer.rb +13 -0
  24. data/app/models/admin/fake_user.rb +38 -0
  25. data/app/views/admin/account/forgot_password.html.erb +21 -0
  26. data/app/views/admin/account/new.html.erb +21 -0
  27. data/app/views/admin/dashboard/_sidebar.html.erb +3 -3
  28. data/app/views/admin/dashboard/show.html.erb +16 -0
  29. data/app/views/admin/dashboard/styles.html.erb +154 -0
  30. data/app/views/admin/helpers/_apps.html.erb +6 -0
  31. data/app/views/admin/helpers/_flash_message.html.erb +3 -0
  32. data/app/views/admin/helpers/_header.html.erb +7 -0
  33. data/app/views/admin/helpers/_login_info.html.erb +4 -0
  34. data/app/views/admin/helpers/_preview.html.erb +13 -0
  35. data/app/views/admin/helpers/dashboard/_applications.html.erb +32 -0
  36. data/app/views/admin/helpers/dashboard/_resources.html.erb +16 -0
  37. data/app/views/admin/helpers/filters/_filters.html.erb +31 -0
  38. data/app/views/admin/helpers/resources/_display_link_to_previous.html.erb +3 -0
  39. data/app/views/admin/helpers/resources/_pagination.html.erb +28 -0
  40. data/app/views/admin/helpers/search/_search.html.erb +12 -0
  41. data/app/views/admin/helpers/sidebar/_sidebar.html.erb +17 -0
  42. data/app/views/admin/helpers/table/_table.html.erb +22 -0
  43. data/app/views/{typus_mailer/reset_password_link.erb → admin/mailer/reset_password_link.text.erb} +2 -2
  44. data/{test/config/broken/empty.yml → app/views/admin/resources/_edit.html.erb} +0 -0
  45. data/app/views/admin/resources/_form.html.erb +26 -0
  46. data/{test/config/broken/empty_roles.yml → app/views/admin/resources/_index.html.erb} +0 -0
  47. data/{test/config/empty/empty_01.yml → app/views/admin/resources/_new.html.erb} +0 -0
  48. data/{test/config/empty/empty_01_roles.yml → app/views/admin/resources/_show.html.erb} +0 -0
  49. data/app/views/admin/resources/edit.html.erb +23 -21
  50. data/app/views/admin/resources/index.html.erb +31 -18
  51. data/app/views/admin/resources/new.html.erb +20 -18
  52. data/app/views/admin/resources/show.html.erb +29 -20
  53. data/app/views/admin/session/new.html.erb +26 -0
  54. data/app/views/admin/templates/_belongs_to.html.erb +4 -0
  55. data/app/views/admin/templates/_boolean.html.erb +4 -8
  56. data/app/views/admin/templates/_date.html.erb +9 -2
  57. data/app/views/admin/templates/_datetime.html.erb +9 -2
  58. data/app/views/admin/templates/_file.html.erb +20 -5
  59. data/app/views/admin/templates/_has_many.html.erb +24 -0
  60. data/app/views/admin/templates/_has_n.html.erb +17 -0
  61. data/{test/config/empty/empty_02.yml → app/views/admin/templates/_has_one.html.erb} +0 -0
  62. data/app/views/admin/templates/_password.html.erb +4 -2
  63. data/app/views/admin/templates/_relate_form.html.erb +4 -0
  64. data/app/views/admin/templates/_selector.html.erb +6 -18
  65. data/app/views/admin/templates/_string.html.erb +11 -10
  66. data/app/views/admin/templates/_text.html.erb +9 -2
  67. data/app/views/admin/templates/_time.html.erb +9 -2
  68. data/app/views/admin/templates/_tree.html.erb +4 -0
  69. data/app/views/layouts/admin/session.html.erb +44 -0
  70. data/app/views/layouts/admin.html.erb +45 -39
  71. data/config/available_locales/ca.yml +124 -0
  72. data/config/available_locales/ca_models.yml +16 -0
  73. data/config/{locales → available_locales}/de.yml +108 -89
  74. data/config/available_locales/de_models.yml +13 -0
  75. data/config/available_locales/es.yml +124 -0
  76. data/config/available_locales/es_models.yml +13 -0
  77. data/config/available_locales/fr.yml +124 -0
  78. data/config/available_locales/fr_models.yml +13 -0
  79. data/config/available_locales/hu.yml +124 -0
  80. data/config/available_locales/hu_models.yml +13 -0
  81. data/config/available_locales/it.yml +136 -0
  82. data/config/available_locales/it_models.yml +15 -0
  83. data/config/available_locales/language.yml.template +122 -0
  84. data/config/available_locales/language_models.yml.template +13 -0
  85. data/config/{locales → available_locales}/pt-BR.yml +97 -74
  86. data/config/available_locales/pt-BR_models.yml +13 -0
  87. data/config/{locales → available_locales}/ru.yml +107 -85
  88. data/config/available_locales/ru_models.yml +13 -0
  89. data/config/routes.rb +18 -11
  90. data/lib/generators/templates/config/initializers/typus.rb +26 -0
  91. data/lib/generators/templates/config/initializers/typus_authentication.rb +18 -0
  92. data/lib/generators/templates/config/initializers/typus_resources.rb +30 -0
  93. data/{generators/typus → lib/generators}/templates/config/typus/README +34 -16
  94. data/lib/generators/templates/config/typus/application.yml +5 -0
  95. data/lib/generators/templates/config/typus/application_roles.yml +6 -0
  96. data/lib/generators/templates/config/typus/typus.yml +17 -0
  97. data/lib/generators/templates/config/typus/typus_roles.yml +6 -0
  98. data/lib/generators/templates/controller.rb +4 -0
  99. data/lib/generators/templates/functional_test.rb +21 -0
  100. data/{generators/typus/templates/db/create_typus_users.rb → lib/generators/templates/migration.rb} +4 -4
  101. data/lib/generators/templates/model.rb +8 -0
  102. data/lib/generators/templates/model.yml +10 -0
  103. data/{generators/typus/templates/public/images/admin → lib/generators/templates/public/admin/images}/ui-icons.png +0 -0
  104. data/lib/generators/templates/public/admin/javascripts/application.js +6 -0
  105. data/lib/generators/templates/public/admin/javascripts/jquery-1.4.2.min.js +154 -0
  106. data/lib/generators/templates/public/admin/javascripts/jquery.rails.js +126 -0
  107. data/lib/generators/templates/public/admin/javascripts/jquery.searchField.js +91 -0
  108. data/lib/generators/templates/public/admin/stylesheets/application.css +11 -0
  109. data/lib/generators/templates/public/admin/stylesheets/screen.css +356 -0
  110. data/lib/generators/templates/public/admin/vendor/fancybox/blank.gif +0 -0
  111. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_close.png +0 -0
  112. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_loading.png +0 -0
  113. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_left.png +0 -0
  114. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_right.png +0 -0
  115. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_e.png +0 -0
  116. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_n.png +0 -0
  117. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_ne.png +0 -0
  118. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_nw.png +0 -0
  119. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_s.png +0 -0
  120. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_se.png +0 -0
  121. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_sw.png +0 -0
  122. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_w.png +0 -0
  123. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_left.png +0 -0
  124. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_main.png +0 -0
  125. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_over.png +0 -0
  126. data/{generators/typus/templates/public/images/admin → lib/generators/templates/public/admin/vendor}/fancybox/fancy_title_right.png +0 -0
  127. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-x.png +0 -0
  128. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-y.png +0 -0
  129. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox.png +0 -0
  130. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.easing-1.3.pack.js +72 -0
  131. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.css +363 -0
  132. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.js +1077 -0
  133. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.pack.js +44 -0
  134. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.mousewheel-3.0.2.pack.js +13 -0
  135. data/lib/generators/templates/view.html.erb +9 -0
  136. data/lib/generators/typus/migration_generator.rb +85 -0
  137. data/lib/generators/typus/typus_generator.rb +190 -0
  138. data/lib/generators/typus/views_generator.rb +27 -0
  139. data/lib/support/active_record.rb +60 -0
  140. data/lib/support/array.rb +13 -0
  141. data/lib/{typus → support}/hash.rb +2 -2
  142. data/lib/{typus → support}/object.rb +2 -2
  143. data/lib/support/string.rb +47 -0
  144. data/lib/tasks/typus.rake +19 -0
  145. data/lib/typus/authentication.rb +146 -40
  146. data/lib/typus/configuration.rb +14 -49
  147. data/lib/typus/engine.rb +6 -0
  148. data/lib/typus/format.rb +41 -18
  149. data/lib/typus/orm/active_record.rb +378 -0
  150. data/lib/typus/resources.rb +57 -0
  151. data/lib/typus/user.rb +54 -37
  152. data/lib/typus/version.rb +3 -0
  153. data/lib/typus.rb +118 -80
  154. data/lib/vendor/paginator.rb +2 -2
  155. data/test/factories/assets.rb +5 -0
  156. data/test/factories/categories.rb +3 -0
  157. data/test/factories/comments.rb +6 -0
  158. data/test/factories/pages.rb +5 -0
  159. data/test/factories/pictures.rb +7 -0
  160. data/test/factories/posts.rb +6 -0
  161. data/test/factories/typus_users.rb +8 -0
  162. data/test/{config → fixtures/config}/broken/application.yml +0 -0
  163. data/test/{config → fixtures/config}/broken/application_roles.yml +0 -0
  164. data/test/{config/empty/empty_02_roles.yml → fixtures/config/broken/empty.yml} +0 -0
  165. data/test/fixtures/config/broken/empty_roles.yml +0 -0
  166. data/test/{config → fixtures/config}/broken/undefined.yml +0 -0
  167. data/test/{config → fixtures/config}/broken/undefined_roles.yml +0 -0
  168. data/test/{config → fixtures/config}/default/typus.yml +2 -1
  169. data/{generators/typus/templates/config/typus → test/fixtures/config/default}/typus_roles.yml +0 -0
  170. data/test/fixtures/config/empty/empty_01.yml +0 -0
  171. data/test/fixtures/config/empty/empty_01_roles.yml +0 -0
  172. data/test/fixtures/config/empty/empty_02.yml +0 -0
  173. data/test/fixtures/config/empty/empty_02_roles.yml +0 -0
  174. data/test/{config → fixtures/config}/locales/es.yml +0 -0
  175. data/test/fixtures/config/namespaced/application.yml +5 -0
  176. data/test/fixtures/config/namespaced/application_roles.yml +2 -0
  177. data/test/{config → fixtures/config}/ordered/001_roles.yml +0 -0
  178. data/test/{config → fixtures/config}/ordered/002_roles.yml +0 -0
  179. data/test/{config → fixtures/config}/unordered/app_one_roles.yml +0 -0
  180. data/test/{config → fixtures/config}/unordered/app_two_roles.yml +0 -0
  181. data/test/fixtures/config/working/application.yml +73 -0
  182. data/test/fixtures/config/working/application_roles.yml +24 -0
  183. data/{generators/typus/templates/config/typus → test/fixtures/config/working}/typus.yml +2 -1
  184. data/test/{config/default → fixtures/config/working}/typus_roles.yml +0 -0
  185. data/test/fixtures/rails_app/README +244 -0
  186. data/test/fixtures/rails_app/Rakefile +7 -0
  187. data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +2 -0
  188. data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +2 -0
  189. data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +2 -0
  190. data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +2 -0
  191. data/test/fixtures/rails_app/app/controllers/admin/pictures_controller.rb +2 -0
  192. data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +2 -0
  193. data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +2 -0
  194. data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +2 -0
  195. data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +2 -0
  196. data/test/fixtures/rails_app/app/controllers/application_controller.rb +4 -0
  197. data/test/fixtures/rails_app/app/helpers/application_helper.rb +2 -0
  198. data/test/fixtures/{app → rails_app/app}/models/asset.rb +1 -1
  199. data/test/fixtures/{app → rails_app/app}/models/category.rb +2 -2
  200. data/test/fixtures/{app → rails_app/app}/models/comment.rb +1 -1
  201. data/test/fixtures/{app → rails_app/app}/models/custom_user.rb +1 -1
  202. data/test/fixtures/{app → rails_app/app}/models/delayed/task.rb +2 -2
  203. data/test/fixtures/rails_app/app/models/page.rb +9 -0
  204. data/test/fixtures/rails_app/app/models/picture.rb +6 -0
  205. data/test/fixtures/{app → rails_app/app}/models/post.rb +6 -6
  206. data/test/fixtures/rails_app/app/models/typus_user.rb +8 -0
  207. data/test/fixtures/{app → rails_app/app}/models/view.rb +1 -1
  208. data/test/fixtures/rails_app/app/views/admin/categories/_form.html.erb +1 -0
  209. data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +1 -0
  210. data/test/fixtures/rails_app/app/views/admin/mailer/reset_password_link.text.erb +6 -0
  211. data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +1 -0
  212. data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +1 -0
  213. data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +1 -0
  214. data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +1 -0
  215. data/test/fixtures/rails_app/app/views/admin/posts/_sidebar.html.erb +1 -0
  216. data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +1 -0
  217. data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +1 -0
  218. data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +1 -0
  219. data/test/fixtures/rails_app/app/views/layouts/application.html.erb +14 -0
  220. data/test/fixtures/rails_app/config/application.rb +50 -0
  221. data/test/fixtures/rails_app/config/boot.rb +13 -0
  222. data/test/fixtures/rails_app/config/database.yml +22 -0
  223. data/test/fixtures/rails_app/config/environment.rb +5 -0
  224. data/test/fixtures/rails_app/config/environments/development.rb +19 -0
  225. data/test/fixtures/rails_app/config/environments/production.rb +42 -0
  226. data/test/fixtures/rails_app/config/environments/test.rb +34 -0
  227. data/test/fixtures/rails_app/config/initializers/acts_as_list.rb +258 -0
  228. data/test/fixtures/rails_app/config/initializers/acts_as_tree.rb +98 -0
  229. data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  230. data/test/fixtures/rails_app/config/initializers/inflections.rb +10 -0
  231. data/test/fixtures/rails_app/config/initializers/mime_types.rb +5 -0
  232. data/test/fixtures/rails_app/config/initializers/secret_token.rb +7 -0
  233. data/test/fixtures/rails_app/config/initializers/session_store.rb +8 -0
  234. data/test/fixtures/rails_app/config/initializers/typus.rb +6 -0
  235. data/test/fixtures/rails_app/config/locales/en.yml +5 -0
  236. data/test/fixtures/rails_app/config/routes.rb +8 -0
  237. data/test/{config/working → fixtures/rails_app/config/typus}/application.yml +11 -9
  238. data/test/{config/working → fixtures/rails_app/config/typus}/application_roles.yml +0 -0
  239. data/{generators/typus_update_schema_to_01/templates/config → test/fixtures/rails_app/config/typus}/typus.yml +0 -0
  240. data/test/{config/working → fixtures/rails_app/config/typus}/typus_roles.yml +0 -0
  241. data/test/fixtures/rails_app/config.ru +4 -0
  242. data/test/fixtures/rails_app/db/seeds.rb +7 -0
  243. data/test/fixtures/rails_app/db/test.sqlite3 +0 -0
  244. data/test/fixtures/rails_app/log/test.log +4268 -0
  245. data/test/fixtures/rails_app/public/404.html +26 -0
  246. data/test/fixtures/rails_app/public/422.html +26 -0
  247. data/test/fixtures/rails_app/public/500.html +26 -0
  248. data/test/fixtures/rails_app/public/favicon.ico +0 -0
  249. data/test/fixtures/rails_app/public/images/rails.png +0 -0
  250. data/test/fixtures/rails_app/public/index.html +279 -0
  251. data/test/fixtures/rails_app/public/javascripts/application.js +2 -0
  252. data/test/fixtures/rails_app/public/javascripts/controls.js +965 -0
  253. data/test/fixtures/rails_app/public/javascripts/dragdrop.js +974 -0
  254. data/test/fixtures/rails_app/public/javascripts/effects.js +1123 -0
  255. data/test/fixtures/rails_app/public/javascripts/prototype.js +4874 -0
  256. data/test/fixtures/rails_app/public/javascripts/rails.js +118 -0
  257. data/test/fixtures/rails_app/public/robots.txt +5 -0
  258. data/test/fixtures/rails_app/script/rails +9 -0
  259. data/test/fixtures/rails_app/tmp/export-posts-20100902120447.csv +2 -0
  260. data/test/fixtures/rails_app/tmp/export-posts-20100902120700.csv +2 -0
  261. data/test/functional/admin/account_controller_test.rb +90 -0
  262. data/test/functional/admin/dashboard_controller_http_basic_test.rb +24 -0
  263. data/test/functional/admin/dashboard_controller_none_test.rb +18 -0
  264. data/test/functional/admin/dashboard_controller_test.rb +106 -0
  265. data/test/functional/admin/resources_controller_assets_relationships.rb +59 -0
  266. data/test/functional/admin/resources_controller_categories_before_test.rb +10 -0
  267. data/test/functional/admin/resources_controller_categories_lists_test.rb +44 -0
  268. data/test/functional/admin/resources_controller_categories_views_test.rb +10 -0
  269. data/test/functional/admin/resources_controller_comments_toggle_test.rb +21 -0
  270. data/test/functional/admin/{master_controller_posts_before_test.rb → resources_controller_posts_before_test.rb} +3 -3
  271. data/test/functional/admin/resources_controller_posts_crud_custom_test.rb +27 -0
  272. data/test/functional/admin/resources_controller_posts_crud_test.rb +44 -0
  273. data/test/functional/admin/resources_controller_posts_formats_test.rb +39 -0
  274. data/test/functional/admin/resources_controller_posts_forms_test.rb +58 -0
  275. data/test/functional/admin/resources_controller_posts_permissions_test.rb +100 -0
  276. data/test/functional/admin/{master_controller_posts_relationships_test.rb → resources_controller_posts_relationships_test.rb} +25 -20
  277. data/test/functional/admin/resources_controller_posts_roles.rb +52 -0
  278. data/test/functional/admin/resources_controller_posts_views_test.rb +143 -0
  279. data/test/functional/admin/resources_controller_tableless_resource_test.rb +51 -0
  280. data/test/functional/admin/resources_controller_typus_users_test.rb +159 -0
  281. data/test/functional/admin/session_controller_test.rb +85 -0
  282. data/test/helpers/admin/dashboard_helper_test.rb +42 -0
  283. data/test/helpers/admin/form_helper_test.rb +52 -276
  284. data/test/helpers/admin/resources_helper_test.rb +52 -0
  285. data/test/helpers/admin/sidebar_helper_test.rb +133 -224
  286. data/test/helpers/admin/table_helper_test.rb +136 -144
  287. data/test/helpers/admin_helper_test.rb +69 -0
  288. data/test/lib/support/active_record_test.rb +35 -0
  289. data/test/lib/support/array_test.rb +15 -0
  290. data/test/lib/support/hash_test.rb +11 -0
  291. data/test/lib/support/string_test.rb +48 -0
  292. data/test/lib/typus/active_record_test.rb +385 -0
  293. data/test/lib/typus/configuration_test.rb +52 -0
  294. data/test/lib/typus/resource_test.rb +17 -0
  295. data/test/lib/typus/routes_test.rb +29 -0
  296. data/test/lib/typus_test.rb +72 -40
  297. data/test/{vendor → lib/vendor}/paginator_test.rb +7 -4
  298. data/test/schema.rb +28 -3
  299. data/test/test_helper.rb +29 -0
  300. data/test/unit/admin/mailer_test.rb +32 -0
  301. data/test/unit/typus_user_roles_test.rb +69 -61
  302. data/test/unit/typus_user_test.rb +56 -143
  303. data/typus.gemspec +18 -276
  304. metadata +305 -231
  305. data/.gitignore +0 -1
  306. data/AUTHORS.md +0 -34
  307. data/CHANGES +0 -3
  308. data/README.md +0 -75
  309. data/VERSION +0 -1
  310. data/app/controllers/admin/master_controller.rb +0 -394
  311. data/app/controllers/typus_controller.rb +0 -152
  312. data/app/helpers/admin/master_helper.rb +0 -104
  313. data/app/helpers/admin/public_helper.rb +0 -27
  314. data/app/helpers/typus_helper.rb +0 -181
  315. data/app/models/typus_mailer.rb +0 -14
  316. data/app/models/typus_user.rb +0 -5
  317. data/app/views/admin/shared/_feedback.html.erb +0 -6
  318. data/app/views/admin/shared/_footer.html.erb +0 -2
  319. data/app/views/admin/shared/_pagination.html.erb +0 -28
  320. data/app/views/admin/templates/_tiny_mce.html.erb +0 -2
  321. data/app/views/layouts/typus.html.erb +0 -29
  322. data/app/views/typus/dashboard.html.erb +0 -9
  323. data/app/views/typus/recover_password.html.erb +0 -7
  324. data/app/views/typus/reset_password.html.erb +0 -15
  325. data/app/views/typus/sign_in.html.erb +0 -9
  326. data/app/views/typus/sign_up.html.erb +0 -7
  327. data/config/locales/es.yml +0 -105
  328. data/config/locales/fr.yml +0 -98
  329. data/config/locales/language.yml.template +0 -106
  330. data/generators/typus/templates/auto/index.html.erb +0 -11
  331. data/generators/typus/templates/auto/resource_controller.rb.erb +0 -15
  332. data/generators/typus/templates/auto/resource_controller_test.rb.erb +0 -11
  333. data/generators/typus/templates/auto/resources_controller.rb.erb +0 -37
  334. data/generators/typus/templates/config/initializers/typus.rb +0 -34
  335. data/generators/typus/templates/config/typus/application.yml +0 -6
  336. data/generators/typus/templates/config/typus/application_roles.yml +0 -23
  337. data/generators/typus/templates/lib/tasks/typus_tasks.rake +0 -32
  338. data/generators/typus/templates/public/images/admin/fancybox/fancy_closebox.png +0 -0
  339. data/generators/typus/templates/public/images/admin/fancybox/fancy_left.png +0 -0
  340. data/generators/typus/templates/public/images/admin/fancybox/fancy_progress.png +0 -0
  341. data/generators/typus/templates/public/images/admin/fancybox/fancy_right.png +0 -0
  342. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_e.png +0 -0
  343. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_n.png +0 -0
  344. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_ne.png +0 -0
  345. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_nw.png +0 -0
  346. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_s.png +0 -0
  347. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_se.png +0 -0
  348. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_sw.png +0 -0
  349. data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_w.png +0 -0
  350. data/generators/typus/templates/public/images/admin/fancybox/fancy_title_left.png +0 -0
  351. data/generators/typus/templates/public/images/admin/fancybox/fancy_title_main.png +0 -0
  352. data/generators/typus/templates/public/javascripts/admin/application.js +0 -14
  353. data/generators/typus/templates/public/javascripts/admin/jquery-1.3.2.min.js +0 -19
  354. data/generators/typus/templates/public/javascripts/admin/jquery.fancybox-1.2.1.min.js +0 -9
  355. data/generators/typus/templates/public/stylesheets/admin/jquery.fancybox.css +0 -315
  356. data/generators/typus/templates/public/stylesheets/admin/reset.css +0 -68
  357. data/generators/typus/templates/public/stylesheets/admin/screen.css +0 -361
  358. data/generators/typus/typus_generator.rb +0 -191
  359. data/generators/typus_update_schema_to_01/templates/migration.rb +0 -11
  360. data/generators/typus_update_schema_to_01/typus_update_schema_to_01_generator.rb +0 -19
  361. data/generators/typus_update_schema_to_02/templates/migration.rb +0 -11
  362. data/generators/typus_update_schema_to_02/typus_update_schema_to_02_generator.rb +0 -11
  363. data/lib/typus/active_record.rb +0 -323
  364. data/lib/typus/extensions/routes.rb +0 -15
  365. data/lib/typus/extensions/routes_hack.rb +0 -15
  366. data/lib/typus/preferences.rb +0 -11
  367. data/lib/typus/preview.rb +0 -76
  368. data/lib/typus/quick_edit.rb +0 -40
  369. data/lib/typus/reloader.rb +0 -14
  370. data/lib/typus/string.rb +0 -27
  371. data/lib/vendor/active_record.rb +0 -15
  372. data/lib/vendor/rss_parser.rb +0 -20
  373. data/rails/init.rb +0 -3
  374. data/tasks/typus_tasks.rake +0 -32
  375. data/test/config/working/typus.yml +0 -12
  376. data/test/fixtures/app/controllers/admin/assets_controller.rb +0 -2
  377. data/test/fixtures/app/controllers/admin/categories_controller.rb +0 -2
  378. data/test/fixtures/app/controllers/admin/comments_controller.rb +0 -2
  379. data/test/fixtures/app/controllers/admin/pages_controller.rb +0 -2
  380. data/test/fixtures/app/controllers/admin/posts_controller.rb +0 -2
  381. data/test/fixtures/app/controllers/admin/status_controller.rb +0 -6
  382. data/test/fixtures/app/controllers/admin/typus_users_controller.rb +0 -2
  383. data/test/fixtures/app/controllers/admin/watch_dog_controller.rb +0 -6
  384. data/test/fixtures/app/models/page.rb +0 -5
  385. data/test/fixtures/app/views/admin/dashboard/_content.html.erb +0 -1
  386. data/test/fixtures/app/views/admin/dashboard/_sidebar.html.erb +0 -1
  387. data/test/fixtures/app/views/admin/posts/_edit.html.erb +0 -1
  388. data/test/fixtures/app/views/admin/posts/_index.html.erb +0 -1
  389. data/test/fixtures/app/views/admin/posts/_new.html.erb +0 -1
  390. data/test/fixtures/app/views/admin/posts/_show.html.erb +0 -1
  391. data/test/fixtures/app/views/admin/posts/_sidebar.html.erb +0 -1
  392. data/test/fixtures/app/views/admin/resources/_sidebar.html.erb +0 -1
  393. data/test/fixtures/app/views/admin/shared/_footer.html.erb +0 -1
  394. data/test/fixtures/app/views/admin/status/index.html.erb +0 -1
  395. data/test/fixtures/app/views/admin/templates/_datepicker.html.erb +0 -1
  396. data/test/fixtures/assets.yml +0 -11
  397. data/test/fixtures/categories.yml +0 -14
  398. data/test/fixtures/comments.yml +0 -27
  399. data/test/fixtures/pages.yml +0 -41
  400. data/test/fixtures/posts.yml +0 -37
  401. data/test/fixtures/typus_users.yml +0 -59
  402. data/test/functional/admin/master_controller_assets_relationships.rb +0 -66
  403. data/test/functional/admin/master_controller_categories_lists_test.rb +0 -64
  404. data/test/functional/admin/master_controller_posts_crud_test.rb +0 -97
  405. data/test/functional/admin/master_controller_posts_formats_test.rb +0 -53
  406. data/test/functional/admin/master_controller_posts_permissions_test.rb +0 -127
  407. data/test/functional/admin/master_controller_posts_roles.rb +0 -50
  408. data/test/functional/admin/master_controller_posts_toggle_test.rb +0 -35
  409. data/test/functional/admin/master_controller_posts_views_test.rb +0 -209
  410. data/test/functional/admin/master_controller_tableless_resource_test.rb +0 -36
  411. data/test/functional/admin/master_controller_typus_users_test.rb +0 -211
  412. data/test/functional/typus_controller_test.rb +0 -342
  413. data/test/helper.rb +0 -51
  414. data/test/helpers/admin/master_helper_test.rb +0 -70
  415. data/test/helpers/admin/public_helper_test.rb +0 -26
  416. data/test/helpers/typus_helper_test.rb +0 -96
  417. data/test/lib/active_record_test.rb +0 -377
  418. data/test/lib/configuration_test.rb +0 -95
  419. data/test/lib/hash_test.rb +0 -11
  420. data/test/lib/routes_test.rb +0 -71
  421. data/test/lib/string_test.rb +0 -55
  422. data/test/unit/typus_mailer_test.rb +0 -29
  423. data/test/unit/typus_test.rb +0 -17
  424. data/test/vendor/active_record_test.rb +0 -18
@@ -0,0 +1,244 @@
1
+ == Welcome to Rails
2
+
3
+ Rails is a web-application framework that includes everything needed to create
4
+ database-backed web applications according to the Model-View-Control pattern.
5
+
6
+ This pattern splits the view (also called the presentation) into "dumb" templates
7
+ that are primarily responsible for inserting pre-built data in between HTML tags.
8
+ The model contains the "smart" domain objects (such as Account, Product, Person,
9
+ Post) that holds all the business logic and knows how to persist themselves to
10
+ a database. The controller handles the incoming requests (such as Save New Account,
11
+ Update Product, Show Post) by manipulating the model and directing data to the view.
12
+
13
+ In Rails, the model is handled by what's called an object-relational mapping
14
+ layer entitled Active Record. This layer allows you to present the data from
15
+ database rows as objects and embellish these data objects with business logic
16
+ methods. You can read more about Active Record in
17
+ link:files/vendor/rails/activerecord/README.html.
18
+
19
+ The controller and view are handled by the Action Pack, which handles both
20
+ layers by its two parts: Action View and Action Controller. These two layers
21
+ are bundled in a single package due to their heavy interdependence. This is
22
+ unlike the relationship between the Active Record and Action Pack that is much
23
+ more separate. Each of these packages can be used independently outside of
24
+ Rails. You can read more about Action Pack in
25
+ link:files/vendor/rails/actionpack/README.html.
26
+
27
+
28
+ == Getting Started
29
+
30
+ 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31
+ and your application name. Ex: rails myapp
32
+ 2. Change directory into myapp and start the web server: <tt>rails server</tt> (run with --help for options)
33
+ 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34
+ 4. Follow the guidelines to start developing your application
35
+
36
+
37
+ == Web Servers
38
+
39
+ By default, Rails will try to use Mongrel if it's installed when started with <tt>rails server</tt>, otherwise
40
+ Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
41
+ with a variety of other web servers.
42
+
43
+ Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
44
+ suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
45
+ getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
46
+ More info at: http://mongrel.rubyforge.org
47
+
48
+ Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
49
+ Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
50
+ FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
51
+
52
+ == Apache .htaccess example for FCGI/CGI
53
+
54
+ # General Apache options
55
+ AddHandler fastcgi-script .fcgi
56
+ AddHandler cgi-script .cgi
57
+ Options +FollowSymLinks +ExecCGI
58
+
59
+ # If you don't want Rails to look in certain directories,
60
+ # use the following rewrite rules so that Apache won't rewrite certain requests
61
+ #
62
+ # Example:
63
+ # RewriteCond %{REQUEST_URI} ^/notrails.*
64
+ # RewriteRule .* - [L]
65
+
66
+ # Redirect all requests not available on the filesystem to Rails
67
+ # By default the cgi dispatcher is used which is very slow
68
+ #
69
+ # For better performance replace the dispatcher with the fastcgi one
70
+ #
71
+ # Example:
72
+ # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
73
+ RewriteEngine On
74
+
75
+ # If your Rails application is accessed via an Alias directive,
76
+ # then you MUST also set the RewriteBase in this htaccess file.
77
+ #
78
+ # Example:
79
+ # Alias /myrailsapp /path/to/myrailsapp/public
80
+ # RewriteBase /myrailsapp
81
+
82
+ RewriteRule ^$ index.html [QSA]
83
+ RewriteRule ^([^.]+)$ $1.html [QSA]
84
+ RewriteCond %{REQUEST_FILENAME} !-f
85
+ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
86
+
87
+ # In case Rails experiences terminal errors
88
+ # Instead of displaying this message you can supply a file here which will be rendered instead
89
+ #
90
+ # Example:
91
+ # ErrorDocument 500 /500.html
92
+
93
+ ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
94
+
95
+
96
+ == Debugging Rails
97
+
98
+ Sometimes your application goes wrong. Fortunately there are a lot of tools that
99
+ will help you debug it and get it back on the rails.
100
+
101
+ First area to check is the application log files. Have "tail -f" commands running
102
+ on the server.log and development.log. Rails will automatically display debugging
103
+ and runtime information to these files. Debugging info will also be shown in the
104
+ browser on requests from 127.0.0.1.
105
+
106
+ You can also log your own messages directly into the log file from your code using
107
+ the Ruby logger class from inside your controllers. Example:
108
+
109
+ class WeblogController < ActionController::Base
110
+ def destroy
111
+ @weblog = Weblog.find(params[:id])
112
+ @weblog.destroy
113
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
114
+ end
115
+ end
116
+
117
+ The result will be a message in your log file along the lines of:
118
+
119
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
120
+
121
+ More information on how to use the logger is at http://www.ruby-doc.org/core/
122
+
123
+ Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
124
+
125
+ * The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
126
+ * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
127
+
128
+ These two online (and free) books will bring you up to speed on the Ruby language
129
+ and also on programming in general.
130
+
131
+
132
+ == Debugger
133
+
134
+ Debugger support is available through the debugger command when you start your Mongrel or
135
+ Webrick server with --debugger. This means that you can break out of execution at any point
136
+ in the code, investigate and change the model, AND then resume execution!
137
+ You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
138
+ Example:
139
+
140
+ class WeblogController < ActionController::Base
141
+ def index
142
+ @posts = Post.find(:all)
143
+ debugger
144
+ end
145
+ end
146
+
147
+ So the controller will accept the action, run the first line, then present you
148
+ with a IRB prompt in the server window. Here you can do things like:
149
+
150
+ >> @posts.inspect
151
+ => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
152
+ #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
153
+ >> @posts.first.title = "hello from a debugger"
154
+ => "hello from a debugger"
155
+
156
+ ...and even better is that you can examine how your runtime objects actually work:
157
+
158
+ >> f = @posts.first
159
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
160
+ >> f.
161
+ Display all 152 possibilities? (y or n)
162
+
163
+ Finally, when you're ready to resume execution, you enter "cont"
164
+
165
+
166
+ == Console
167
+
168
+ You can interact with the domain model by starting the console through <tt>rails console</tt>.
169
+ Here you'll have all parts of the application configured, just like it is when the
170
+ application is running. You can inspect domain models, change values, and save to the
171
+ database. Starting the script without arguments will launch it in the development environment.
172
+ Passing an argument will specify a different environment, like <tt>rails console production</tt>.
173
+
174
+ To reload your controllers and models after launching the console run <tt>reload!</tt>
175
+
176
+ == dbconsole
177
+
178
+ You can go to the command line of your database directly through <tt>rails dbconsole</tt>.
179
+ You would be connected to the database with the credentials defined in database.yml.
180
+ Starting the script without arguments will connect you to the development database. Passing an
181
+ argument will connect you to a different database, like <tt>rails dbconsole production</tt>.
182
+ Currently works for mysql, postgresql and sqlite.
183
+
184
+ == Description of Contents
185
+
186
+ app
187
+ Holds all the code that's specific to this particular application.
188
+
189
+ app/controllers
190
+ Holds controllers that should be named like weblogs_controller.rb for
191
+ automated URL mapping. All controllers should descend from ApplicationController
192
+ which itself descends from ActionController::Base.
193
+
194
+ app/models
195
+ Holds models that should be named like post.rb.
196
+ Most models will descend from ActiveRecord::Base.
197
+
198
+ app/views
199
+ Holds the template files for the view that should be named like
200
+ weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
201
+ syntax.
202
+
203
+ app/views/layouts
204
+ Holds the template files for layouts to be used with views. This models the common
205
+ header/footer method of wrapping views. In your views, define a layout using the
206
+ <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
207
+ call <% yield %> to render the view using this layout.
208
+
209
+ app/helpers
210
+ Holds view helpers that should be named like weblogs_helper.rb. These are generated
211
+ for you automatically when using rails generate for controllers. Helpers can be used to
212
+ wrap functionality for your views into methods.
213
+
214
+ config
215
+ Configuration files for the Rails environment, the routing map, the database, and other dependencies.
216
+
217
+ db
218
+ Contains the database schema in schema.rb. db/migrate contains all
219
+ the sequence of Migrations for your schema.
220
+
221
+ doc
222
+ This directory is where your application documentation will be stored when generated
223
+ using <tt>rake doc:app</tt>
224
+
225
+ lib
226
+ Application specific libraries. Basically, any kind of custom code that doesn't
227
+ belong under controllers, models, or helpers. This directory is in the load path.
228
+
229
+ public
230
+ The directory available for the web server. Contains subdirectories for images, stylesheets,
231
+ and javascripts. Also contains the dispatchers and the default HTML files. This should be
232
+ set as the DOCUMENT_ROOT of your web server.
233
+
234
+ script
235
+ Helper scripts for automation and generation.
236
+
237
+ test
238
+ Unit and functional tests along with fixtures. When using the rails generate command, template
239
+ test files will be generated for you and placed in this directory.
240
+
241
+ vendor
242
+ External libraries that the application depends on. Also includes the plugins subdirectory.
243
+ If the app has frozen rails, those gems also go here, under vendor/rails/.
244
+ This directory is in the load path.
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Rails::Application.load_tasks
@@ -0,0 +1,2 @@
1
+ class Admin::AssetsController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::CategoriesController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::CommentsController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::PagesController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::PicturesController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::PostsController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::StatusController < Admin::ResourceController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::TypusUsersController < Admin::ResourcesController
2
+ end
@@ -0,0 +1,2 @@
1
+ class Admin::WatchDogController < Admin::ResourceController
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ layout 'application'
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -2,4 +2,4 @@ class Asset < ActiveRecord::Base
2
2
 
3
3
  belongs_to :resource, :polymorphic => true
4
4
 
5
- end
5
+ end
@@ -1,6 +1,6 @@
1
1
  class Category < ActiveRecord::Base
2
2
 
3
- acts_as_list if defined?(ActiveRecord::Acts::List)
3
+ acts_as_list
4
4
 
5
5
  validates_presence_of :name
6
6
  has_and_belongs_to_many :posts
@@ -8,4 +8,4 @@ class Category < ActiveRecord::Base
8
8
  def self.typus
9
9
  end
10
10
 
11
- end
11
+ end
@@ -3,4 +3,4 @@ class Comment < ActiveRecord::Base
3
3
  validates_presence_of :name, :email, :body
4
4
  belongs_to :post
5
5
 
6
- end
6
+ end
@@ -1,2 +1,2 @@
1
1
  class CustomUser < ActiveRecord::Base
2
- end
2
+ end
@@ -1,5 +1,5 @@
1
1
  class Delayed::Task < ActiveRecord::Base
2
2
 
3
- set_table_name 'delayed_tasks'
3
+ set_table_name "delayed_tasks"
4
4
 
5
- end
5
+ end
@@ -0,0 +1,9 @@
1
+ class Page < ActiveRecord::Base
2
+
3
+ acts_as_tree
4
+
5
+ STATUS = { "pending" => "Pending",
6
+ "published" => "Published",
7
+ "unpublished" => "Not Published" }
8
+
9
+ end
@@ -0,0 +1,6 @@
1
+ class Picture < ActiveRecord::Base
2
+ # simulate Paperclip
3
+ def self.attachment_definitions
4
+ {:picture => true}
5
+ end
6
+ end
@@ -5,17 +5,17 @@ class Post < ActiveRecord::Base
5
5
  has_many :assets, :as => :resource, :dependent => :destroy
6
6
  has_many :comments
7
7
  has_many :views
8
- belongs_to :favorite_comment, :class_name => 'Comment'
9
8
 
10
- def self.status
11
- %w( true false pending published unpublished )
12
- end
9
+ belongs_to :favorite_comment, :class_name => "Comment"
10
+ belongs_to :typus_user
11
+
12
+ STATUS = %w( pending published unpublished )
13
13
 
14
14
  def self.typus
15
- 'plugin'
15
+ "plugin"
16
16
  end
17
17
 
18
18
  def asset_file_name
19
19
  end
20
20
 
21
- end
21
+ end
@@ -0,0 +1,8 @@
1
+ class TypusUser < ActiveRecord::Base
2
+
3
+ ROLE = Typus::Configuration.roles.keys.sort
4
+ LANGUAGE = Typus.locales
5
+
6
+ enable_as_typus_user
7
+
8
+ end
@@ -2,4 +2,4 @@ class View < ActiveRecord::Base
2
2
 
3
3
  belongs_to :post
4
4
 
5
- end
5
+ end
@@ -0,0 +1 @@
1
+ categories#_form.html.erb
@@ -0,0 +1 @@
1
+ dashboard#_sidebar.html.erb
@@ -0,0 +1,6 @@
1
+
2
+ <%= _("You can update your password at") %>:
3
+
4
+ <%= @url %>
5
+
6
+ <%= _("If you didn't request a password update, you can ignore this message") %>
@@ -0,0 +1 @@
1
+ posts#_edit.html.erb
@@ -0,0 +1 @@
1
+ posts#_index.html.erb
@@ -0,0 +1 @@
1
+ posts#_new.html.erb
@@ -0,0 +1 @@
1
+ posts#_show.html.erb
@@ -0,0 +1 @@
1
+ posts#_sidebar.html.erb
@@ -0,0 +1 @@
1
+ resources#_sidebar.html.erb
@@ -0,0 +1 @@
1
+ status#index.html.erb
@@ -0,0 +1 @@
1
+ templates#datepicker_template_<%= attribute %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsApp</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,50 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # If you have a Gemfile, require the gems listed there, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
+
9
+ require "typus"
10
+
11
+ module RailsApp
12
+ class Application < Rails::Application
13
+ # Settings in config/environments/* take precedence over those specified here.
14
+ # Application configuration should go into files in config/initializers
15
+ # -- all .rb files in that directory are automatically loaded.
16
+
17
+ # Add additional load paths for your own custom dirs
18
+ # config.load_paths += %W( #{config.root}/extras )
19
+
20
+ # Only load the plugins named here, in the order given (default is alphabetical).
21
+ # :all can be used as a placeholder for all plugins not explicitly named
22
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
23
+
24
+ # Activate observers that should always be running
25
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
26
+
27
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
28
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
29
+ # config.time_zone = 'Central Time (US & Canada)'
30
+
31
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
32
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
33
+ # config.i18n.default_locale = :de
34
+
35
+ # Configure generators values. Many other options are available, be sure to check the documentation.
36
+ # config.generators do |g|
37
+ # g.orm :active_record
38
+ # g.template_engine :erb
39
+ # g.test_framework :test_unit, :fixture => true
40
+ # end
41
+
42
+ # Configure the default encoding used in templates for Ruby 1.9.
43
+ config.encoding = "utf-8"
44
+
45
+ # Configure sensitive parameters which will be filtered from the log file.
46
+ config.filter_parameters += [:password]
47
+ end
48
+ end
49
+
50
+ Typus.reload!
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../../../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
6
+ pool: 5
7
+ timeout: 5000
8
+
9
+ # Warning: The database defined as "test" will be erased and
10
+ # re-generated from your development database when you run "rake".
11
+ # Do not set this db to the same as development or production.
12
+ test:
13
+ adapter: sqlite3
14
+ database: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ RailsApp::Application.initialize!
@@ -0,0 +1,19 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+ end
@@ -0,0 +1,42 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+ end
@@ -0,0 +1,34 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ config.active_support.deprecation = :stderr
34
+ end