wagn 1.12.13 → 1.13.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (545) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +7 -8
  3. data/.rspec +1 -1
  4. data/.simplecov +23 -0
  5. data/.tm_properties +1 -0
  6. data/Gemfile +15 -13
  7. data/Guardfile +34 -0
  8. data/README.rdoc +4 -10
  9. data/VERSION +1 -1
  10. data/app/assets/images/smoothness/animated-overlay.gif +0 -0
  11. data/app/assets/images/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/app/assets/images/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  13. data/app/assets/images/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  14. data/app/assets/images/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  15. data/app/assets/images/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  16. data/app/assets/images/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  17. data/app/assets/images/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  18. data/app/assets/images/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  19. data/app/assets/images/smoothness/ui-icons_222222_256x240.png +0 -0
  20. data/app/assets/images/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  21. data/app/assets/images/smoothness/ui-icons_454545_256x240.png +0 -0
  22. data/app/assets/images/smoothness/ui-icons_888888_256x240.png +0 -0
  23. data/app/assets/images/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  24. data/app/assets/javascripts/application.js +9 -8
  25. data/app/assets/javascripts/jquery.ui.autocomplete.html.js +1 -1
  26. data/app/controllers/card_controller.rb +190 -23
  27. data/config/environments/development.rb +17 -12
  28. data/config/initializers/01_init_ruby_extensions.rb +1 -70
  29. data/config/routes.rb +21 -8
  30. data/config/version_cards.txt +1 -1
  31. data/db/bootstrap/card_references.yml +520 -352
  32. data/db/bootstrap/card_revisions.yml +1818 -1887
  33. data/db/bootstrap/cards.yml +2279 -1310
  34. data/db/migrate_cards/20130411191151_renaming_for_menu.rb +0 -5
  35. data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +0 -6
  36. data/db/migrate_cards/20130419215612_import_help_text.rb +0 -7
  37. data/db/migrate_cards/20130823192433_add_style_cards.rb +2 -6
  38. data/db/migrate_cards/20130910183318_move_styles_to_content.rb +0 -5
  39. data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +0 -6
  40. data/db/migrate_cards/20130920291703_update_stylesheets.rb +0 -5
  41. data/db/migrate_cards/20130927191728_account_events.rb +1 -6
  42. data/db/migrate_cards/20131016172445_common_css_patch.rb +0 -6
  43. data/db/migrate_cards/20140110193325_reset_account_request_type.rb +1 -6
  44. data/db/migrate_cards/20140307231621_user_data_to_cards.rb +78 -0
  45. data/db/migrate_cards/20140317035504_account_requests_to_signups.rb +45 -0
  46. data/db/migrate_cards/20140512155840_add_script_cards.rb +85 -0
  47. data/db/migrate_cards/data/1.12_stylesheets/common.scss +1 -1
  48. data/features/autonaming.feature +3 -3
  49. data/features/flexmail.feature +2 -2
  50. data/features/layouts.feature +1 -1
  51. data/features/navbox.feature +17 -0
  52. data/features/notifications.feature +4 -4
  53. data/features/pointer_inputs.feature +2 -2
  54. data/features/presetting_content.feature +1 -1
  55. data/features/reset_password.feature +34 -0
  56. data/features/{pattern_settings.feature → rules.feature} +7 -7
  57. data/features/setup.feature +32 -0
  58. data/features/signup.feature +47 -0
  59. data/features/step_definitions/email_steps.rb +24 -1
  60. data/features/step_definitions/wagn_steps.rb +66 -31
  61. data/features/step_definitions/web_steps.rb +1 -0
  62. data/features/{content_settings.feature → structure.feature} +3 -6
  63. data/features/support/env.rb +3 -0
  64. data/features/support/paths.rb +2 -2
  65. data/features/support/{wag_env.rb → wagn_env.rb} +1 -1
  66. data/features/table_of_contents.feature +1 -1
  67. data/features/update_includers.feature +3 -3
  68. data/features/watch.feature +2 -2
  69. data/lib/card.rb +12 -10
  70. data/lib/{active_record/quoting_and_matching.rb → card/active_record_ext.rb} +25 -20
  71. data/lib/card/auth.rb +205 -0
  72. data/lib/card/chunk.rb +70 -69
  73. data/lib/card/content.rb +1 -1
  74. data/lib/card/core_ext.rb +74 -0
  75. data/lib/card/env.rb +66 -0
  76. data/lib/card/flexmail.rb +43 -37
  77. data/lib/card/format.rb +42 -29
  78. data/lib/{generators → card/generators}/card_migration/USAGE +0 -0
  79. data/lib/{generators → card/generators}/card_migration/card_migration_generator.rb +0 -0
  80. data/lib/{generators → card/generators}/card_migration/templates/card_migration.erb +0 -6
  81. data/lib/{generators → card/generators}/format/USAGE +0 -0
  82. data/lib/{generators → card/generators}/format/format_generator.rb +0 -0
  83. data/lib/{generators → card/generators}/format/templates/format_spec_template.erb +1 -2
  84. data/lib/{generators → card/generators}/format/templates/format_template.erb +0 -0
  85. data/lib/{generators → card/generators}/set/USAGE +0 -0
  86. data/lib/{generators → card/generators}/set/set_generator.rb +0 -0
  87. data/lib/{generators → card/generators}/set/templates/set_spec_template.erb +1 -2
  88. data/lib/card/generators/set/templates/set_template.erb +1 -0
  89. data/lib/card/loader.rb +145 -0
  90. data/lib/card/mailer.rb +117 -0
  91. data/{app/views → lib/card}/mailer/change_notice.html.erb +2 -2
  92. data/lib/card/mailer/confirmation_email.html.erb +8 -0
  93. data/{app/views → lib/card}/mailer/flexmail.html.erb +0 -0
  94. data/lib/card/mailer/password_reset.html.erb +9 -0
  95. data/{app/views → lib/card}/mailer/signup_alert.html.erb +0 -0
  96. data/lib/card/name.rb +2 -3
  97. data/lib/card/query.rb +0 -3
  98. data/lib/card/query/card_spec.rb +4 -4
  99. data/lib/card/revision.rb +34 -32
  100. data/lib/card/set.rb +204 -180
  101. data/lib/card/set_pattern.rb +126 -101
  102. data/lib/wagn/all.rb +1 -8
  103. data/lib/wagn/application.rb +14 -7
  104. data/lib/wagn/commands/application.rb +1 -1
  105. data/lib/{generators → wagn/generators}/wagn/USAGE +0 -0
  106. data/lib/{generators → wagn/generators}/wagn/templates/Gemfile +0 -0
  107. data/lib/{generators → wagn/generators}/wagn/templates/Rakefile +0 -0
  108. data/lib/{generators → wagn/generators}/wagn/templates/config.ru +0 -0
  109. data/lib/{generators → wagn/generators}/wagn/templates/config/application.rb +0 -0
  110. data/lib/{generators → wagn/generators}/wagn/templates/config/boot.rb +0 -0
  111. data/lib/{generators → wagn/generators}/wagn/templates/config/database.yml +0 -0
  112. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/frontbase.yml +0 -0
  113. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/ibm_db.yml +0 -0
  114. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbc.yml +0 -0
  115. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcmysql.yml +0 -0
  116. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcpostgresql.yml +0 -0
  117. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcsqlite3.yml +0 -0
  118. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/mysql.yml +0 -0
  119. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/oracle.yml +0 -0
  120. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/postgresql.yml +0 -0
  121. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/sqlite3.yml +0 -0
  122. data/lib/{generators → wagn/generators}/wagn/templates/config/environment.rb +0 -0
  123. data/lib/{generators → wagn/generators}/wagn/templates/gitignore +0 -0
  124. data/lib/wagn/generators/wagn/templates/public/files/htaccess +9 -0
  125. data/{public → lib/wagn/generators/wagn/templates/public}/robots.txt +0 -0
  126. data/lib/{generators → wagn/generators}/wagn/templates/script/wagn +0 -0
  127. data/lib/{generators → wagn/generators}/wagn/wagn_generator.rb +12 -0
  128. data/lib/wagn/location.rb +7 -11
  129. data/lib/wagn/migration_helper.rb +4 -1
  130. data/{app/mailers → lib/wagn/tasks}/.gitkeep +0 -0
  131. data/lib/{tasks → wagn/tasks}/cucumber.rake +0 -0
  132. data/lib/{tasks → wagn/tasks}/db.rake +0 -0
  133. data/lib/{tasks → wagn/tasks}/test.rake +5 -2
  134. data/lib/{tasks → wagn/tasks}/wagn.rake +29 -12
  135. data/mods/{standard → core}/chunks/include.rb +2 -0
  136. data/mods/{standard → core}/chunks/link.rb +3 -0
  137. data/mods/core/formats/html_format.rb +27 -35
  138. data/mods/core/sets/all/active_card.rb +15 -3
  139. data/mods/core/sets/all/attribute_tracking.rb +1 -1
  140. data/mods/core/sets/all/collection.rb +4 -5
  141. data/mods/core/sets/all/fetch.rb +98 -80
  142. data/mods/core/sets/all/initialize.rb +2 -0
  143. data/mods/core/sets/all/name.rb +13 -12
  144. data/mods/core/sets/all/pattern.rb +0 -9
  145. data/mods/core/sets/all/permissions.rb +56 -31
  146. data/mods/core/sets/all/phases.rb +63 -84
  147. data/mods/core/sets/all/references.rb +0 -1
  148. data/mods/core/sets/all/rules.rb +3 -4
  149. data/mods/core/sets/all/templating.rb +2 -3
  150. data/mods/core/sets/all/tracked_attributes.rb +26 -9
  151. data/mods/core/sets/all/trash.rb +1 -2
  152. data/mods/core/sets/all/type.rb +6 -1
  153. data/mods/core/sets/all/utils.rb +2 -3
  154. data/mods/standard/files/103/icon-6566.ico +0 -0
  155. data/mods/standard/files/103/large-6566.ico +0 -0
  156. data/mods/standard/files/103/medium-6566.ico +0 -0
  157. data/{public/favicon.ico → mods/standard/files/103/original-6566.ico} +0 -0
  158. data/mods/standard/files/103/small-6566.ico +0 -0
  159. data/mods/standard/files/79/icon-6556.png +0 -0
  160. data/mods/standard/files/79/large-6556.png +0 -0
  161. data/mods/standard/files/79/medium-6556.png +0 -0
  162. data/mods/standard/files/79/original-6556.png +0 -0
  163. data/mods/standard/files/79/small-6556.png +0 -0
  164. data/mods/standard/files/790/icon-6419.png +0 -0
  165. data/mods/standard/files/790/large-6419.png +0 -0
  166. data/mods/standard/files/790/medium-6419.png +0 -0
  167. data/mods/standard/files/790/original-6419.png +0 -0
  168. data/mods/standard/files/790/small-6419.png +0 -0
  169. data/mods/standard/lib/card/machine.rb +152 -0
  170. data/mods/standard/lib/card/machine_input.rb +40 -0
  171. data/{public/assets → mods/standard/lib/javascript}/html5shiv-printshiv.js +0 -0
  172. data/mods/standard/lib/javascript/jquery-ui.js +14913 -0
  173. data/mods/standard/lib/javascript/jquery.autosize.js +255 -0
  174. data/mods/standard/lib/javascript/jquery.fileupload.js +1112 -0
  175. data/mods/standard/lib/javascript/jquery.iframe-transport.js +157 -0
  176. data/mods/standard/lib/javascript/jquery.js +9473 -0
  177. data/mods/standard/lib/javascript/jquery.ui.autocomplete.html.js +41 -0
  178. data/mods/standard/lib/javascript/jquery_ujs.js +429 -0
  179. data/mods/standard/lib/javascript/jquerymobile.js +8800 -0
  180. data/mods/standard/lib/javascript/tinymce.js +13 -0
  181. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn.js.coffee +10 -0
  182. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_menu.js +3 -12
  183. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_mod.js.coffee +18 -11
  184. data/mods/standard/lib/stylesheets/functional.scss +13 -9
  185. data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +922 -218
  186. data/mods/standard/lib/stylesheets/standard.scss +2 -2
  187. data/mods/standard/sets/all/account.rb +18 -205
  188. data/mods/standard/sets/all/all_css.rb +2 -3
  189. data/mods/standard/sets/all/all_csv.rb +0 -1
  190. data/mods/standard/sets/all/attach.rb +0 -1
  191. data/mods/standard/sets/all/base.rb +9 -7
  192. data/mods/standard/sets/all/comment.rb +5 -5
  193. data/mods/standard/sets/all/email_html.rb +0 -2
  194. data/mods/standard/sets/all/event_viz.rb +62 -0
  195. data/mods/standard/sets/all/file.rb +0 -1
  196. data/mods/standard/sets/all/follow.rb +13 -11
  197. data/mods/standard/sets/all/history.rb +2 -7
  198. data/mods/standard/sets/all/json.rb +6 -11
  199. data/mods/standard/sets/all/rich_html.rb +68 -52
  200. data/mods/standard/sets/all/rss.rb +4 -5
  201. data/mods/standard/sets/all/text.rb +0 -1
  202. data/mods/standard/sets/right/account.rb +100 -1
  203. data/mods/standard/sets/right/create.rb +8 -2
  204. data/mods/standard/sets/right/delete.rb +2 -0
  205. data/mods/standard/sets/right/email.rb +50 -2
  206. data/mods/standard/sets/right/machine_output.rb +12 -0
  207. data/mods/standard/sets/right/password.rb +39 -0
  208. data/mods/standard/sets/right/read.rb +2 -0
  209. data/mods/standard/sets/right/salt.rb +2 -1
  210. data/mods/standard/sets/right/script.rb +10 -0
  211. data/mods/standard/sets/right/stats.rb +35 -0
  212. data/mods/standard/sets/right/status.rb +9 -0
  213. data/mods/standard/sets/right/style.rb +7 -53
  214. data/mods/standard/sets/right/{crypted_password.rb → token.rb} +2 -1
  215. data/mods/standard/sets/right/update.rb +2 -0
  216. data/mods/standard/sets/rstar/rules.rb +7 -3
  217. data/mods/standard/sets/self/account_links.rb +16 -23
  218. data/mods/standard/sets/self/alerts.rb +0 -1
  219. data/mods/standard/sets/self/all.rb +21 -0
  220. data/mods/standard/sets/self/foot.rb +0 -1
  221. data/mods/standard/sets/self/head.rb +21 -24
  222. data/mods/standard/sets/self/navbox.rb +0 -1
  223. data/mods/standard/sets/self/now.rb +0 -1
  224. data/mods/standard/sets/self/recent.rb +38 -35
  225. data/mods/standard/sets/self/script_card_menu.rb +8 -0
  226. data/mods/standard/sets/self/script_html5shiv_printshiv.rb +7 -0
  227. data/mods/standard/sets/self/script_jquery.rb +8 -0
  228. data/mods/standard/sets/self/script_jquery_helper.rb +13 -0
  229. data/mods/standard/sets/self/script_slot.rb +9 -0
  230. data/mods/standard/sets/self/script_tinymce.rb +8 -0
  231. data/mods/standard/sets/self/search.rb +0 -1
  232. data/mods/standard/sets/self/signin.rb +111 -0
  233. data/mods/standard/sets/self/stats.rb +91 -0
  234. data/mods/standard/sets/self/style_functional.rb +1 -1
  235. data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +1 -1
  236. data/mods/standard/sets/self/style_standard.rb +1 -1
  237. data/mods/standard/sets/type/basic.rb +15 -14
  238. data/mods/standard/sets/type/cardtype.rb +2 -3
  239. data/mods/standard/sets/type/coffee_script.rb +46 -0
  240. data/mods/standard/sets/type/css.rb +16 -5
  241. data/mods/standard/sets/type/date.rb +0 -1
  242. data/mods/standard/sets/type/file.rb +0 -2
  243. data/mods/standard/sets/type/html.rb +0 -1
  244. data/mods/standard/sets/type/image.rb +1 -2
  245. data/mods/standard/sets/type/java_script.rb +32 -0
  246. data/mods/standard/sets/type/layout_type.rb +1 -1
  247. data/mods/standard/sets/type/number.rb +0 -1
  248. data/mods/standard/sets/type/pointer.rb +13 -8
  249. data/mods/standard/sets/type/scss.rb +17 -3
  250. data/mods/standard/sets/type/search_type.rb +36 -34
  251. data/mods/standard/sets/type/set.rb +1 -5
  252. data/mods/standard/sets/type/setting.rb +1 -2
  253. data/mods/standard/sets/type/signup.rb +92 -0
  254. data/mods/standard/sets/type/skin.rb +4 -5
  255. data/mods/standard/sets/type/toggle.rb +1 -1
  256. data/mods/standard/sets/type/user.rb +51 -4
  257. data/public/{404.html → assets/jasmine/404.html} +0 -0
  258. data/public/{500.html → assets/jasmine/500.html} +0 -0
  259. data/public/{jasmine → assets/jasmine}/card_form.html +0 -0
  260. data/public/assets/jquery-ui/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
  261. data/public/assets/jquery-ui/animated-overlay.gif +0 -0
  262. data/public/assets/{images → jquery-ui}/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
  263. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  264. data/public/assets/{images → jquery-ui}/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
  265. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_75_ffffff_40x100.png +0 -0
  266. data/public/assets/{images → jquery-ui}/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
  267. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  268. data/public/assets/{images → jquery-ui}/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
  269. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_65_ffffff_1x400.png +0 -0
  270. data/public/assets/{images → jquery-ui}/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
  271. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_dadada_1x400.png +0 -0
  272. data/public/assets/{images → jquery-ui}/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
  273. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  274. data/public/assets/{images → jquery-ui}/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
  275. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  276. data/public/assets/{images → jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
  277. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  278. data/{app/assets/images/images/ui-icons_2e83ff_256x240.png → public/assets/jquery-ui/ui-icons_222222_256x240-b1eb177a51ea7925448318a26d988842.png} +0 -0
  279. data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_222222_256x240.png +0 -0
  280. data/{app/assets/images/images/ui-icons_454545_256x240.png → public/assets/jquery-ui/ui-icons_2e83ff_256x240-49c2da9cac2dc565265586f716491298.png} +0 -0
  281. data/public/assets/{images → jquery-ui}/ui-icons_2e83ff_256x240.png +0 -0
  282. data/{app/assets/images/images/ui-icons_888888_256x240.png → public/assets/jquery-ui/ui-icons_454545_256x240-68b2fe3268f7604fb0767a0372e2db85.png} +0 -0
  283. data/public/assets/{images → jquery-ui}/ui-icons_454545_256x240.png +0 -0
  284. data/public/assets/jquery-ui/ui-icons_888888_256x240-8040cfcc88792375b7788feb59189eef.png +0 -0
  285. data/public/assets/{images → jquery-ui}/ui-icons_888888_256x240.png +0 -0
  286. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-d4a62216bf6f0cd0071149890763a5ff.png +0 -0
  287. data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_cd0a0a_256x240.png +0 -0
  288. data/public/assets/jquery.min-388372ef65cc311f6a3df4a6ceac8d22.map +1 -0
  289. data/public/assets/jquery.min.map +1 -1
  290. data/public/assets/manifest.yml +61 -31
  291. data/public/assets/smoothness/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
  292. data/public/assets/smoothness/animated-overlay.gif +0 -0
  293. data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100-31613497e63975a54520b7065b125dea.png +0 -0
  294. data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  295. data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100-f4b0e20e6f4c83b9f52cf062ed0f5284.png +0 -0
  296. data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  297. data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400-e3606d6e7ad67486ffdc83edca64d4c5.png +0 -0
  298. data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  299. data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400-dcec96932b90ff4cd4fea91284a6e9a3.png +0 -0
  300. data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  301. data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400-a2310f533684ede4f1216d7299b5cd58.png +0 -0
  302. data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  303. data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400-d872f3a0a02dea609e4b0321520236d9.png +0 -0
  304. data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  305. data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400-9ccaed8a65a3c285c16a73bdf03a69b3.png +0 -0
  306. data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  307. data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100-2ef1d227b5c0f33ce3c5e45afa953991.png +0 -0
  308. data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  309. data/public/assets/smoothness/ui-icons_222222_256x240-0675a996f0bdc78890f7b312c543b06a.png +0 -0
  310. data/public/assets/smoothness/ui-icons_222222_256x240.png +0 -0
  311. data/public/assets/smoothness/ui-icons_2e83ff_256x240-6aea736f81a417977efd77f183519a54.png +0 -0
  312. data/public/assets/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  313. data/public/assets/smoothness/ui-icons_454545_256x240-6f4361f45745fb0cd7b0cc2851dc1cc3.png +0 -0
  314. data/public/assets/smoothness/ui-icons_454545_256x240.png +0 -0
  315. data/public/assets/smoothness/ui-icons_888888_256x240-8f6818bd8631ba3489de718e26c7e6cf.png +0 -0
  316. data/public/assets/smoothness/ui-icons_888888_256x240.png +0 -0
  317. data/public/assets/smoothness/ui-icons_cd0a0a_256x240-2969ddba6d0a9c62603a4aa85a363cda.png +0 -0
  318. data/public/assets/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  319. data/spec/controllers/card_controller_spec.rb +77 -61
  320. data/spec/controllers/location_spec.rb +3 -2
  321. data/spec/lib/card/auth_spec.rb +17 -0
  322. data/spec/lib/card/chunk_spec.rb +0 -1
  323. data/spec/lib/card/codename_spec.rb +12 -18
  324. data/spec/lib/card/content_spec.rb +0 -1
  325. data/spec/lib/card/diff_spec.rb +0 -1
  326. data/spec/lib/card/flexmail_spec.rb +19 -20
  327. data/spec/lib/card/format_spec.rb +0 -169
  328. data/spec/lib/{wagn → card}/loader_spec.rb +1 -2
  329. data/spec/lib/card/name_spec.rb +3 -5
  330. data/spec/lib/card/query_spec.rb +5 -8
  331. data/spec/{models → lib}/card/reference_spec.rb +6 -7
  332. data/spec/lib/card/revision_spec.rb +30 -0
  333. data/spec/lib/card/set_pattern_spec.rb +0 -1
  334. data/spec/lib/card/set_spec.rb +9 -9
  335. data/spec/lib/wagn/cache_spec.rb +0 -1
  336. data/spec/mailers/mailer_spec.rb +4 -9
  337. data/spec/models/card/cardtype_spec.rb +12 -14
  338. data/spec/models/card/create_spec.rb +3 -4
  339. data/spec/models/card/trash_spec.rb +24 -23
  340. data/spec/models/card/type_transition_spec.rb +3 -4
  341. data/spec/models/card/validation_spec.rb +0 -1
  342. data/spec/models/card_spec.rb +10 -11
  343. data/spec/mods/core/chunks/literal_spec.rb +0 -1
  344. data/spec/mods/core/chunks/uri_spec.rb +0 -1
  345. data/spec/mods/core/formats/data_format_spec.rb +0 -1
  346. data/spec/mods/core/formats/html_format_spec.rb +17 -18
  347. data/spec/mods/core/formats/text_format_spec.rb +0 -1
  348. data/spec/mods/core/sets/all/active_card_spec.rb +1 -2
  349. data/spec/mods/core/sets/all/attribute_tracking_spec.rb +1 -2
  350. data/spec/mods/core/sets/all/collection_spec.rb +1 -5
  351. data/spec/mods/core/sets/all/content_spec.rb +0 -1
  352. data/spec/mods/core/sets/all/fetch_spec.rb +7 -10
  353. data/spec/mods/core/sets/all/initialize_spec.rb +0 -1
  354. data/spec/mods/core/sets/all/name_spec.rb +34 -3
  355. data/spec/mods/core/sets/all/pattern_spec.rb +6 -9
  356. data/spec/mods/core/sets/all/permissions_spec.rb +61 -62
  357. data/spec/mods/core/sets/all/phases_spec.rb +1 -2
  358. data/spec/mods/core/sets/all/references_spec.rb +0 -1
  359. data/spec/mods/core/sets/all/rules2_spec.rb +31 -31
  360. data/spec/mods/core/sets/all/rules_spec.rb +3 -4
  361. data/spec/mods/core/sets/all/states_spec.rb +1 -2
  362. data/spec/mods/core/sets/all/templating_spec.rb +11 -12
  363. data/spec/mods/core/sets/all/tracked_attributes_spec.rb +18 -8
  364. data/spec/mods/core/sets/all/trash_spec.rb +1 -2
  365. data/spec/mods/core/sets/all/type_spec.rb +6 -5
  366. data/spec/mods/core/sets/all/utils_spec.rb +1 -2
  367. data/spec/mods/standard/chunks/include_spec.rb +14 -15
  368. data/spec/mods/standard/chunks/link_spec.rb +0 -1
  369. data/spec/mods/standard/formats/css_format_spec.rb +1 -2
  370. data/spec/mods/standard/formats/csv_format_spec.rb +0 -1
  371. data/spec/mods/standard/formats/email_html_format_spec.rb +1 -2
  372. data/spec/mods/standard/formats/file_format_spec.rb +0 -1
  373. data/spec/mods/standard/formats/js_format_spec.rb +3 -0
  374. data/spec/mods/standard/formats/json_format_spec.rb +0 -1
  375. data/spec/mods/standard/formats/rss_format_spec.rb +1 -2
  376. data/spec/mods/standard/formats/xml_format_spec.rb +0 -1
  377. data/spec/mods/standard/lib/machine_input_spec.rb +48 -0
  378. data/spec/mods/standard/lib/machine_spec.rb +110 -0
  379. data/spec/mods/standard/sets/all/account_spec.rb +50 -30
  380. data/spec/mods/standard/sets/all/all_css_spec.rb +0 -1
  381. data/spec/mods/standard/sets/all/all_csv_spec.rb +0 -1
  382. data/spec/mods/standard/sets/all/attach_spec.rb +0 -1
  383. data/spec/mods/standard/sets/all/base_spec.rb +5 -6
  384. data/spec/mods/standard/sets/all/comment_spec.rb +5 -0
  385. data/spec/mods/standard/sets/all/email_html_spec.rb +2 -3
  386. data/spec/mods/standard/sets/all/event_viz_spec.rb +7 -0
  387. data/spec/mods/standard/sets/all/file_spec.rb +0 -1
  388. data/spec/mods/standard/sets/all/flexmail_spec.rb +0 -1
  389. data/spec/mods/standard/sets/all/follow_spec.rb +10 -11
  390. data/spec/mods/standard/sets/all/history_spec.rb +10 -0
  391. data/spec/mods/standard/sets/all/json_spec.rb +5 -6
  392. data/spec/mods/standard/sets/all/rich_html_spec.rb +16 -13
  393. data/spec/mods/standard/sets/all/rss_spec.rb +4 -2
  394. data/spec/mods/standard/sets/all/text_spec.rb +1 -2
  395. data/spec/mods/standard/sets/right/account_spec.rb +86 -2
  396. data/spec/mods/standard/sets/right/add_help_spec.rb +0 -1
  397. data/spec/mods/standard/sets/right/comment_spec.rb +37 -2
  398. data/spec/mods/standard/sets/right/create_spec.rb +6 -2
  399. data/spec/mods/standard/sets/right/default_spec.rb +0 -1
  400. data/spec/mods/standard/sets/right/delete_spec.rb +0 -1
  401. data/spec/mods/standard/sets/right/email_spec.rb +43 -15
  402. data/spec/mods/standard/sets/right/help_spec.rb +0 -1
  403. data/spec/mods/standard/sets/right/machine_output_spec.rb +20 -0
  404. data/spec/mods/standard/sets/right/password_spec.rb +45 -0
  405. data/spec/mods/standard/sets/right/read_spec.rb +0 -1
  406. data/spec/mods/standard/sets/right/salt_spec.rb +0 -1
  407. data/spec/mods/standard/sets/right/script_spec.rb +20 -0
  408. data/spec/mods/standard/sets/right/stats_spec.rb +13 -0
  409. data/spec/mods/standard/sets/right/status_spec.rb +5 -0
  410. data/spec/mods/standard/sets/right/structure_spec.rb +2 -3
  411. data/spec/mods/standard/sets/right/style_spec.rb +19 -2
  412. data/spec/mods/standard/sets/right/token_spec.rb +5 -0
  413. data/spec/mods/standard/sets/right/update_spec.rb +0 -1
  414. data/spec/mods/standard/sets/right/when_created_spec.rb +0 -1
  415. data/spec/mods/standard/sets/right/when_last_edited_spec.rb +0 -1
  416. data/spec/mods/standard/sets/rstar/rules_spec.rb +3 -4
  417. data/spec/mods/standard/sets/self/account_links_spec.rb +0 -1
  418. data/spec/mods/standard/sets/self/alerts_spec.rb +0 -1
  419. data/spec/mods/standard/sets/self/all_spec.rb +47 -0
  420. data/spec/mods/standard/sets/self/foot_spec.rb +0 -1
  421. data/spec/mods/standard/sets/self/head_spec.rb +0 -1
  422. data/spec/mods/standard/sets/self/navbox_spec.rb +0 -1
  423. data/spec/mods/standard/sets/self/now_spec.rb +0 -1
  424. data/spec/mods/standard/sets/self/recent_spec.rb +1 -2
  425. data/spec/mods/standard/sets/self/search_spec.rb +1 -2
  426. data/spec/mods/standard/sets/self/signin_spec.rb +73 -0
  427. data/spec/mods/standard/sets/self/stats_spec.rb +12 -0
  428. data/spec/mods/standard/sets/self/style_functional_spec.rb +1 -2
  429. data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +1 -2
  430. data/spec/mods/standard/sets/self/style_standard_spec.rb +1 -2
  431. data/spec/mods/standard/sets/self/version_spec.rb +0 -1
  432. data/spec/mods/standard/sets/type/basic_spec.rb +1 -2
  433. data/spec/mods/standard/sets/type/cardtype_spec.rb +1 -2
  434. data/spec/mods/standard/sets/type/coffeescript_spec.rb +28 -0
  435. data/spec/mods/standard/sets/type/css_spec.rb +31 -4
  436. data/spec/mods/standard/sets/type/date_spec.rb +0 -1
  437. data/spec/mods/standard/sets/type/file_spec.rb +1 -2
  438. data/spec/mods/standard/sets/type/html_spec.rb +3 -4
  439. data/spec/mods/standard/sets/type/image_spec.rb +1 -2
  440. data/spec/mods/standard/sets/type/javascript_spec.rb +28 -0
  441. data/spec/mods/standard/sets/type/layout_type_spec.rb +0 -1
  442. data/spec/mods/standard/sets/type/number_spec.rb +0 -1
  443. data/spec/mods/standard/sets/type/phrase_spec.rb +0 -1
  444. data/spec/mods/standard/sets/type/plain_text_spec.rb +0 -1
  445. data/spec/mods/standard/sets/type/pointer_spec.rb +1 -2
  446. data/spec/mods/standard/sets/type/scss_spec.rb +47 -2
  447. data/spec/mods/standard/sets/type/search_type_spec.rb +14 -3
  448. data/spec/mods/standard/sets/type/set_spec.rb +0 -1
  449. data/spec/mods/standard/sets/type/setting_spec.rb +6 -2
  450. data/spec/mods/standard/sets/type/signup_spec.rb +93 -0
  451. data/spec/mods/standard/sets/type/skin_spec.rb +23 -2
  452. data/spec/mods/standard/sets/type/toggle_spec.rb +0 -1
  453. data/spec/mods/standard/sets/type/user_spec.rb +1 -2
  454. data/{lib/wagn → spec}/spec_helper.rb +59 -14
  455. data/test/1.10.0-data-dump.sql +327 -0
  456. data/test/fixtures/card_references.yml +777 -581
  457. data/test/fixtures/card_revisions.yml +2737 -2488
  458. data/test/fixtures/cards.yml +4037 -2184
  459. data/test/performance/card_create_test.rb +1 -1
  460. data/test/performance/render_test.rb +1 -1
  461. data/test/seed.rb +36 -63
  462. data/test/test_helper.rb +1 -1
  463. data/wagn.gemspec +9 -9
  464. metadata +257 -237
  465. data/app/assets/javascripts/html5shiv-printshiv.js +0 -499
  466. data/app/controllers/account_controller.rb +0 -61
  467. data/app/controllers/admin_controller.rb +0 -124
  468. data/app/controllers/stub_card_controller.rb +0 -9
  469. data/app/controllers/wagn_controller.rb +0 -165
  470. data/app/mailers/mailer.rb +0 -109
  471. data/app/models/.gitkeep +0 -0
  472. data/app/models/account.rb +0 -198
  473. data/app/models/user.rb +0 -123
  474. data/app/views/mailer/account_info.text.erb +0 -17
  475. data/config/initializers/backtrace_silencers.rb +0 -8
  476. data/config/initializers/schema_views.rb +0 -59
  477. data/config/initializers/wrap_parameters.rb +0 -15
  478. data/config/samples/database.yml.erb +0 -34
  479. data/db/bootstrap/users.yml +0 -29
  480. data/features/account_requests.feature +0 -22
  481. data/features/google_maps.feature +0 -31
  482. data/features/hello_wagn.feature +0 -31
  483. data/features/step_definitions/notification_steps.rb +0 -23
  484. data/features/templates.feature +0 -30
  485. data/features/virtual_cards.feature +0 -11
  486. data/lib/active_record/foreign_keys.rb +0 -80
  487. data/lib/card/constant.rb +0 -20
  488. data/lib/generators/set/templates/set_template.erb +0 -1
  489. data/lib/tasks/.gitkeep +0 -0
  490. data/lib/wagn/authenticated_system.rb +0 -38
  491. data/lib/wagn/env.rb +0 -42
  492. data/lib/wagn/loader.rb +0 -135
  493. data/mods/standard/formats/kml_format.rb +0 -6
  494. data/mods/standard/lib/google_maps_addon.rb +0 -30
  495. data/mods/standard/sets/all/admin.rb +0 -53
  496. data/mods/standard/sets/all/geocode.rb +0 -16
  497. data/mods/standard/sets/all/kml.rb +0 -49
  498. data/mods/standard/sets/type/account_request.rb +0 -74
  499. data/mods/standard/sets/type/ruby_and_script.rb +0 -31
  500. data/public/assets/application-058913c45d4f3262667bad443a03eb45.js +0 -144
  501. data/public/assets/application-058913c45d4f3262667bad443a03eb45.js.gz +0 -0
  502. data/public/assets/application.js +0 -144
  503. data/public/assets/application.js.gz +0 -0
  504. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +0 -1
  505. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
  506. data/public/assets/html5shiv-printshiv.js.gz +0 -0
  507. data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  508. data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  509. data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  510. data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  511. data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  512. data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  513. data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  514. data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  515. data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
  516. data/public/assets/images/ui-icons_222222_256x240.png +0 -0
  517. data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
  518. data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
  519. data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
  520. data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
  521. data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
  522. data/public/assets/jquery.min-8b58c0fbf303b938d8e749262f7e50dd.map +0 -1
  523. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +0 -13
  524. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
  525. data/public/assets/tinymce.js +0 -13
  526. data/public/assets/tinymce.js.gz +0 -0
  527. data/spec/controllers/account_controller_spec.rb +0 -42
  528. data/spec/controllers/admin_controller_spec.rb +0 -23
  529. data/spec/controllers/captcha_spec.rb +0 -103
  530. data/spec/controllers/sets_spec.rb +0 -97
  531. data/spec/controllers/wagn_controller_spec.rb +0 -5
  532. data/spec/mailers/account_spec.rb +0 -66
  533. data/spec/models/account_spec.rb +0 -19
  534. data/spec/models/card/comment_spec.rb +0 -38
  535. data/spec/models/card/revision_spec.rb +0 -58
  536. data/spec/models/user_spec.rb +0 -95
  537. data/spec/mods/standard/formats/kml_format_spec.rb +0 -6
  538. data/spec/mods/standard/sets/all/admin_spec.rb +0 -6
  539. data/spec/mods/standard/sets/all/geocode_spec.rb +0 -37
  540. data/spec/mods/standard/sets/all/kml_spec.rb +0 -6
  541. data/spec/mods/standard/sets/right/crypted_password_spec.rb +0 -6
  542. data/spec/mods/standard/sets/type/account_request_spec.rb +0 -160
  543. data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +0 -6
  544. data/spec/spec.opts +0 -6
  545. data/test/fixtures/users.yml +0 -169
@@ -16,7 +16,7 @@ module Wagn::MigrationHelper
16
16
  def contentedly &block
17
17
  Wagn::Cache.reset_global
18
18
  Wagn::MigrationHelper.schema_mode '' do
19
- Account.as_bot do
19
+ Card::Auth.as_bot do
20
20
  ActiveRecord::Base.transaction do
21
21
  begin
22
22
  yield
@@ -28,4 +28,7 @@ module Wagn::MigrationHelper
28
28
  end
29
29
  end
30
30
 
31
+ def down
32
+ raise ActiveRecord::IrreversibleMigration
33
+ end
31
34
  end
File without changes
File without changes
File without changes
@@ -56,6 +56,9 @@ namespace :test do
56
56
  # go ahead and load the fixtures into the test database
57
57
  puts ">> preparing test database"
58
58
  puts `env RELOAD_TEST_DATA=true rake db:test:prepare --trace`
59
+
60
+ Rake::Task['wagn:assume_card_migrations'].invoke
61
+
59
62
  end
60
63
 
61
64
 
@@ -66,9 +69,9 @@ namespace :test do
66
69
  # which dumps with slashes that syck can't understand (also !!null stuff)
67
70
 
68
71
  sql = "SELECT * FROM %s"
69
- skip_tables = ["schema_info","schema_migrations","schema_migrations_cards","sessions"]
72
+ tables = %w{ cards card_revisions card_references }
70
73
  ActiveRecord::Base.establish_connection
71
- (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
74
+ tables.each do |table_name|
72
75
  i = "000"
73
76
  File.open("#{Wagn.gem_root}/test/fixtures/#{table_name}.yml", 'w') do |file|
74
77
  data = ActiveRecord::Base.connection.select_all(sql % table_name)
@@ -1,4 +1,5 @@
1
- WAGN_BOOTSTRAP_TABLES = %w{ cards card_revisions card_references users }
1
+
2
+ WAGN_BOOTSTRAP_TABLES = %w{ cards card_revisions card_references }
2
3
 
3
4
  namespace :wagn do
4
5
  desc "create a wagn database from scratch"
@@ -19,10 +20,8 @@ namespace :wagn do
19
20
  puts "loading schema"
20
21
  Rake::Task['db:schema:load'].invoke
21
22
 
22
- # inserts existing card migrations into schema_migrations_cards to avoid re-migrating
23
- Wagn::MigrationHelper.schema_mode :card do
24
- ActiveRecord::Schema.assume_migrated_upto_version Wagn::Version.schema(:cards), Wagn::MigrationHelper.card_migration_paths
25
- end
23
+ puts "update card_migrations"
24
+ Rake::Task['wagn:assume_card_migrations'].invoke
26
25
 
27
26
  if Rails.env == 'test'
28
27
  puts "loading test fixtures"
@@ -31,12 +30,18 @@ namespace :wagn do
31
30
  puts "loading bootstrap"
32
31
  Rake::Task['wagn:bootstrap:load'].invoke
33
32
  end
33
+
34
+ puts "set symlink for assets"
35
+ Rake::Task['wagn:update_assets_symlink'].invoke
34
36
  end
35
37
 
36
38
  desc "update wagn gems and database"
37
39
  task :update do
38
- system 'bundle update'
40
+ #system 'bundle update'
39
41
  Rake::Task['wagn:migrate'].invoke
42
+ # FIXME remove tmp dir / clear cache
43
+ puts "set symlink for assets"
44
+ Rake::Task['wagn:update_assets_symlink'].invoke
40
45
  end
41
46
 
42
47
  desc "reset cache"
@@ -44,6 +49,12 @@ namespace :wagn do
44
49
  Wagn::Cache.reset_global
45
50
  end
46
51
 
52
+ desc "set symlink for assets"
53
+ task :update_assets_symlink do
54
+ unless Rails.root.to_s == Wagn.gem_root
55
+ FileUtils.ln_s( Wagn.paths['gem-assets'].first, File.join(Rails.public_path, "assets") )
56
+ end
57
+ end
47
58
 
48
59
  desc "migrate structure and cards"
49
60
  task :migrate =>:environment do
@@ -67,13 +78,20 @@ namespace :wagn do
67
78
  Wagn::Cache.reset_global
68
79
  end
69
80
 
81
+ desc 'insert existing card migrations into schema_migrations_cards to avoid re-migrating'
82
+ task :assume_card_migrations do
83
+ Wagn::MigrationHelper.schema_mode :card do
84
+ ActiveRecord::Schema.assume_migrated_upto_version Wagn::Version.schema(:cards), Wagn::MigrationHelper.card_migration_paths
85
+ end
86
+ end
87
+
70
88
  namespace :migrate do
71
89
 
72
90
  desc "migrate cards"
73
91
  task :cards => :environment do
74
92
  Wagn::Cache.reset_global
75
93
  ENV['SCHEMA'] = "#{Wagn.gem_root}/db/schema.rb"
76
- Wagn.config.send_emails = false
94
+ Wagn.config.perform_deliveries = false
77
95
  Card # this is needed in production mode to insure core db structures are loaded before schema_mode is set
78
96
 
79
97
  paths = ActiveRecord::Migrator.migrations_paths = Wagn::MigrationHelper.card_migration_paths
@@ -87,7 +105,7 @@ namespace :wagn do
87
105
  desc 'write the version to a file (not usually called directly)' #maybe we should move this to a method?
88
106
  task :stamp, :suffix do |t, args|
89
107
  ENV['SCHEMA'] = "#{Wagn.gem_root}/db/schema.rb"
90
- Wagn.config.send_emails = false
108
+ Wagn.config.perform_deliveries = false
91
109
 
92
110
  stamp_file = Wagn::Version.schema_stamp_path args[:suffix]
93
111
  Wagn::MigrationHelper.schema_mode args[:suffix ] do
@@ -129,7 +147,7 @@ namespace :wagn do
129
147
  end
130
148
 
131
149
  # delete ignored cards
132
- Account.as_bot do
150
+ Card::Auth.as_bot do
133
151
  if ignoramus = Card['*ignore']
134
152
  ignoramus.item_cards.each do |card|
135
153
  if card.account #have to get rid of revisions to delete account
@@ -151,7 +169,6 @@ namespace :wagn do
151
169
  " (referee_id is not null and not exists (select * from cards where cards.id = card_references.referee_id)) or " +
152
170
  " ( referer_id is not null and not exists (select * from cards where cards.id = card_references.referer_id));"
153
171
  )
154
- ActiveRecord::Base.connection.delete( "delete from users where id > 2" ) #leave only anon and wagn bot
155
172
  Wagn::Cache.reset_global
156
173
 
157
174
  end
@@ -160,7 +177,7 @@ namespace :wagn do
160
177
  task :dump => :environment do
161
178
  Wagn::Cache.reset_global
162
179
 
163
- Rake::Task['wagn:bootstrap:mod_files'].invoke
180
+ Rake::Task['wagn:bootstrap:copy_mod_files'].invoke
164
181
 
165
182
  YAML::ENGINE.yamler = 'syck'
166
183
  # use old engine while we're supporting ruby 1.8.7 because it can't support Psych,
@@ -185,7 +202,7 @@ namespace :wagn do
185
202
  end
186
203
 
187
204
  desc "copy files from template database to standard mod and update cards"
188
- task :mod_files => :environment do
205
+ task :copy_mod_files => :environment do
189
206
  template_files_dir = "#{Wagn.root}/files"
190
207
  standard_files_dir = "#{Wagn.gem_root}/mods/standard/files"
191
208
 
@@ -1,5 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
+ require_dependency File.expand_path( '../reference', __FILE__ )
4
+
3
5
  module Card::Chunk
4
6
  class Include < Reference
5
7
  cattr_reader :options
@@ -1,4 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
3
+ require_dependency File.expand_path( '../reference', __FILE__ )
4
+
2
5
  module Card::Chunk
3
6
  class Link < Reference
4
7
  word = /\s*([^\]\|]+)\s*/
@@ -10,7 +10,7 @@ class Card
10
10
  attr_accessor :options_need_save, :start_time, :skip_autosave
11
11
 
12
12
  # builtin layouts allow for rescue / testing
13
- LAYOUTS = Wagn::Loader.load_layouts.merge 'none' => '{{_main}}'
13
+ LAYOUTS = Loader.load_layouts.merge 'none' => '{{_main}}'
14
14
 
15
15
  INCLUSION_DEFAULTS = {
16
16
  :layout => { :view => :core },
@@ -39,35 +39,31 @@ class Card
39
39
  ok? :comment
40
40
  end
41
41
 
42
- def get_layout_content(args)
43
- Account.as_bot do
44
- case
45
- when (params[:layout] || args[:layout]) ; layout_from_name args
46
- when card ; layout_from_card
47
- else ; LAYOUTS['default']
42
+ def get_layout_content
43
+ Auth.as_bot do
44
+ if requested_layout = params[:layout]
45
+ layout_from_card_or_code requested_layout
46
+ else
47
+ layout_from_rule
48
48
  end
49
49
  end
50
50
  end
51
51
 
52
- def layout_from_name args
53
- lname = (params[:layout] || args[:layout]).to_s
54
- lcard = Card.fetch(lname, :skip_virtual=>true, :skip_modules=>true)
55
- case
56
- when lcard && lcard.ok?(:read) ; lcard.content
57
- when hardcoded_layout = LAYOUTS[lname] ; hardcoded_layout
58
- else ; "<h1>Unknown layout: #{lname}</h1>Built-in Layouts: #{LAYOUTS.keys.join(', ')}"
52
+ def layout_from_rule
53
+ if rule = card.rule_card(:layout) and rule.type_id==Card::PointerID and layout_name=rule.item_names.first
54
+ layout_from_card_or_code layout_name
59
55
  end
60
56
  end
61
57
 
62
- def layout_from_card
63
- return unless rule_card = (card.rule_card(:layout) or Card.default_rule_card(:layout))
64
- #return unless rule_card.is_a?(Card::Set::Type::Pointer) and # type check throwing lots of warnings under cucumber: rule_card.type_id == Card::PointerID and
65
- return unless rule_card.type_id == Card::PointerID and
66
- layout_name=rule_card.item_names.first and
67
- !layout_name.nil? and
68
- lo_card = Card.fetch( layout_name, :skip_virtual => true, :skip_modules=>true ) and
69
- lo_card.ok?(:read)
70
- lo_card.content
58
+ def layout_from_card_or_code name
59
+ layout_card = Card.fetch name.to_s, :skip_virtual=>true, :skip_modules=>true
60
+ if layout_card and layout_card.ok? :read
61
+ layout_card.content
62
+ elsif hardcoded_layout = LAYOUTS[name]
63
+ hardcoded_layout
64
+ else
65
+ "<h1>Unknown layout: #{name}</h1>Built-in Layouts: #{LAYOUTS.keys.join(', ')}"
66
+ end
71
67
  end
72
68
 
73
69
  def slot_options args
@@ -128,6 +124,7 @@ class Card
128
124
  end
129
125
 
130
126
  def frame_and_form action, args={}, form_opts={}
127
+ form_opts.merge! args.delete(:form_opts) if args[:form_opts]
131
128
  form_opts[:hidden] = args.delete(:hidden)
132
129
  frame args do
133
130
  card_form action, form_opts do
@@ -143,14 +140,9 @@ class Card
143
140
  end
144
141
  end
145
142
 
146
-
147
143
  def wrap_main(content)
148
144
  return content if params[:layout]=='none'
149
- %{#{
150
- if flash[:notice]
151
- %{<div class="flash-notice">#{ flash[:notice] }</div>}
152
- end
153
- }<div id="main">#{content}</div>}
145
+ %{<div id="main">#{content}</div>}
154
146
  end
155
147
 
156
148
 
@@ -199,7 +191,7 @@ class Card
199
191
  <span class="render-error">
200
192
  error rendering
201
193
  #{
202
- if Account.always_ok?
194
+ if Auth.always_ok?
203
195
  %{
204
196
  #{ link_to_page error_cardname, nil, :class=>'render-error-link' }
205
197
  <div class="render-error-message errors-view" style="display:none">
@@ -251,7 +243,7 @@ class Card
251
243
  end
252
244
 
253
245
  def type_field args={}
254
- typelist = Account.createable_types
246
+ typelist = Auth.createable_types
255
247
  current_type = unless args.delete :no_current_type
256
248
  unless card.new_card? || typelist.include?( card.type_name )
257
249
  # current type should be an option on existing cards, regardless of create perms
@@ -281,7 +273,7 @@ class Card
281
273
  builder = ActionView::Base.default_form_builder
282
274
  card.name = card.name.gsub(/^#{Regexp.escape(root.card.name)}\+/, '+') if root.card.new_card? ##FIXME -- need to match other relative inclusions.
283
275
 
284
- builder.new("card[cards][#{card.relative_name}]", card, template, {}, block)
276
+ builder.new("card[subcards][#{card.relative_name}]", card, template, {}, block)
285
277
  end
286
278
 
287
279
  def form
@@ -312,7 +304,7 @@ class Card
312
304
  klasses << 'autosave' if action == :update
313
305
  html[:class] = klasses.join ' '
314
306
 
315
- html[:recaptcha] ||= 'on' if Wagn::Env[:recaptcha_on] && Card.toggle( card.rule(:captcha) )
307
+ html[:recaptcha] ||= 'on' if Card::Env.recaptcha_on? && Card.toggle( card.rule(:captcha) )
316
308
  html.delete :recaptcha if html[:recaptcha] == :off
317
309
 
318
310
  { :url=>url, :remote=>true, :html=>html }
@@ -360,10 +352,10 @@ class Card
360
352
  end
361
353
 
362
354
  def main?
363
- if ajax_call?
355
+ if Env.ajax?
364
356
  @depth == 0 && params[:is_main]
365
357
  else
366
- @depth == 1 && @mainline
358
+ @depth == 1 && @mainline #assumes layout includes {{_main}}
367
359
  end
368
360
  end
369
361
 
@@ -1,4 +1,6 @@
1
- # -*- encoding : utf-8 -*-
1
+ =begin
2
+
3
+ # following may be useful, but is neither tested nor in use
2
4
 
3
5
  def card_attributes
4
6
  if Card::Set.traits
@@ -15,7 +17,17 @@ def trait_var? var_name
15
17
  !instance_variable_get( var_name ).nil?
16
18
  end
17
19
 
20
+ =end
21
+
18
22
  def trait_var var_name, &block
19
- instance_variable_get( var_name ) ||
20
- instance_variable_set( var_name, block_given? ? yield : raise("no block?") )
23
+ # FIXME - following optimization attempt needs to handle cache clearing!
24
+ # instance_variable_get var_name or begin
25
+ # instance_variable_set var_name, block_given? ? yield : raise("no block?")
26
+ # end
27
+ yield
21
28
  end
29
+
30
+ #fixme -this needs a better home!
31
+ def format opts={}
32
+ Format.new self, opts
33
+ end
@@ -1,4 +1,4 @@
1
- # -*- encoding : utf-8 -*-
1
+
2
2
  class Updates
3
3
  include Enumerable
4
4
 
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
 
3
2
  module ClassMethods
4
3
 
@@ -18,7 +17,7 @@ module ClassMethods
18
17
  end
19
18
 
20
19
  def item_names(args={})
21
- Card::Format.new(self)._render_raw.split /[,\n]/
20
+ format._render_raw.split /[,\n]/
22
21
  end
23
22
 
24
23
  def item_cards(args={}) ## FIXME this is inconsistent with item_names
@@ -42,9 +41,9 @@ def extended_list context = nil
42
41
  # this could go on and on. more elegant to recurse until you don't have a collection
43
42
  end
44
43
 
45
- def contextual_content(context_card=nil, format_args={})
44
+ def contextual_content context_card, format_args={}
46
45
  format_args[:not_current] = true
47
- Card::Format.new(context_card, format_args).process_content(
48
- Card::Format.new(self, :not_current=>true)._render_raw
46
+ context_card.format(format_args).process_content(
47
+ self.format(:not_current=>true)._render_raw
49
48
  )
50
49
  end
@@ -1,14 +1,9 @@
1
- # -*- encoding : utf-8 -*-
2
1
  # = Card#fetch
3
2
  #
4
3
  # A multipurpose retrieval operator that incorporates caching, "virtual" card retrieval
5
4
 
6
5
  module ClassMethods
7
6
 
8
- def cache
9
- Wagn::Cache[Card]
10
- end
11
-
12
7
  # === fetch
13
8
  #
14
9
  # looks for cards in
@@ -23,89 +18,43 @@ module ClassMethods
23
18
  # :skip_modules Don't load Set modules
24
19
  # :new => { card opts } Return a new card when not found
25
20
  #
21
+
22
+
23
+ def fetch mark, opts={}
26
24
 
27
- def fetch mark, opts = {}
28
- # ActiveSupport::Notifications.instrument 'wagn.fetch', :message=>"fetch #{mark}" do
25
+ mark = Card::Codename[mark] if Symbol === mark # id from codename
29
26
 
30
- if mark.nil?
31
- return if opts[:new].nil?
27
+ if mark.present?
28
+ card, mark, needs_caching = fetch_from_cache_or_db mark, opts # have existing
32
29
  else
33
-
34
- if Symbol===mark
35
- mark = Card::Codename[mark] || raise( "Missing codename for #{mark.inspect}" )
36
- end
37
-
38
- cache_key, method, val = if Integer===mark
39
- [ "~#{mark}", :find_by_id_and_trash, mark ]
40
- else
41
- fullname = if opts[:new] && supercard = opts[:new][:supercard]
42
- mark.to_name.to_absolute_name supercard.name
43
- else
44
- mark.to_name
45
- end
46
- opts[:name] = mark = fullname.to_s # this is needed to correctly fetch missing cards with different name variants in cache
47
- key = fullname.key
48
- [ key, :find_by_key_and_trash, key ]
49
- end
50
-
51
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52
- # lookup card
53
-
54
- #Cache lookup
55
- result = Card.cache.read cache_key if Card.cache
56
- card = (result && Integer===mark) ? Card.cache.read(result) : result
57
-
58
- unless card
59
- # DB lookup
60
- needs_caching = true
61
- card = Card.send method, val, false
62
- end
30
+ return unless opts[:new]
63
31
  end
64
32
 
65
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
-
67
33
  if Integer===mark
68
- if card.nil?
69
- Rails.logger.info "fetch of missing card_id #{mark}" # should send this to airbrake
70
- return nil
71
- end
34
+ return if card.nil? || mark.nil?
72
35
  else
73
- if card && opts[:skip_virtual] && card.new_card? && opts[:new] != {}
74
- return card.renew(opts)
75
- end
76
-
77
- # NEW card -- (either virtual or missing)
78
- if card.nil? or ( card.type_id==-1 && ( !opts[:skip_virtual] || opts[:new]=={} ) )
79
- # The -1 type_id allows us to skip all the type lookup and flag the need for
80
- # reinitialization later. *** It should NEVER be seen elsewhere ***
81
- needs_caching = true
82
- new_args = { :name=>mark.to_s, :skip_modules=>true }
83
- new_args[:type_id] = -1 if opts[:skip_virtual] && opts[:new] != {}
84
- card = new new_args
85
- end
86
- end
87
-
88
- if Card.cache && needs_caching
89
- Card.cache.write card.key, card
90
- Card.cache.write "~#{card.id}", card.key if card.id and card.id != 0
36
+ return card.renew(opts) if card and card.eager_renew?(opts)
37
+ if !card or card.type_id==-1 && clean_cache_opts?(opts) # new (or improved) card for cache
38
+ needs_caching = true
39
+ card = new_for_cache mark, opts
40
+ end
91
41
  end
92
-
42
+
43
+ write_to_cache card if Card.cache && needs_caching
44
+
93
45
  if card.new_card?
94
- if opts[:new] == {}
95
- #noop default case; use cache.
96
- elsif !opts[:new].blank? || opts[:skip_virtual] || !card.virtual?
97
- return card.renew(opts)
98
- end
99
-
100
- if opts[:name] && opts[:name] != card.name
101
- card.name = opts[:name]
46
+ if opts[:new]
47
+ return card.renew(opts) if !clean_cache_opts? opts
48
+ else
49
+ return unless !opts[:skip_virtual] && card.virtual?
102
50
  end
51
+ card.name = mark.to_s if mark && mark.to_s != card.name
103
52
  end
104
53
 
105
54
  card.include_set_modules unless opts[:skip_modules]
106
55
  card
107
56
  end
108
-
57
+
109
58
  def fetch_id mark #should optimize this. what if mark is int? or codename?
110
59
  card = fetch mark, :skip_virtual=>true, :skip_modules=>true
111
60
  card and card.id
@@ -149,6 +98,69 @@ module ClassMethods
149
98
  Card.cache.write skey, h
150
99
  end
151
100
  end
101
+
102
+ def cache
103
+ Wagn::Cache[Card]
104
+ end
105
+
106
+ def fetch_from_cache cache_key
107
+ Card.cache.read cache_key if Card.cache
108
+ end
109
+
110
+ def fullname_from_name name, new_opts={}
111
+ if new_opts and supercard = new_opts[:supercard]
112
+ name.to_name.to_absolute_name supercard.name
113
+ else
114
+ name.to_name
115
+ end
116
+ end
117
+
118
+ def fetch_from_cache_or_db mark, opts
119
+ needs_caching = false
120
+ mark_type = Integer===mark ? :id : :key
121
+
122
+ if mark_type == :key
123
+ mark = fullname_from_name mark, opts[:new]
124
+ val = mark.key
125
+ else
126
+ val = mark
127
+ end
128
+
129
+ card = send( "fetch_from_cache_by_#{mark_type}", val ) || begin
130
+ needs_caching = true
131
+ send "find_by_#{mark_type}_and_trash", val, false
132
+ end
133
+
134
+ [ card, mark, needs_caching ]
135
+ end
136
+
137
+ def fetch_from_cache_by_id id
138
+ if name = fetch_from_cache("~#{id}")
139
+ fetch_from_cache name
140
+ end
141
+ end
142
+
143
+ def fetch_from_cache_by_key key
144
+ fetch_from_cache key
145
+ end
146
+
147
+ def new_for_cache name, opts
148
+ new_args = { :name=>name, :skip_modules=>true }
149
+ new_args[:type_id] = -1 unless clean_cache_opts? opts
150
+ # The -1 type_id allows us to skip all the type lookup and flag the need for
151
+ # reinitialization later. *** It should NEVER be seen elsewhere ***
152
+ new new_args
153
+ end
154
+
155
+ def clean_cache_opts? opts
156
+ !opts[:skip_virtual] && !opts[:new].present?
157
+ end
158
+
159
+ def write_to_cache card
160
+ Card.cache.write card.key, card
161
+ Card.cache.write "~#{card.id}", card.key if card.id and card.id != 0
162
+ end
163
+
152
164
 
153
165
  end
154
166
 
@@ -156,17 +168,17 @@ end
156
168
 
157
169
  def fetch opts={}
158
170
  if traits = opts.delete(:trait)
159
- traits = [traits] unless Array===traits
160
- traits.inject(self) { |card, trait| Card.fetch( card.cardname.trait(trait), opts ) }
171
+ traits = [traits] unless Array===traits
172
+ traits.inject(self) { |card, trait| Card.fetch( card.cardname.trait(trait), opts ) }
161
173
  end
162
174
  end
163
175
 
176
+
164
177
  def renew args={}
165
- if opts = args[:new]
166
- opts[:name] ||= cardname
167
- opts[:skip_modules] = args[:skip_modules]
168
- Card.new opts
169
- end
178
+ opts = args[:new].clone
179
+ opts[:name] ||= cardname
180
+ opts[:skip_modules] = args[:skip_modules]
181
+ Card.new opts
170
182
  end
171
183
 
172
184
  def expire_pieces
@@ -191,3 +203,9 @@ def refresh force=false
191
203
  self
192
204
  end
193
205
  end
206
+
207
+ def eager_renew? opts
208
+ opts[:skip_virtual] && new_card? && opts[:new].present?
209
+ end
210
+
211
+