Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Freezing Plugins to avoid dependency problems

  • Loading branch information...
commit 5b0446b4a8cabb8a5660e5a50ecb381d2a50e97c 1 parent 37d16c7
@merbjedi merbjedi authored
Showing with 24,022 additions and 75 deletions.
  1. +7 −1 config/deploy.rb
  2. +2 −74 config/environment.rb
  3. +23 −0 vendor/plugins/acts_as_list/README
  4. +27 −0 vendor/plugins/acts_as_list/acts_as_list.gemspec
  5. +1 −0  vendor/plugins/acts_as_list/init.rb
  6. +256 −0 vendor/plugins/acts_as_list/lib/acts_as_list.rb
  7. +2 −0  vendor/plugins/acts_as_list/rails/init.rb
  8. +332 −0 vendor/plugins/acts_as_list/test/list_test.rb
  9. +2 −0  vendor/plugins/app_config/.gitignore
  10. +20 −0 vendor/plugins/app_config/LICENSE
  11. +90 −0 vendor/plugins/app_config/README
  12. +54 −0 vendor/plugins/app_config/Rakefile
  13. +1 −0  vendor/plugins/app_config/init.rb
  14. +132 −0 vendor/plugins/app_config/lib/application_config/config_builder.rb
  15. +77 −0 vendor/plugins/app_config/lib/application_config/view_helpers.rb
  16. +47 −0 vendor/plugins/app_config/lib/merb_app_config.rb
  17. +17 −0 vendor/plugins/app_config/lib/merbtasks.rb
  18. +18 −0 vendor/plugins/app_config/rails/init.rb
  19. +75 −0 vendor/plugins/app_config/test/config_builder_test.rb
  20. +2 −0  vendor/plugins/app_config/test/test_configs/app_config.yml
  21. +5 −0 vendor/plugins/app_config/test/test_configs/development.yml
  22. 0  vendor/plugins/app_config/test/test_configs/empty1.yml
  23. 0  vendor/plugins/app_config/test/test_configs/empty2.yml
  24. +5 −0 vendor/plugins/app_config/test/test_configs/javascript_expander.yml
  25. 0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file1.js
  26. 0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file2.js
  27. 0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file3.js
  28. +5 −0 vendor/plugins/app_config/test/test_configs/stylesheet_expander.yml
  29. 0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file1
  30. 0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file2
  31. 0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file3
  32. +2 −0  vendor/plugins/auto_migrations/.gitignore
  33. +20 −0 vendor/plugins/auto_migrations/MIT-LICENSE
  34. +51 −0 vendor/plugins/auto_migrations/README
  35. +24 −0 vendor/plugins/auto_migrations/Rakefile
  36. +30 −0 vendor/plugins/auto_migrations/auto_migrations.gemspec
  37. +1 −0  vendor/plugins/auto_migrations/init.rb
  38. +142 −0 vendor/plugins/auto_migrations/lib/auto_migrations.rb
  39. +2 −0  vendor/plugins/auto_migrations/rails/init.rb
  40. +15 −0 vendor/plugins/auto_migrations/tasks/auto_migrations_tasks.rake
  41. +8 −0 vendor/plugins/auto_migrations/test/auto_migrations_test.rb
  42. +2 −0  vendor/plugins/better_partials/.gitignore
  43. +20 −0 vendor/plugins/better_partials/MIT-LICENSE
  44. +58 −0 vendor/plugins/better_partials/README
  45. +22 −0 vendor/plugins/better_partials/Rakefile
  46. +29 −0 vendor/plugins/better_partials/better_partials.gemspec
  47. +1 −0  vendor/plugins/better_partials/init.rb
  48. +89 −0 vendor/plugins/better_partials/lib/better_partials.rb
  49. +2 −0  vendor/plugins/better_partials/rails/init.rb
  50. +1 −0  vendor/plugins/better_partials/uninstall.rb
  51. +1 −0  vendor/plugins/exception_notification/.gitignore
  52. +20 −0 vendor/plugins/exception_notification/MIT-LICENSE
  53. +119 −0 vendor/plugins/exception_notification/README
  54. +41 −0 vendor/plugins/exception_notification/exception_notification.gemspec
  55. +1 −0  vendor/plugins/exception_notification/init.rb
  56. +72 −0 vendor/plugins/exception_notification/lib/exception_notifiable.rb
  57. 0  vendor/plugins/exception_notification/lib/exception_notification.rb
  58. +64 −0 vendor/plugins/exception_notification/lib/exception_notifier.rb
  59. +58 −0 vendor/plugins/exception_notification/lib/exception_notifier_helper.rb
  60. +8 −0 vendor/plugins/exception_notification/lib/notifiable.rb
  61. +5 −0 vendor/plugins/exception_notification/rails/init.rb
  62. +68 −0 vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb
  63. +7 −0 vendor/plugins/exception_notification/test/test_helper.rb
  64. +1 −0  vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml
  65. +7 −0 vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml
  66. +16 −0 vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml
  67. +5 −0 vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml
  68. +2 −0  vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml
  69. +3 −0  vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml
  70. +6 −0 vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml
  71. +2 −0  vendor/plugins/form_fu/.gitignore
  72. +20 −0 vendor/plugins/form_fu/LICENSE
  73. +89 −0 vendor/plugins/form_fu/README
  74. +30 −0 vendor/plugins/form_fu/form_fu.gemspec
  75. +1 −0  vendor/plugins/form_fu/init.rb
  76. +21 −0 vendor/plugins/form_fu/lib/form_fu.rb
  77. +120 −0 vendor/plugins/form_fu/lib/form_fu/form_builder.rb
  78. +123 −0 vendor/plugins/form_fu/lib/form_fu/helpers.rb
  79. +1 −0  vendor/plugins/form_fu/rails/init.rb
  80. +14 −0 vendor/plugins/form_fu/test/form_fu_test.rb
  81. +6 −0 vendor/plugins/paperclip/.gitignore
  82. +26 −0 vendor/plugins/paperclip/LICENSE
  83. +50 −0 vendor/plugins/paperclip/README.rdoc
  84. +88 −0 vendor/plugins/paperclip/Rakefile
  85. +5 −0 vendor/plugins/paperclip/generators/paperclip/USAGE
  86. +27 −0 vendor/plugins/paperclip/generators/paperclip/paperclip_generator.rb
  87. +19 −0 vendor/plugins/paperclip/generators/paperclip/templates/paperclip_migration.rb.erb
  88. +1 −0  vendor/plugins/paperclip/init.rb
  89. +246 −0 vendor/plugins/paperclip/lib/paperclip.rb
  90. +289 −0 vendor/plugins/paperclip/lib/paperclip/attachment.rb
  91. +109 −0 vendor/plugins/paperclip/lib/paperclip/geometry.rb
  92. +43 −0 vendor/plugins/paperclip/lib/paperclip/iostream.rb
  93. +204 −0 vendor/plugins/paperclip/lib/paperclip/storage.rb
  94. +82 −0 vendor/plugins/paperclip/lib/paperclip/thumbnail.rb
  95. +37 −0 vendor/plugins/paperclip/lib/paperclip/upfile.rb
  96. +53 −0 vendor/plugins/paperclip/paperclip.gemspec
  97. +1 −0  vendor/plugins/paperclip/rails/init.rb
  98. +32 −0 vendor/plugins/paperclip/shoulda_macros/paperclip.rb
  99. +79 −0 vendor/plugins/paperclip/tasks/paperclip_tasks.rake
  100. +1 −0  vendor/plugins/paperclip/test/.gitignore
  101. +301 −0 vendor/plugins/paperclip/test/attachment_test.rb
  102. +5 −0 vendor/plugins/paperclip/test/database.yml
  103. BIN  vendor/plugins/paperclip/test/fixtures/12k.png
  104. BIN  vendor/plugins/paperclip/test/fixtures/50x50.png
  105. BIN  vendor/plugins/paperclip/test/fixtures/5k.png
  106. +1 −0  vendor/plugins/paperclip/test/fixtures/bad.png
  107. 0  vendor/plugins/paperclip/test/fixtures/text.txt
  108. +142 −0 vendor/plugins/paperclip/test/geometry_test.rb
  109. +45 −0 vendor/plugins/paperclip/test/helper.rb
  110. +361 −0 vendor/plugins/paperclip/test/integration_test.rb
  111. +60 −0 vendor/plugins/paperclip/test/iostream_test.rb
  112. +148 −0 vendor/plugins/paperclip/test/paperclip_test.rb
  113. +153 −0 vendor/plugins/paperclip/test/storage_test.rb
  114. +107 −0 vendor/plugins/paperclip/test/thumbnail_test.rb
  115. +3 −0  vendor/plugins/seed-fu/.gitignore
  116. +66 −0 vendor/plugins/seed-fu/README
  117. +6 −0 vendor/plugins/seed-fu/Rakefile
  118. +1 −0  vendor/plugins/seed-fu/init.rb
  119. +6 −0 vendor/plugins/seed-fu/lib/autotest/discover.rb
  120. +96 −0 vendor/plugins/seed-fu/lib/seed-fu.rb
  121. +1 −0  vendor/plugins/seed-fu/rails/init.rb
  122. +31 −0 vendor/plugins/seed-fu/seed-fu.gemspec
  123. +8 −0 vendor/plugins/seed-fu/spec/schema.rb
  124. +73 −0 vendor/plugins/seed-fu/spec/seed_fu_spec.rb
  125. +8 −0 vendor/plugins/seed-fu/spec/spec_helper.rb
  126. +29 −0 vendor/plugins/seed-fu/tasks/seed_fu_tasks.rake
  127. +9 −0 vendor/plugins/validates_as_email_address/CHANGELOG
  128. +2 −0  vendor/plugins/validates_as_email_address/LICENSE
  129. +51 −0 vendor/plugins/validates_as_email_address/README
  130. +79 −0 vendor/plugins/validates_as_email_address/Rakefile
  131. +1 −0  vendor/plugins/validates_as_email_address/init.rb
  132. +87 −0 vendor/plugins/validates_as_email_address/lib/validates_as_email_address.rb
  133. +18 −0 vendor/plugins/validates_as_email_address/lib/validates_as_email_address/rfc_822.rb
  134. +1 −0  vendor/plugins/validates_as_email_address/rails/init.rb
  135. +3 −0  vendor/plugins/validates_as_email_address/test/app_root/app/models/user.rb
  136. +11 −0 vendor/plugins/validates_as_email_address/test/app_root/db/migrate/001_create_users.rb
  137. +39 −0 vendor/plugins/validates_as_email_address/test/app_root/log/in_memory.log
  138. +7 −0 vendor/plugins/validates_as_email_address/test/test_helper.rb
  139. +29 −0 vendor/plugins/validates_as_email_address/test/unit/validates_as_email_address_test.rb
  140. +33 −0 vendor/plugins/validates_as_email_address/validates_as_email_address.gemspec
  141. +2 −0  vendor/plugins/view_fu/.gitignore
  142. +40 −0 vendor/plugins/view_fu/MIT-LICENSE
  143. +145 −0 vendor/plugins/view_fu/README
  144. +22 −0 vendor/plugins/view_fu/Rakefile
  145. +1 −0  vendor/plugins/view_fu/init.rb
  146. +45 −0 vendor/plugins/view_fu/lib/browser_detect/helper.rb
  147. +118 −0 vendor/plugins/view_fu/lib/headliner/README
  148. +65 −0 vendor/plugins/view_fu/lib/headliner/helper.rb
  149. +87 −0 vendor/plugins/view_fu/lib/javascripter/README
  150. +112 −0 vendor/plugins/view_fu/lib/javascripter/helper.rb
  151. +95 −0 vendor/plugins/view_fu/lib/styler/README
  152. +117 −0 vendor/plugins/view_fu/lib/styler/helper.rb
  153. +18 −0 vendor/plugins/view_fu/lib/view_fu.rb
  154. +13 −0 vendor/plugins/view_fu/lib/view_fu/controller_extensions.rb
  155. +51 −0 vendor/plugins/view_fu/lib/view_fu/meta_helper.rb
  156. +166 −0 vendor/plugins/view_fu/lib/view_fu/tag_helper.rb
  157. +1 −0  vendor/plugins/view_fu/rails/init.rb
  158. +14 −0 vendor/plugins/view_fu/test/browser_detect_test.rb
  159. +106 −0 vendor/plugins/view_fu/test/headliner_test.rb
  160. +14 −0 vendor/plugins/view_fu/test/styler_test.rb
  161. +16 −0 vendor/plugins/view_fu/test/view_fu_test.rb
  162. +42 −0 vendor/plugins/view_fu/view_fu.gemspec
  163. +4 −0 vendor/plugins/will_paginate/.gitignore
  164. +49 −0 vendor/plugins/will_paginate/.manifest
  165. +92 −0 vendor/plugins/will_paginate/CHANGELOG
  166. +18 −0 vendor/plugins/will_paginate/LICENSE
  167. +131 −0 vendor/plugins/will_paginate/README.rdoc
  168. +62 −0 vendor/plugins/will_paginate/Rakefile
  169. BIN  vendor/plugins/will_paginate/examples/apple-circle.gif
  170. +69 −0 vendor/plugins/will_paginate/examples/index.haml
  171. +92 −0 vendor/plugins/will_paginate/examples/index.html
  172. +90 −0 vendor/plugins/will_paginate/examples/pagination.css
  173. +91 −0 vendor/plugins/will_paginate/examples/pagination.sass
  174. +1 −0  vendor/plugins/will_paginate/init.rb
  175. +86 −0 vendor/plugins/will_paginate/lib/will_paginate.rb
  176. +16 −0 vendor/plugins/will_paginate/lib/will_paginate/array.rb
  177. +145 −0 vendor/plugins/will_paginate/lib/will_paginate/collection.rb
  178. +32 −0 vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb
  179. +247 −0 vendor/plugins/will_paginate/lib/will_paginate/finder.rb
  180. +132 −0 vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb
  181. +39 −0 vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb
  182. +9 −0 vendor/plugins/will_paginate/lib/will_paginate/version.rb
  183. +373 −0 vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb
  184. +21 −0 vendor/plugins/will_paginate/test/boot.rb
  185. +140 −0 vendor/plugins/will_paginate/test/collection_test.rb
  186. +8 −0 vendor/plugins/will_paginate/test/console
  187. +22 −0 vendor/plugins/will_paginate/test/database.yml
  188. +434 −0 vendor/plugins/will_paginate/test/finder_test.rb
  189. +3 −0  vendor/plugins/will_paginate/test/fixtures/admin.rb
  190. +13 −0 vendor/plugins/will_paginate/test/fixtures/developer.rb
  191. +13 −0 vendor/plugins/will_paginate/test/fixtures/developers_projects.yml
  192. +15 −0 vendor/plugins/will_paginate/test/fixtures/project.rb
  193. +6 −0 vendor/plugins/will_paginate/test/fixtures/projects.yml
  194. +29 −0 vendor/plugins/will_paginate/test/fixtures/replies.yml
  195. +7 −0 vendor/plugins/will_paginate/test/fixtures/reply.rb
  196. +38 −0 vendor/plugins/will_paginate/test/fixtures/schema.rb
  197. +6 −0 vendor/plugins/will_paginate/test/fixtures/topic.rb
  198. +30 −0 vendor/plugins/will_paginate/test/fixtures/topics.yml
  199. +2 −0  vendor/plugins/will_paginate/test/fixtures/user.rb
  200. +35 −0 vendor/plugins/will_paginate/test/fixtures/users.yml
  201. +37 −0 vendor/plugins/will_paginate/test/helper.rb
  202. +36 −0 vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb
  203. +69 −0 vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb
  204. +11 −0 vendor/plugins/will_paginate/test/lib/load_fixtures.rb
  205. +165 −0 vendor/plugins/will_paginate/test/lib/view_test_process.rb
  206. +56 −0 vendor/plugins/will_paginate/test/tasks.rake
  207. +355 −0 vendor/plugins/will_paginate/test/view_test.rb
  208. +21 −0 vendor/plugins/will_paginate/will_paginate.gemspec
  209. +14 −0 vendor/rails/.gitignore
  210. +21 −0 vendor/rails/Rakefile
  211. +336 −0 vendor/rails/actionmailer/CHANGELOG
  212. +21 −0 vendor/rails/actionmailer/MIT-LICENSE
  213. +149 −0 vendor/rails/actionmailer/README
  214. +97 −0 vendor/rails/actionmailer/Rakefile
  215. +30 −0 vendor/rails/actionmailer/install.rb
  216. +52 −0 vendor/rails/actionmailer/lib/action_mailer.rb
  217. +30 −0 vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb
  218. +646 −0 vendor/rails/actionmailer/lib/action_mailer/base.rb
  219. +111 −0 vendor/rails/actionmailer/lib/action_mailer/helpers.rb
  220. +19 −0 vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb
  221. +110 −0 vendor/rails/actionmailer/lib/action_mailer/part.rb
  222. +51 −0 vendor/rails/actionmailer/lib/action_mailer/part_container.rb
  223. +61 −0 vendor/rails/actionmailer/lib/action_mailer/quoting.rb
  224. +64 −0 vendor/rails/actionmailer/lib/action_mailer/test_case.rb
  225. +67 −0 vendor/rails/actionmailer/lib/action_mailer/test_helper.rb
  226. +8 −0 vendor/rails/actionmailer/lib/action_mailer/utils.rb
  227. +14 −0 vendor/rails/actionmailer/lib/action_mailer/vendor.rb
  228. +1,466 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
  229. +5 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb
  230. +426 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
  231. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb
  232. +46 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb
  233. +41 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb
  234. +67 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb
  235. +63 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb
  236. +581 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb
  237. +960 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
  238. +9 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb
  239. +1,130 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
  240. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb
  241. +578 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
  242. +495 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb
  243. +6 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb
  244. +3 −0  vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb
  245. +248 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb
  246. +132 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb
  247. +1,476 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb
  248. +379 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb
  249. +118 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb
  250. +58 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb
  251. +49 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb
  252. +261 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb
  253. +280 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb
  254. +337 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb
  255. +39 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb
  256. +9 −0 vendor/rails/actionmailer/lib/action_mailer/version.rb
  257. +1 −0  vendor/rails/actionmailer/lib/actionmailer.rb
  258. +49 −0 vendor/rails/actionmailer/test/abstract_unit.rb
  259. +51 −0 vendor/rails/actionmailer/test/delivery_method_test.rb
  260. +1 −0  vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb
  261. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
  262. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb
  263. +1 −0  vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
  264. +5 −0 vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
  265. +5 −0 vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb
  266. +1 −0  ...ails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
  267. +14 −0 vendor/rails/actionmailer/test/fixtures/raw_email
  268. +20 −0 vendor/rails/actionmailer/test/fixtures/raw_email10
  269. +32 −0 vendor/rails/actionmailer/test/fixtures/raw_email12
  270. +29 −0 vendor/rails/actionmailer/test/fixtures/raw_email13
  271. +114 −0 vendor/rails/actionmailer/test/fixtures/raw_email2
  272. +70 −0 vendor/rails/actionmailer/test/fixtures/raw_email3
  273. +59 −0 vendor/rails/actionmailer/test/fixtures/raw_email4
  274. +19 −0 vendor/rails/actionmailer/test/fixtures/raw_email5
  275. +20 −0 vendor/rails/actionmailer/test/fixtures/raw_email6
  276. +66 −0 vendor/rails/actionmailer/test/fixtures/raw_email7
  277. +47 −0 vendor/rails/actionmailer/test/fixtures/raw_email8
  278. +28 −0 vendor/rails/actionmailer/test/fixtures/raw_email9
  279. +14 −0 vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a
  280. +104 −0 vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type
  281. +100 −0 vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment
  282. +14 −0 vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject
  283. +1 −0  vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb
  284. +3 −0  vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb
  285. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb
  286. +6 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml
  287. +6 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml
  288. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
  289. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.rhtml.bak
  290. +10 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
  291. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
  292. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
  293. +1 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb
  294. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder
  295. +2 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml
  296. +3 −0  vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb
  297. +5 −0 vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
  298. +95 −0 vendor/rails/actionmailer/test/mail_helper_test.rb
  299. +122 −0 vendor/rails/actionmailer/test/mail_render_test.rb
  300. +979 −0 vendor/rails/actionmailer/test/mail_service_test.rb
Sorry, we could not display the entire diff because too many files (1,621) changed.
View
8 config/deploy.rb
@@ -76,11 +76,17 @@
before "deploy:restart", "admin:migrate"
after "deploy", "live:send_request"
+after "deploy:setup", "init:set_permissions"
after "deploy:setup", "init:database_yml"
after "deploy:setup", "init:create_database"
after "deploy:setup", "init:create_vhost"
after "deploy:setup", "init:enable_site"
namespace :init do
+ desc "setting proper permissions for deploy user"
+ task :set_permissions do
+ sudo "chown -R deploy /var/www/production"
+ end
+
desc "create mysql db"
task :create_database do
#create the database on setup
@@ -132,8 +138,8 @@
end
-after "deploy:update_code", "localize:install_gems"
after "deploy:update_code", "localize:copy_shared_configurations"
+after "deploy:update_code", "localize:install_gems"
after "deploy:update_code", "localize:merge_assets"
namespace :localize do
View
76 config/environment.rb
@@ -4,8 +4,8 @@
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
+# # Specifies gem version of Rails to use when vendor/rails is not present
+# RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -69,77 +69,5 @@
# Gem Requirements
config.gem "haml", :version => ">= 2.0.0"
- # exception_notification
- # ------
- # Allows unhandled exceptions to be emailed on production
- # ------
- config.github_gem 'jcnetdev-exception_notification', :version => '>= 1.1'
-
- # acts_as_list
- # ------
- # Allows ActiveRecord Models to be easily ordered via position attributes
- # ------
- config.github_gem 'jcnetdev-acts_as_list', :version => '>= 1.0'
-
- # app_config
- # ------
- # Allow application wide configuration settings via YML files
- # ------
- config.github_gem 'jcnetdev-app_config', :version => '>= 1.0'
-
- # auto_migrations
- # ------
- # Allows migrations to be run automatically based on updating the schema.rb
- # ------
- config.github_gem 'jcnetdev-auto_migrations', :version => '>= 1.2'
-
- # better_partials
- # ------
- # Adds a helper (partial) that wraps around render :partial. Pass local variables and blocks to your partials easily
- # ------
- config.github_gem 'jcnetdev-better_partials', :version => '>= 1.0'
-
- # form_fu
- # ------
- # Allows easier rails form creation and processing
- # ------
- config.github_gem 'neorails-form_fu', :version => '>= 0.51'
-
- # paperclip
- # ------
- # Allows easy uploading of files
- # ------
- config.github_gem 'jcnetdev-paperclip', :version => '>= 1.0'
-
- # seed-fu
- # ------
- # Allows easier database seeding of tables
- # ------
- config.github_gem 'jcnetdev-seed-fu', :version => '>= 1.0'
-
- # subdomain-fu
- # ------
- # Allows easier subdomain selection
- # ------
- # config.github_gem 'jcnetdev-subdomain-fu', :version => '>= 0.0.2'
-
- # validates_as_email_address
- # ------
- # Allows for easy format validation of email addresses
- # ------
- config.github_gem 'jcnetdev-validates_as_email_address', :version => '>= 1.0'
-
- # will_paginate
- # ------
- # Allows nice and easy pagination
- # ------
- config.github_gem 'jcnetdev-will_paginate', :version => '>= 2.3.2'
-
- # view_fu
- # ------
- # Adds view helpers for titles, stylesheets, javascripts, and common tags
- # ------
- config.github_gem 'neorails-view_fu', :version => '>= 0.3'
-
end
View
23 vendor/plugins/acts_as_list/README
@@ -0,0 +1,23 @@
+ActsAsList
+==========
+
+This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a +position+ column defined as an integer on the mapped database table.
+
+
+Example
+=======
+
+ class TodoList < ActiveRecord::Base
+ has_many :todo_items, :order => "position"
+ end
+
+ class TodoItem < ActiveRecord::Base
+ belongs_to :todo_list
+ acts_as_list :scope => :todo_list
+ end
+
+ todo_list.first.move_to_bottom
+ todo_list.last.move_higher
+
+
+Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license
View
27 vendor/plugins/acts_as_list/acts_as_list.gemspec
@@ -0,0 +1,27 @@
+Gem::Specification.new do |s|
+ s.name = 'acts_as_list'
+ s.version = '1.0.20080704'
+ s.date = '2008-07-04'
+
+ s.summary = "Allows ActiveRecord Models to be easily ordered via position attributes"
+ s.description = ""
+
+ s.authors = ["RailsJedi", 'David Heinemeier Hansson']
+ s.email = 'railsjedi@gmail.com'
+ s.homepage = 'http://github.com/jcnetdev/acts_as_list'
+
+ s.has_rdoc = true
+ s.rdoc_options = ["--main", "README"]
+ s.extra_rdoc_files = ["README"]
+
+ s.add_dependency 'rails', ['>= 2.1']
+
+ s.files = ["README",
+ "acts_as_list.gemspec",
+ "init.rb",
+ "lib/acts_as_list.rb",
+ "rails/init.rb"]
+
+ s.test_files = ["test/list_test.rb"]
+
+end
View
1  vendor/plugins/acts_as_list/init.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + "/rails/init"
View
256 vendor/plugins/acts_as_list/lib/acts_as_list.rb
@@ -0,0 +1,256 @@
+module ActiveRecord
+ module Acts #:nodoc:
+ module List #:nodoc:
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+
+ # This +acts_as+ extension provides the capabilities for sorting and reordering a number of objects in a list.
+ # The class that has this specified needs to have a +position+ column defined as an integer on
+ # the mapped database table.
+ #
+ # Todo list example:
+ #
+ # class TodoList < ActiveRecord::Base
+ # has_many :todo_items, :order => "position"
+ # end
+ #
+ # class TodoItem < ActiveRecord::Base
+ # belongs_to :todo_list
+ # acts_as_list :scope => :todo_list
+ # end
+ #
+ # todo_list.first.move_to_bottom
+ # todo_list.last.move_higher
+ module ClassMethods
+ # Configuration options are:
+ #
+ # * +column+ - specifies the column name to use for keeping the position integer (default: +position+)
+ # * +scope+ - restricts what is to be considered a list. Given a symbol, it'll attach <tt>_id</tt>
+ # (if it hasn't already been added) and use that as the foreign key restriction. It's also possible
+ # to give it an entire string that is interpolated if you need a tighter scope than just a foreign key.
+ # Example: <tt>acts_as_list :scope => 'todo_list_id = #{todo_list_id} AND completed = 0'</tt>
+ def acts_as_list(options = {})
+ configuration = { :column => "position", :scope => "1 = 1" }
+ configuration.update(options) if options.is_a?(Hash)
+
+ configuration[:scope] = "#{configuration[:scope]}_id".intern if configuration[:scope].is_a?(Symbol) && configuration[:scope].to_s !~ /_id$/
+
+ if configuration[:scope].is_a?(Symbol)
+ scope_condition_method = %(
+ def scope_condition
+ if #{configuration[:scope].to_s}.nil?
+ "#{configuration[:scope].to_s} IS NULL"
+ else
+ "#{configuration[:scope].to_s} = \#{#{configuration[:scope].to_s}}"
+ end
+ end
+ )
+ else
+ scope_condition_method = "def scope_condition() \"#{configuration[:scope]}\" end"
+ end
+
+ class_eval <<-EOV
+ include ActiveRecord::Acts::List::InstanceMethods
+
+ def acts_as_list_class
+ ::#{self.name}
+ end
+
+ def position_column
+ '#{configuration[:column]}'
+ end
+
+ #{scope_condition_method}
+
+ before_destroy :remove_from_list
+ before_create :add_to_list_bottom
+ EOV
+ end
+ end
+
+ # All the methods available to a record that has had <tt>acts_as_list</tt> specified. Each method works
+ # by assuming the object to be the item in the list, so <tt>chapter.move_lower</tt> would move that chapter
+ # lower in the list of all chapters. Likewise, <tt>chapter.first?</tt> would return +true+ if that chapter is
+ # the first in the list of all chapters.
+ module InstanceMethods
+ # Insert the item at the given position (defaults to the top position of 1).
+ def insert_at(position = 1)
+ insert_at_position(position)
+ end
+
+ # Swap positions with the next lower item, if one exists.
+ def move_lower
+ return unless lower_item
+
+ acts_as_list_class.transaction do
+ lower_item.decrement_position
+ increment_position
+ end
+ end
+
+ # Swap positions with the next higher item, if one exists.
+ def move_higher
+ return unless higher_item
+
+ acts_as_list_class.transaction do
+ higher_item.increment_position
+ decrement_position
+ end
+ end
+
+ # Move to the bottom of the list. If the item is already in the list, the items below it have their
+ # position adjusted accordingly.
+ def move_to_bottom
+ return unless in_list?
+ acts_as_list_class.transaction do
+ decrement_positions_on_lower_items
+ assume_bottom_position
+ end
+ end
+
+ # Move to the top of the list. If the item is already in the list, the items above it have their
+ # position adjusted accordingly.
+ def move_to_top
+ return unless in_list?
+ acts_as_list_class.transaction do
+ increment_positions_on_higher_items
+ assume_top_position
+ end
+ end
+
+ # Removes the item from the list.
+ def remove_from_list
+ if in_list?
+ decrement_positions_on_lower_items
+ update_attribute position_column, nil
+ end
+ end
+
+ # Increase the position of this item without adjusting the rest of the list.
+ def increment_position
+ return unless in_list?
+ update_attribute position_column, self.send(position_column).to_i + 1
+ end
+
+ # Decrease the position of this item without adjusting the rest of the list.
+ def decrement_position
+ return unless in_list?
+ update_attribute position_column, self.send(position_column).to_i - 1
+ end
+
+ # Return +true+ if this object is the first in the list.
+ def first?
+ return false unless in_list?
+ self.send(position_column) == 1
+ end
+
+ # Return +true+ if this object is the last in the list.
+ def last?
+ return false unless in_list?
+ self.send(position_column) == bottom_position_in_list
+ end
+
+ # Return the next higher item in the list.
+ def higher_item
+ return nil unless in_list?
+ acts_as_list_class.find(:first, :conditions =>
+ "#{scope_condition} AND #{position_column} = #{(send(position_column).to_i - 1).to_s}"
+ )
+ end
+
+ # Return the next lower item in the list.
+ def lower_item
+ return nil unless in_list?
+ acts_as_list_class.find(:first, :conditions =>
+ "#{scope_condition} AND #{position_column} = #{(send(position_column).to_i + 1).to_s}"
+ )
+ end
+
+ # Test if this record is in a list
+ def in_list?
+ !send(position_column).nil?
+ end
+
+ private
+ def add_to_list_top
+ increment_positions_on_all_items
+ end
+
+ def add_to_list_bottom
+ self[position_column] = bottom_position_in_list.to_i + 1
+ end
+
+ # Overwrite this method to define the scope of the list changes
+ def scope_condition() "1" end
+
+ # Returns the bottom position number in the list.
+ # bottom_position_in_list # => 2
+ def bottom_position_in_list(except = nil)
+ item = bottom_item(except)
+ item ? item.send(position_column) : 0
+ end
+
+ # Returns the bottom item
+ def bottom_item(except = nil)
+ conditions = scope_condition
+ conditions = "#{conditions} AND #{self.class.primary_key} != #{except.id}" if except
+ acts_as_list_class.find(:first, :conditions => conditions, :order => "#{position_column} DESC")
+ end
+
+ # Forces item to assume the bottom position in the list.
+ def assume_bottom_position
+ update_attribute(position_column, bottom_position_in_list(self).to_i + 1)
+ end
+
+ # Forces item to assume the top position in the list.
+ def assume_top_position
+ update_attribute(position_column, 1)
+ end
+
+ # This has the effect of moving all the higher items up one.
+ def decrement_positions_on_higher_items(position)
+ acts_as_list_class.update_all(
+ "#{position_column} = (#{position_column} - 1)", "#{scope_condition} AND #{position_column} <= #{position}"
+ )
+ end
+
+ # This has the effect of moving all the lower items up one.
+ def decrement_positions_on_lower_items
+ return unless in_list?
+ acts_as_list_class.update_all(
+ "#{position_column} = (#{position_column} - 1)", "#{scope_condition} AND #{position_column} > #{send(position_column).to_i}"
+ )
+ end
+
+ # This has the effect of moving all the higher items down one.
+ def increment_positions_on_higher_items
+ return unless in_list?
+ acts_as_list_class.update_all(
+ "#{position_column} = (#{position_column} + 1)", "#{scope_condition} AND #{position_column} < #{send(position_column).to_i}"
+ )
+ end
+
+ # This has the effect of moving all the lower items down one.
+ def increment_positions_on_lower_items(position)
+ acts_as_list_class.update_all(
+ "#{position_column} = (#{position_column} + 1)", "#{scope_condition} AND #{position_column} >= #{position}"
+ )
+ end
+
+ # Increments position (<tt>position_column</tt>) of all items in the list.
+ def increment_positions_on_all_items
+ acts_as_list_class.update_all(
+ "#{position_column} = (#{position_column} + 1)", "#{scope_condition}"
+ )
+ end
+
+ def insert_at_position(position)
+ remove_from_list
+ increment_positions_on_lower_items(position)
+ self.update_attribute(position_column, position)
+ end
+ end
+ end
+ end
+end
View
2  vendor/plugins/acts_as_list/rails/init.rb
@@ -0,0 +1,2 @@
+require 'acts_as_list'
+ActiveRecord::Base.class_eval { include ActiveRecord::Acts::List }
View
332 vendor/plugins/acts_as_list/test/list_test.rb
@@ -0,0 +1,332 @@
+require 'test/unit'
+
+require 'rubygems'
+gem 'activerecord', '>= 1.15.4.7794'
+require 'active_record'
+
+require "#{File.dirname(__FILE__)}/../init"
+
+ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
+
+def setup_db
+ ActiveRecord::Schema.define(:version => 1) do
+ create_table :mixins do |t|
+ t.column :pos, :integer
+ t.column :parent_id, :integer
+ t.column :created_at, :datetime
+ t.column :updated_at, :datetime
+ end
+ end
+end
+
+def teardown_db
+ ActiveRecord::Base.connection.tables.each do |table|
+ ActiveRecord::Base.connection.drop_table(table)
+ end
+end
+
+class Mixin < ActiveRecord::Base
+end
+
+class ListMixin < Mixin
+ acts_as_list :column => "pos", :scope => :parent
+
+ def self.table_name() "mixins" end
+end
+
+class ListMixinSub1 < ListMixin
+end
+
+class ListMixinSub2 < ListMixin
+end
+
+class ListWithStringScopeMixin < ActiveRecord::Base
+ acts_as_list :column => "pos", :scope => 'parent_id = #{parent_id}'
+
+ def self.table_name() "mixins" end
+end
+
+
+class ListTest < Test::Unit::TestCase
+
+ def setup
+ setup_db
+ (1..4).each { |counter| ListMixin.create! :pos => counter, :parent_id => 5 }
+ end
+
+ def teardown
+ teardown_db
+ end
+
+ def test_reordering
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_lower
+ assert_equal [1, 3, 2, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_higher
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(1).move_to_bottom
+ assert_equal [2, 3, 4, 1], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(1).move_to_top
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_to_bottom
+ assert_equal [1, 3, 4, 2], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(4).move_to_top
+ assert_equal [4, 1, 3, 2], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+ end
+
+ def test_move_to_bottom_with_next_to_last_item
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+ ListMixin.find(3).move_to_bottom
+ assert_equal [1, 2, 4, 3], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+ end
+
+ def test_next_prev
+ assert_equal ListMixin.find(2), ListMixin.find(1).lower_item
+ assert_nil ListMixin.find(1).higher_item
+ assert_equal ListMixin.find(3), ListMixin.find(4).higher_item
+ assert_nil ListMixin.find(4).lower_item
+ end
+
+ def test_injection
+ item = ListMixin.new(:parent_id => 1)
+ assert_equal "parent_id = 1", item.scope_condition
+ assert_equal "pos", item.position_column
+ end
+
+ def test_insert
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 1, new.pos
+ assert new.first?
+ assert new.last?
+
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 2, new.pos
+ assert !new.first?
+ assert new.last?
+
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 3, new.pos
+ assert !new.first?
+ assert new.last?
+
+ new = ListMixin.create(:parent_id => 0)
+ assert_equal 1, new.pos
+ assert new.first?
+ assert new.last?
+ end
+
+ def test_insert_at
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 1, new.pos
+
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 2, new.pos
+
+ new = ListMixin.create(:parent_id => 20)
+ assert_equal 3, new.pos
+
+ new4 = ListMixin.create(:parent_id => 20)
+ assert_equal 4, new4.pos
+
+ new4.insert_at(3)
+ assert_equal 3, new4.pos
+
+ new.reload
+ assert_equal 4, new.pos
+
+ new.insert_at(2)
+ assert_equal 2, new.pos
+
+ new4.reload
+ assert_equal 4, new4.pos
+
+ new5 = ListMixin.create(:parent_id => 20)
+ assert_equal 5, new5.pos
+
+ new5.insert_at(1)
+ assert_equal 1, new5.pos
+
+ new4.reload
+ assert_equal 5, new4.pos
+ end
+
+ def test_delete_middle
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).destroy
+
+ assert_equal [1, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(1).pos
+ assert_equal 2, ListMixin.find(3).pos
+ assert_equal 3, ListMixin.find(4).pos
+
+ ListMixin.find(1).destroy
+
+ assert_equal [3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(3).pos
+ assert_equal 2, ListMixin.find(4).pos
+ end
+
+ def test_with_string_based_scope
+ new = ListWithStringScopeMixin.create(:parent_id => 500)
+ assert_equal 1, new.pos
+ assert new.first?
+ assert new.last?
+ end
+
+ def test_nil_scope
+ new1, new2, new3 = ListMixin.create, ListMixin.create, ListMixin.create
+ new2.move_higher
+ assert_equal [new2, new1, new3], ListMixin.find(:all, :conditions => 'parent_id IS NULL', :order => 'pos')
+ end
+
+
+ def test_remove_from_list_should_then_fail_in_list?
+ assert_equal true, ListMixin.find(1).in_list?
+ ListMixin.find(1).remove_from_list
+ assert_equal false, ListMixin.find(1).in_list?
+ end
+
+ def test_remove_from_list_should_set_position_to_nil
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).remove_from_list
+
+ assert_equal [2, 1, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(1).pos
+ assert_equal nil, ListMixin.find(2).pos
+ assert_equal 2, ListMixin.find(3).pos
+ assert_equal 3, ListMixin.find(4).pos
+ end
+
+ def test_remove_before_destroy_does_not_shift_lower_items_twice
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).remove_from_list
+ ListMixin.find(2).destroy
+
+ assert_equal [1, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(1).pos
+ assert_equal 2, ListMixin.find(3).pos
+ assert_equal 3, ListMixin.find(4).pos
+ end
+
+end
+
+class ListSubTest < Test::Unit::TestCase
+
+ def setup
+ setup_db
+ (1..4).each { |i| ((i % 2 == 1) ? ListMixinSub1 : ListMixinSub2).create! :pos => i, :parent_id => 5000 }
+ end
+
+ def teardown
+ teardown_db
+ end
+
+ def test_reordering
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_lower
+ assert_equal [1, 3, 2, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_higher
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(1).move_to_bottom
+ assert_equal [2, 3, 4, 1], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(1).move_to_top
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).move_to_bottom
+ assert_equal [1, 3, 4, 2], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(4).move_to_top
+ assert_equal [4, 1, 3, 2], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+ end
+
+ def test_move_to_bottom_with_next_to_last_item
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+ ListMixin.find(3).move_to_bottom
+ assert_equal [1, 2, 4, 3], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+ end
+
+ def test_next_prev
+ assert_equal ListMixin.find(2), ListMixin.find(1).lower_item
+ assert_nil ListMixin.find(1).higher_item
+ assert_equal ListMixin.find(3), ListMixin.find(4).higher_item
+ assert_nil ListMixin.find(4).lower_item
+ end
+
+ def test_injection
+ item = ListMixin.new("parent_id"=>1)
+ assert_equal "parent_id = 1", item.scope_condition
+ assert_equal "pos", item.position_column
+ end
+
+ def test_insert_at
+ new = ListMixin.create("parent_id" => 20)
+ assert_equal 1, new.pos
+
+ new = ListMixinSub1.create("parent_id" => 20)
+ assert_equal 2, new.pos
+
+ new = ListMixinSub2.create("parent_id" => 20)
+ assert_equal 3, new.pos
+
+ new4 = ListMixin.create("parent_id" => 20)
+ assert_equal 4, new4.pos
+
+ new4.insert_at(3)
+ assert_equal 3, new4.pos
+
+ new.reload
+ assert_equal 4, new.pos
+
+ new.insert_at(2)
+ assert_equal 2, new.pos
+
+ new4.reload
+ assert_equal 4, new4.pos
+
+ new5 = ListMixinSub1.create("parent_id" => 20)
+ assert_equal 5, new5.pos
+
+ new5.insert_at(1)
+ assert_equal 1, new5.pos
+
+ new4.reload
+ assert_equal 5, new4.pos
+ end
+
+ def test_delete_middle
+ assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ ListMixin.find(2).destroy
+
+ assert_equal [1, 3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(1).pos
+ assert_equal 2, ListMixin.find(3).pos
+ assert_equal 3, ListMixin.find(4).pos
+
+ ListMixin.find(1).destroy
+
+ assert_equal [3, 4], ListMixin.find(:all, :conditions => 'parent_id = 5000', :order => 'pos').map(&:id)
+
+ assert_equal 1, ListMixin.find(3).pos
+ assert_equal 2, ListMixin.find(4).pos
+ end
+
+end
View
2  vendor/plugins/app_config/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*.gem
View
20 vendor/plugins/app_config/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2008 Jacques Crocker
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
90 vendor/plugins/app_config/README
@@ -0,0 +1,90 @@
+== Summary
+Application level configuration.
+
+== Author
+Jacques Crocker
+Modified from Original Project (AppConfig by Christopher J. Bottaro)
+
+=== Compatibility
+Rails 2.1/2.2 and Merb 1.0
+
+=== Accessing the AppConfig object
+After installing this plugin, the AppConfig object will be global available. Entries are accessed via object member notation:
+ AppConfig.my_config_entry
+Nested entries are supported:
+ AppConfig.my_section.some_entry
+
+=== Common config file
+Config entries are compiled from
+ config/app_config.yml
+ config/app_config/settings.yml
+ config/app_config/#{environment}.yml
+ config/environments/#{environment}.yml
+ config/app_config/assets.yml
+ config/app_config/stylesheets.yml
+ config/app_config/javascripts.yml
+
+settings defined in files that are lower in the list override settings higher
+
+=== Reloading config files
+You can reload the AppConfig from file at any time by running AppConfig.reload!
+
+=== Environment specific config files
+You can have environment specific config files. Environment specific config entries take precedence over common config entries.
+
+Example development environment config file:
+ RAILS_ROOT/config/environments/development.yml
+
+Example production environment config file:
+ RAILS_ROOT/config/environments/production.yml
+
+=== Embedded Ruby (ERB)
+ Embedded Ruby is allowed in the configuration files. See examples below.
+
+=== Accessing Configuration Settings
+Consider the two following config files.
+
+RAILS_ROOT/config/app_config.yml:
+ size: 1
+ server: google.com
+
+RAILS_ROOT/config/environments/development.yml:
+ size: 2
+ computed: <%= 1 + 2 + 3 %>
+ section:
+ size: 3
+ servers: [ {name: yahoo.com}, {name: amazon.com} ]
+
+Notice that the environment specific config entries overwrite the common entries.
+ AppConfig.size -> 2
+ AppConfig.server -> google.com
+
+Notice the embedded Ruby.
+ AppConfig.computed -> 6
+
+Notice that object member notation is maintained even in nested entries.
+ AppConfig.section.size -> 3
+
+Notice array notation and object member notation is maintained.
+ AppConfig.section.servers[0].name -> yahoo.com
+ AppConfig.section.servers[1].name -> amazon.com
+
+
+==== Managing Asset Files with AppConfig
+Defining stylesheets: and/or javascripts: keys will allow you to easily manage lists of assets via config
+
+javascripts:
+ - application.js
+ - prototype_scriptaculous:
+ - prototype.js
+ - scriptaculous/effects.js
+ - base:
+ - libraries/*.js
+
+All * file paths will be expanded out into a full list of files.
+
+To add these javascripts to your layout just run
+
+<%= javascripts_from_config %>
+
+This will group the assets by key in order to use the built in Bundling
View
54 vendor/plugins/app_config/Rakefile
@@ -0,0 +1,54 @@
+require 'rubygems'
+require 'rake/gempackagetask'
+
+require 'merb-core'
+require 'merb-core/tasks/merb'
+
+GEM_NAME = "merb_app_config"
+GEM_VERSION = "1.0.3"
+AUTHOR = "Jacques Crocker"
+EMAIL = "merbjedi@gmail.com"
+HOMEPAGE = "http://www.merbjedi.com/"
+SUMMARY = "Merb plugin that provides easy to use Application Configurations via YAML"
+
+spec = Gem::Specification.new do |s|
+ s.rubyforge_project = 'merb'
+ s.name = GEM_NAME
+ s.version = GEM_VERSION
+ s.platform = Gem::Platform::RUBY
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README", "LICENSE"]
+ s.summary = SUMMARY
+ s.description = s.summary
+ s.author = AUTHOR
+ s.email = EMAIL
+ s.homepage = HOMEPAGE
+
+ s.add_dependency('merb-assets', '>= 1.0')
+
+ s.require_path = 'lib'
+ s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,spec}/**/*")
+end
+
+Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.gem_spec = spec
+end
+
+desc "install the plugin as a gem"
+task :install do
+ Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
+end
+
+desc "Uninstall the gem"
+task :uninstall do
+ Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
+end
+
+desc "Create a gemspec file"
+task :gemspec do
+ File.open("#{GEM_NAME}.gemspec", "w") do |file|
+ file.puts spec.to_ruby
+ end
+end
+
+require 'lib/merbtasks'
View
1  vendor/plugins/app_config/init.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + "/rails/init"
View
132 vendor/plugins/app_config/lib/application_config/config_builder.rb
@@ -0,0 +1,132 @@
+require 'ostruct'
+require 'yaml'
+require 'erb'
+
+module ApplicationConfig
+ # == Summary
+ # This is API documentation, NOT documentation on how to use this plugin. For that, see the README.
+ class ConfigBuilder
+ @@load_paths = []
+ @@expand_keys = []
+ @@root_path = ""
+
+ # Create a config object (OpenStruct) from a yaml file. If a second yaml file is given, then the sections of that file will overwrite the sections
+ # if the first file if they exist in the first file.
+ def self.load_files(options = {})
+ config = OpenStruct.new
+
+ @@load_paths = [options[:paths]].flatten.compact.uniq
+ @@expand_keys = [options[:expand_keys]].flatten.compact.uniq
+ @@root_path = options[:root_path]
+
+ # add singleton method to our AppConfig that reloads its settings from the load_paths options
+ def config.reload!
+ conf = {}
+ ConfigBuilder.load_paths.to_a.each do |path|
+ file_conf = YAML.load(ERB.new(IO.read(path)).result) if path and File.exists?(path)
+ conf.merge!(file_conf) if file_conf
+ end
+
+ # expand the javascripts config to handle *.* paths
+ ConfigBuilder.expand_keys.to_a.each do |expand_path|
+ expand_path = expand_path.to_s
+ if conf[expand_path]
+ conf[expand_path] = ApplicationConfig::ConfigBuilder.expand(conf[expand_path], "#{ConfigBuilder.root_path}/public/#{expand_path}")
+ end
+ end
+
+ # load all the new values into the openstruct
+ marshal_load(ApplicationConfig::ConfigBuilder.convert(conf).marshal_dump)
+
+ return self
+ end
+
+ config.reload!
+ return config
+ end
+
+ def self.load_paths
+ @@load_paths
+ end
+
+ def self.expand_keys
+ @@expand_keys
+ end
+
+ def self.root_path
+ @@root_path
+ end
+
+ # Recursively converts Hashes to OpenStructs (including Hashes inside Arrays)
+ def self.convert(h) #:nodoc:
+ s = OpenStruct.new
+ h.each do |k, v|
+ s.new_ostruct_member(k)
+ if v.is_a?(Hash)
+ s.send( (k+'=').to_sym, convert(v))
+ elsif v.is_a?(Array)
+ converted_array = v.collect { |e| e.instance_of?(Hash) ? convert(e) : e }
+ s.send("#{k}=".to_sym, converted_array)
+ else
+ s.send("#{k}=".to_sym, v)
+ end
+ end
+ s
+ end
+
+ # expand a config val
+ def self.expand(config, base_path)
+ case config.class.to_s
+ when "Hash"
+ return expand_hash(config, base_path)
+ when "Array"
+ return expand_array(config, base_path)
+ when "String"
+ return expand_string(config, base_path)
+ end
+ return config
+ end
+
+ # expand a string and returns a list
+ def self.expand_string(config, base_path)
+ # puts "Expanding String: #{config.inspect}"
+ if config.include?("*")
+ results = Dir["#{base_path}/#{config}"].map{|i| i.to_s.gsub("#{base_path}/", "") }
+
+ # puts "EXPANDED PATH: #{base_path}/#{config}"
+ # puts results.inspect
+ return results
+ else
+ return config
+ end
+ end
+
+ # expand a hash by cycling throw all the hash values
+ def self.expand_hash(config, base_path)
+ # puts "Expanding Hash: #{config.inspect}"
+ new_config = {}
+ config.each do |key, val|
+ new_config[key] = expand(val, base_path)
+ end
+ return new_config
+ end
+
+ # expand an array by cycling through all the values
+ def self.expand_array(config, base_path)
+ # puts "Expanding Array: #{config.inspect}"
+ new_config = []
+ config.each do |val|
+ new_val = expand(val, base_path)
+ if new_val.is_a?(Array)
+ new_val.each do |inner|
+ new_config << inner
+ end
+ else
+ new_config << new_val
+ end
+ end
+ return new_config.uniq
+ end
+
+ end
+end
View
77 vendor/plugins/app_config/lib/application_config/view_helpers.rb
@@ -0,0 +1,77 @@
+module ApplicationConfig
+ module ViewHelpers
+ def javascripts_from_config(options = {})
+ html = ""
+ only = [options.delete(:only)].flatten.compact
+ if defined?(AppConfig) and AppConfig.javascripts
+ AppConfig.javascripts.each do |javascript|
+ if javascript.is_a?(OpenStruct)
+ javascript = javascript.marshal_dump
+ end
+
+ if javascript.is_a? Hash
+ javascript.each do |key, val|
+ next unless only.empty? || only.include?(key)
+
+ args = [val].flatten
+ args = args.map{|s| s.gsub("javascripts/", AppConfig.javascript_path)} if AppConfig.javascript_path
+ if defined?(Merb)
+ args << options.merge(:bundle => key.to_sym)
+ html << js_include_tag(*args)
+ elsif defined?(Rails)
+ args << options.merge(:cache => key.to_s)
+ html << javascript_include_tag(*args)
+ end
+ html << "\n"
+ end
+ else
+ args = [javascript].flatten
+ args = args.map{|s| s.gsub("javascripts/", AppConfig.javascript_path)} if AppConfig.javascript_path
+ args << options
+ if defined?(Merb)
+ html << js_include_tag(*args)
+ elsif defined?(Rails)
+ html << javascript_include_tag(*args)
+ end
+ end
+ end
+ end
+ return html
+ end
+
+ def stylesheets_from_config(options = {})
+ html = ""
+ only = [options.delete(:only)].flatten.compact
+ if defined?(AppConfig) and AppConfig.stylesheets
+ AppConfig.stylesheets.each do |stylesheet|
+ if stylesheet.is_a?(OpenStruct)
+ stylesheet = stylesheet.marshal_dump
+ end
+
+ if stylesheet.is_a? Hash
+ stylesheet.each do |key, val|
+ next unless only.empty? || only.include?(key)
+
+ args = [val].flatten
+ args = args.map{|s| s.gsub("stylesheets/", AppConfig.stylesheet_path)} if AppConfig.stylesheet_path
+ if defined?(Merb)
+ args << options.merge(:bundle => key.to_sym)
+ html << css_include_tag(*args)
+ elsif defined?(Rails)
+ args << options.merge(:cache => key.to_s)
+ html << stylesheet_link_tag(*args)
+ end
+ end
+ else
+ args = [stylesheet].flatten
+ args = args.map{|s| s.gsub("stylesheets/", AppConfig.stylesheet_path)} if AppConfig.stylesheet_path
+ args << options
+ html << stylesheet_link_tag(*args)
+ end
+ html << "\n"
+ end
+ end
+ return html
+ end
+ end
+end
View
47 vendor/plugins/app_config/lib/merb_app_config.rb
@@ -0,0 +1,47 @@
+require 'application_config/config_builder'
+require 'application_config/view_helpers'
+
+# make sure we're running inside Merb
+if defined?(Merb::Plugins)
+ # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
+ Merb::Plugins.config[:app_config] = {
+ :auto_reload => false,
+ :view_helpers => true,
+ :paths => [
+ "#{Merb.root}/config/app_config.yml",
+ "#{Merb.root}/config/app_config/settings.yml",
+ "#{Merb.root}/config/app_config/#{Merb.env}.yml",
+ "#{Merb.root}/config/environments/#{Merb.env}.yml",
+ "#{Merb.root}/config/assets.yml",
+ "#{Merb.root}/config/javascripts.yml",
+ "#{Merb.root}/config/stylesheets.yml"
+ ]
+ }
+
+ Merb::BootLoader.before_app_loads do
+ if defined?(::AppConfig)
+ AppConfig.reload!
+ else
+ ::AppConfig = ApplicationConfig::ConfigBuilder.load_files(
+ :paths => Merb::Plugins.config[:app_config][:paths].to_a,
+ :expand_keys => [:javascripts, :stylesheets],
+ :root_path => Merb.root
+ )
+ end
+
+ if Merb::Plugins.config[:app_config][:view_helpers]
+ Merb::Controller.send(:include, ApplicationConfig::ViewHelpers)
+ end
+ end
+
+ Merb::BootLoader.after_app_loads do
+ if Merb::Plugins.config[:app_config][:auto_reload]
+ Merb.logger.info "[AppConfig] Auto reloading AppConfig on *every request*."
+ Merb.logger.info "[AppConfig] Set via Merb::Plugins.config[:app_config][:auto_reload]"
+
+ Merb::Controller.before Proc.new{ AppConfig.reload! }
+ end
+ end
+
+ Merb::Plugins.add_rakefiles "merbtasks"
+end
View
17 vendor/plugins/app_config/lib/merbtasks.rb
@@ -0,0 +1,17 @@
+namespace :app_config do
+ desc "Create a blank config/app_config.yml file"
+ task :init do
+ puts "Setting up AppConfig files..."
+ `mkdir -p config/app_config`
+
+ ["config/app_config.yml",
+ "config/app_config/development.yml",
+ "config/app_config/production.yml"
+ ].each do |path|
+ `touch #{path}`
+ puts "Created: #{path}"
+ end
+ puts "Complete!"
+ puts "Add key/value pairs to your yaml file,\nthen access them in your Merb project via AppConfig.[key]"
+ end
+end
View
18 vendor/plugins/app_config/rails/init.rb
@@ -0,0 +1,18 @@
+require 'application_config/config_builder'
+require 'application_config/view_helpers'
+
+::AppConfig = ApplicationConfig::ConfigBuilder.load_files(
+ :paths => [
+ "#{Rails.root}/config/app_config.yml",
+ "#{Rails.root}/config/app_config/settings.yml",
+ "#{Rails.root}/config/app_config/#{Rails.env}.yml",
+ "#{Rails.root}/config/environments/#{Rails.env}.yml",
+ "#{Rails.root}/config/assets.yml",
+ "#{Rails.root}/config/javascripts.yml",
+ "#{Rails.root}/config/stylesheets.yml"
+ ],
+ :expand_keys => [:javascripts, :stylesheets],
+ :root_path => Rails.root
+)
+
+ActionView::Base.send :include, ApplicationConfig::ViewHelpers
View
75 vendor/plugins/app_config/test/config_builder_test.rb
@@ -0,0 +1,75 @@
+require 'rubygems'
+require 'test/unit'
+require 'active_support'
+require File.dirname(__FILE__)+'/../lib/application_config/config_builder'
+
+class ConfigBuilderTest < Test::Unit::TestCase
+ def setup
+ @settings_path = File.dirname(__FILE__)+"/test_configs"
+ end
+
+ def test_missing_files
+ files = ["#{@settings_path}/empty1.yml", "#{@settings_path}/empty2.yml"]
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => files)
+ assert_equal OpenStruct.new, config
+ end
+
+ def test_empty_files
+ files = ["#{@settings_path}/empty1.yml", "#{@settings_path}/empty2.yml"]
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => files)
+ assert_equal OpenStruct.new, config
+ end
+
+ def test_common
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => "#{@settings_path}/app_config.yml")
+ assert_equal 1, config.size
+ assert_equal 'google.com', config.server
+ end
+
+ def test_environment_override
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => ["#{@settings_path}/app_config.yml", "#{@settings_path}/development.yml"])
+ assert_equal 2, config.size
+ assert_equal 'google.com', config.server
+ end
+
+ def test_nested
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => ["#{@settings_path}/development.yml"])
+ assert_equal 3, config.section.size
+ end
+
+ def test_array
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => "#{@settings_path}/development.yml")
+ assert_equal 'yahoo.com', config.section.servers[0].name
+ assert_equal 'amazon.com', config.section.servers[1].name
+ end
+
+ def test_erb
+ config = ApplicationConfig::ConfigBuilder.load_files(:paths => "#{@settings_path}/development.yml")
+ assert_equal 6, config.computed
+ end
+
+ def test_javascript_expander
+ config = ApplicationConfig::ConfigBuilder.load_files(
+ :paths => "#{@settings_path}/javascript_expander.yml",
+ :root_path => "#{@settings_path}/javascript_expander",
+ :expand_keys => :javascripts
+ )
+
+ # puts "JAVASCRIPTS:"
+ # puts config.inspect
+ assert_equal 4, config.javascripts.first.base.size
+ end
+
+ def test_stylesheet_expander
+ config = ApplicationConfig::ConfigBuilder.load_files(
+ :paths => "#{@settings_path}/stylesheet_expander.yml",
+ :root_path => "#{@settings_path}/stylesheet_expander",
+ :expand_keys => :stylesheets
+ )
+
+ # puts "STYLESHEETS:"
+ # puts config.inspect
+ assert_equal 5, config.stylesheets.first.base.size
+ end
+
+end
View
2  vendor/plugins/app_config/test/test_configs/app_config.yml
@@ -0,0 +1,2 @@
+size: 1
+server: google.com
View
5 vendor/plugins/app_config/test/test_configs/development.yml
@@ -0,0 +1,5 @@
+size: 2
+computed: <%= 1 + 2 + 3 %>
+section:
+ size: 3
+ servers: [ {name: yahoo.com}, {name: amazon.com} ]
View
0  vendor/plugins/app_config/test/test_configs/empty1.yml
No changes.
View
0  vendor/plugins/app_config/test/test_configs/empty2.yml
No changes.
View
5 vendor/plugins/app_config/test/test_configs/javascript_expander.yml
@@ -0,0 +1,5 @@
+javascripts:
+ - base:
+ # include controls
+ - application.js
+ - controls/*.js
View
0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file1.js
No changes.
View
0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file2.js
No changes.
View
0  vendor/plugins/app_config/test/test_configs/javascript_expander/public/javascripts/controls/file3.js
No changes.
View
5 vendor/plugins/app_config/test/test_configs/stylesheet_expander.yml
@@ -0,0 +1,5 @@
+stylesheets:
+ - base:
+ - local.css
+ - global.css
+ - lib/*
View
0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file1
No changes.
View
0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file2
No changes.
View
0  vendor/plugins/app_config/test/test_configs/stylesheet_expander/public/stylesheets/lib/file3
No changes.
View
2  vendor/plugins/auto_migrations/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*.gem
View
20 vendor/plugins/auto_migrations/MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2007 PJ Hyett
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
51 vendor/plugins/auto_migrations/README
@@ -0,0 +1,51 @@
+== AutoMigrations
+
+Forget migrations, auto-migrate!
+
+
+== Usage
+
+Write out your schema (or use an existing one)
+
+ $ cat db/schema.rb
+
+ ActiveRecord::Schema.define do
+
+ create_table :posts do |t|
+ t.string :title
+ t.text :body
+ t.timestamps
+ end
+
+ end
+
+ $ rake db:auto:migrate
+
+ Created posts table
+
+...a few days later
+
+ $ cat db/schema.rb
+
+ ActiveRecord::Schema.define do
+
+ create_table :posts do |t|
+ t.string :title
+ t.text :content
+ t.timestamps
+ end
+
+ end
+
+ $ rake db:auto:migrate
+ -- add_column("posts", :content, :text)
+ -> 0.0307s
+ -- remove_column("posts", "body")
+ -> 0.0311s
+
+Found a bug? Sweet. Add it at the Lighthouse:
+ http://err.lighthouseapp.com/projects/466-plugins/tickets/new
+
+Feature requests are welcome.
+
+* PJ Hyett [ pjhyett@gmail.com ]
View
24 vendor/plugins/auto_migrations/Rakefile
@@ -0,0 +1,24 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the auto_migrations plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the auto_migrations plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ files = ['README', 'LICENSE', 'lib/**/*.rb']
+ rdoc.rdoc_files.add(files)
+ rdoc.main = "README" # page to start on
+ rdoc.title = "auto_migrations"
+ rdoc.template = File.exists?(t="/Users/chris/ruby/projects/err/rock/template.rb") ? t : "/var/www/rock/template.rb"
+ rdoc.rdoc_dir = 'doc' # rdoc output folder
+ rdoc.options << '--inline-source'
+end
View
30 vendor/plugins/auto_migrations/auto_migrations.gemspec
@@ -0,0 +1,30 @@
+Gem::Specification.new do |s|
+ s.name = 'auto_migrations'
+ s.version = '1.4'
+ s.date = '2008-09-09'
+
+ s.summary = "Allows migrations to be run automatically based on updating the schema.rb"
+ s.description = "Forget migrations, auto-migrate!"
+
+ s.authors = ['PJ Hyett']
+ s.email = 'pjhyett@gmail.com'
+ s.homepage = 'http://github.com/pjhyett/auto_migrations'
+
+ s.has_rdoc = true
+ s.rdoc_options = ["--main", "README"]
+ s.extra_rdoc_files = ["README"]
+
+ s.add_dependency 'rails', ['>= 2.1']
+
+ s.files = ["MIT-LICENSE",
+ "README",
+ "Rakefile",
+ "auto_migrations.gemspec",
+ "init.rb",
+ "lib/auto_migrations.rb",
+ "rails/init.rb",
+ "tasks/auto_migrations_tasks.rake"]
+
+ s.test_files = ["test/auto_migrations_test.rb"]
+
+end
View
1  vendor/plugins/auto_migrations/init.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + "/rails/init"
View
142 vendor/plugins/auto_migrations/lib/auto_migrations.rb
@@ -0,0 +1,142 @@
+module AutoMigrations
+
+ def self.run
+ # Turn off schema_info code for auto-migration
+ class << ActiveRecord::Schema
+ alias :old_define :define
+ attr_accessor :version
+ def define(info={}, &block) @version=info[:version]; instance_eval(&block) end
+ end
+
+ load(File.join(RAILS_ROOT, 'db', 'schema.rb'))
+ ActiveRecord::Migration.drop_unused_tables
+ ActiveRecord::Migration.drop_unused_indexes
+ ActiveRecord::Migration.update_schema_version(ActiveRecord::Schema.version) if ActiveRecord::Schema.version
+
+ class << ActiveRecord::Schema
+ alias :define :old_define
+ end
+ end
+
+ def self.schema_to_migration
+ schema = File.read(File.join(RAILS_ROOT, "db", "schema.rb"))
+ schema.gsub!(/#(.)+\n/, '')
+ schema.sub!(/ActiveRecord::Schema.define(.+)do[ ]?\n/, '')
+ schema.gsub!(/^/, ' ')
+ schema = "class InitialSchema < ActiveRecord::Migration\n def self.up\n" + schema
+ schema << "\n def self.down\n"
+ schema << (ActiveRecord::Base.connection.tables - %w(schema_info schema_migrations)).map do |table|
+ " drop_table :#{table}\n"
+ end.join
+ schema << " end\nend\n"
+ migration_file = File.join(RAILS_ROOT, "db", "migrate", "001_initial_schema.rb")
+ File.open(migration_file, "w") { |f| f << schema }
+ puts "Migration created at db/migrate/001_initial_schema.rb"
+ end
+
+ def self.included(base)
+ base.extend ClassMethods
+ class << base
+ cattr_accessor :tables_in_schema, :indexes_in_schema
+ self.tables_in_schema, self.indexes_in_schema = [], []
+ alias_method_chain :method_missing, :auto_migration
+ end
+ end
+
+ module ClassMethods
+
+ def method_missing_with_auto_migration(method, *args, &block)
+ case method
+ when :create_table
+ auto_create_table(method, *args, &block)
+ when :add_index
+ auto_add_index(method, *args, &block)
+ else
+ method_missing_without_auto_migration(method, *args, &block)
+ end
+ end
+
+ def auto_create_table(method, *args, &block)
+ table_name = args.shift.to_s
+ options = args.pop || {}
+
+ (self.tables_in_schema ||= []) << table_name
+
+ # Table doesn't exist, create it
+ unless ActiveRecord::Base.connection.tables.include?(table_name)
+ return method_missing_without_auto_migration(method, *[table_name, options], &block)
+ end
+
+ # Grab database columns
+ fields_in_db = ActiveRecord::Base.connection.columns(table_name).inject({}) do |hash, column|
+ hash[column.name] = column
+ hash
+ end
+
+ # Grab schema columns (lifted from active_record/connection_adapters/abstract/schema_statements.rb)
+ table_definition = ActiveRecord::ConnectionAdapters::TableDefinition.new(ActiveRecord::Base.connection)
+ table_definition.primary_key(options[:primary_key] || "id") unless options[:id] == false
+ yield table_definition
+ fields_in_schema = table_definition.columns.inject({}) do |hash, column|
+ hash[column.name.to_s] = column
+ hash
+ end
+
+ # Add fields to db new to schema
+ (fields_in_schema.keys - fields_in_db.keys).each do |field|
+ column = fields_in_schema[field]
+ add_column table_name, column.name, column.type.to_sym, :limit => column.limit, :precision => column.precision,
+ :scale => column.scale, :default => column.default, :null => column.null
+ end
+
+ # Remove fields from db no longer in schema
+ (fields_in_db.keys - fields_in_schema.keys & fields_in_db.keys).each do |field|
+ column = fields_in_db[field]
+ remove_column table_name, column.name
+ end
+
+ # Change field type if schema is different from db
+ (fields_in_schema.keys & fields_in_db.keys).each do |field|
+ if (field != 'id') && (fields_in_schema[field].type.to_sym != fields_in_db[field].type.to_sym)
+ change_column table_name, fields_in_schema[field].name.to_sym, fields_in_schema[field].type.to_sym
+ end
+ end
+ end
+
+ def auto_add_index(method, *args, &block)
+ table_name = args.shift.to_s
+ fields = Array(args.shift).map(&:to_s)
+ options = args.shift
+
+ index_name = options[:name] if options
+ index_name ||= "index_#{table_name}_on_#{fields.join('_and_')}"
+
+ (self.indexes_in_schema ||= []) << index_name
+
+ unless ActiveRecord::Base.connection.indexes(table_name).detect { |i| i.name == index_name }
+ method_missing_without_auto_migration(method, *[table_name, fields, options], &block)
+ end
+ end
+
+ def drop_unused_tables
+ (ActiveRecord::Base.connection.tables - tables_in_schema - %w(schema_info schema_migrations)).each do |table|
+ drop_table table
+ end
+ end
+
+ def drop_unused_indexes
+ tables_in_schema.each do |table_name|
+ indexes_in_db = ActiveRecord::Base.connection.indexes(table_name).map(&:name)
+ (indexes_in_db - indexes_in_schema & indexes_in_db).each do |index_name|
+ remove_index table_name, :name => index_name
+ end
+ end
+ end
+
+ def update_schema_version(version)
+ ActiveRecord::Base.connection.update("INSERT INTO schema_migrations VALUES ('#{version}')")
+ end
+
+ end
+
+end
View
2  vendor/plugins/auto_migrations/rails/init.rb
@@ -0,0 +1,2 @@
+require 'auto_migrations'
+ActiveRecord::Migration.send :include, AutoMigrations
View
15 vendor/plugins/auto_migrations/tasks/auto_migrations_tasks.rake
@@ -0,0 +1,15 @@
+namespace :db do
+ namespace :auto do
+ desc "Use schema.rb to auto-migrate"
+ task :migrate => :environment do
+ AutoMigrations.run
+ end
+ end
+
+ namespace :schema do
+ desc "Create migration from schema.rb"
+ task :to_migration => :environment do
+ AutoMigrations.schema_to_migration
+ end
+ end
+end
View
8 vendor/plugins/auto_migrations/test/auto_migrations_test.rb
@@ -0,0 +1,8 @@
+require 'test/unit'
+
+class AutoMigrationsTest < Test::Unit::TestCase
+ # Replace this with your real tests.
+ def test_this_plugin
+ flunk
+ end
+end
View
2  vendor/plugins/better_partials/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*.gem
View
20 vendor/plugins/better_partials/MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2008 Jacques Crocker (www.railsjedi.com)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
58 vendor/plugins/better_partials/README
@@ -0,0 +1,58 @@
+better_partials
+==============
+Provides syntactic suger for render :partial
+
+
+Example
+=======
+Render a partial
+<%= partial "people/search_box" %>
+
+Pass some parameters in
+<% form_for @person do |f| %>
+ <%= partial "people/form", :f => f %>
+<% end %>
+
+Pass in a collection
+<%= partial "people/person", :collection => @people %>
+
+Or the terse way
+<%= partials @people %>
+
+Also works, but not as nice reading
+<%= partial @people %>
+
+Rendering a block
+<% partial "people/box" do %>
+ Inner connect goes here.. (gets called in your partial's yield statement)
+<% end %>
+
+
+Special Partial Options pass through to render :partial
+(all others are passed through to the :locals parameter)
+=======
+:collection,
+:spacer_template,
+:object,
+:use_full_path
+
+
+Install into vendor/plugins
+=======
+script/plugin install git://github.com/jcnetdev/better_partials.git
+
+
+Install via Gem
+=======
+If you're using Rails 2.1, you can use the plugin as a gem.
+
+Add this to your environment.rb:
+
+config.gem 'jcnetdev-better_partials', :version => '>= 1.0',
+ :lib => 'better_partials',
+ :source => 'http://gems.github.com'
+
+Then install via: rake gems:install
+
+
+Copyright (c) 2008 Jacques Crocker (www.railsjedi.com), released under the MIT license
View
22 vendor/plugins/better_partials/Rakefile
@@ -0,0 +1,22 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the betterpartials plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the betterpartials plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Betterpartials'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
29 vendor/plugins/better_partials/better_partials.gemspec
@@ -0,0 +1,29 @@
+Gem::Specification.new do |s|
+ s.name = 'better_partials'
+ s.version = '1.1'
+ s.date = '2008-10-11'
+
+ s.summary = "Makes calling partials in views look better and more fun."
+ s.description = "Wrapper around render :partial that removes the need to use :locals, and allows blocks to be taken easily"
+
+ s.authors = ['RailsJedi']
+ s.email = 'railsjedi@gmail.com'
+ s.homepage = 'http://www.railsjedi.com/posts/22'
+
+ s.has_rdoc = true
+ s.rdoc_options = ["--main", "README"]
+ s.extra_rdoc_files = ["README"]
+
+ s.add_dependency 'rails', ['>= 2.1']
+
+ s.files = ["MIT-LICENSE",
+ "README",
+ "Rakefile",
+ "better_partials.gemspec",
+ "init.rb",
+ "lib/better_partials.rb",
+ "rails/init.rb",
+ "uninstall.rb"]
+
+end
+
View
1  vendor/plugins/better_partials/init.rb
@@ -0,0 +1 @@
+require File.dirname(__FILE__) + "/rails/init"
View
89 vendor/plugins/better_partials/lib/better_partials.rb
@@ -0,0 +1,89 @@
+module BetterPartials
+ module Helpers
+
+ # Renders a Partial intelligently
+ #
+ # Normal partial call:
+ # <%= partial "my_partial" %>
+ # same as...
+ # <%= render :partial => "my_partial" %>
+ #
+ # Partial call with arguments:
+ # <%= partial "my_partial", :arg1 => "test" %>
+ # same as...
+ # <%= render :partial => "my_partial", :locals => {:arg1 => "test"} %>
+ #
+ # Partial call with collection (and arguments)
+ # <%= partial "my_partial", :collection => @items, :arg1 => "test" %>
+ # same as...
+ # <%= render :partial => "my_partial", :collection => @items, :locals => {:arg1 => "test", :collection => @items} %>
+ #
+ # Partial also supports blocks naturally
+ # <% partial "my_partial", :collection => @items, :arg1 => "test" do %>
+ # inner partial content
+ # <% end %>
+ # same as...
+ # <% render :layout => "my_partial", :collection => @items, :arg1 => "test" do %>
+ # inner partial content
+ # <% end %>
+ def partial(partial_path, options = {}, &block)
+
+ # partial_options will build up the hash parameter to pass into render()
+ partial_options = {}
+
+ # partial_locals will build