uploader 2.0.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. data/README.rdoc +55 -57
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/app/helpers/uploader_helper.rb +3 -3
  5. data/app/views/uploads/_swf_javascript.html.erb +9 -6
  6. data/app/views/uploads/_swf_upload.html.erb +2 -2
  7. data/app/views/uploads/_uploadify.html.erb +3 -3
  8. data/{locales → config/locales}/ar.yml +0 -0
  9. data/{locales → config/locales}/bg.yml +0 -0
  10. data/{locales → config/locales}/ca.yml +0 -0
  11. data/{locales → config/locales}/cs.yml +0 -0
  12. data/{locales → config/locales}/da.yml +0 -0
  13. data/{locales → config/locales}/de.yml +0 -0
  14. data/{locales → config/locales}/el.yml +0 -0
  15. data/{locales → config/locales}/en.yml +0 -0
  16. data/{locales → config/locales}/es.yml +0 -0
  17. data/{locales → config/locales}/et.yml +0 -0
  18. data/{locales → config/locales}/fa.yml +2 -2
  19. data/{locales → config/locales}/fi.yml +0 -0
  20. data/{locales → config/locales}/fr.yml +0 -0
  21. data/{locales → config/locales}/gl.yml +0 -0
  22. data/{locales → config/locales}/hi.yml +1 -1
  23. data/{locales → config/locales}/hr.yml +0 -0
  24. data/{locales → config/locales}/hu.yml +0 -0
  25. data/{locales → config/locales}/id.yml +1 -1
  26. data/{locales → config/locales}/it.yml +0 -0
  27. data/{locales → config/locales}/iw.yml +0 -0
  28. data/{locales → config/locales}/ja.yml +0 -0
  29. data/{locales → config/locales}/ko.yml +2 -2
  30. data/{locales → config/locales}/lt.yml +0 -0
  31. data/{locales → config/locales}/lv.yml +0 -0
  32. data/{locales → config/locales}/mt.yml +0 -0
  33. data/{locales → config/locales}/nl.yml +0 -0
  34. data/{locales → config/locales}/no.yml +0 -0
  35. data/{locales → config/locales}/pl.yml +0 -0
  36. data/{locales → config/locales}/pt-PT.yml +0 -0
  37. data/{locales → config/locales}/ro.yml +0 -0
  38. data/{locales → config/locales}/ru.yml +0 -0
  39. data/{locales → config/locales}/sk.yml +0 -0
  40. data/{locales → config/locales}/sl.yml +0 -0
  41. data/{locales → config/locales}/sq.yml +0 -0
  42. data/{locales → config/locales}/sr.yml +0 -0
  43. data/{locales → config/locales}/sv.yml +0 -0
  44. data/{locales → config/locales}/th.yml +1 -1
  45. data/{locales → config/locales}/tl.yml +0 -0
  46. data/{locales → config/locales}/tr.yml +0 -0
  47. data/{locales → config/locales}/uk.yml +0 -0
  48. data/{locales → config/locales}/vi.yml +2 -2
  49. data/{locales → config/locales}/zh-CN.yml +0 -0
  50. data/{locales → config/locales}/zh-TW.yml +0 -0
  51. data/{locales → config/locales}/zh.yml +0 -0
  52. data/config/routes.rb +8 -0
  53. data/lib/tasks/uploader.rake +22 -0
  54. data/lib/uploader/config.rb +65 -0
  55. data/lib/uploader/engine.rb +19 -0
  56. data/lib/uploader/models/upload.rb +229 -0
  57. data/lib/uploader.rb +4 -2
  58. data/test/{rails_root → rails_test}/.gitignore +0 -0
  59. data/test/{rails_root → rails_test}/.rake_tasks +0 -0
  60. data/test/rails_test/Gemfile +21 -0
  61. data/{Gemfile.lock → test/rails_test/Gemfile.lock} +21 -1
  62. data/test/rails_test/README +256 -0
  63. data/test/{rails_root → rails_test}/Rakefile +2 -7
  64. data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +0 -0
  65. data/test/rails_test/app/controllers/default_controller.rb +18 -0
  66. data/test/{rails_root → rails_test}/app/controllers/uploads_controller.rb +5 -2
  67. data/test/{rails_root → rails_test}/app/models/.keep +0 -0
  68. data/test/rails_test/app/models/upload.rb +38 -0
  69. data/test/{rails_root → rails_test}/app/models/user.rb +0 -0
  70. data/test/{rails_root → rails_test}/app/views/default/index.html.erb +11 -1
  71. data/test/rails_test/app/views/default/uploadify.html.erb +27 -0
  72. data/test/{rails_root → rails_test}/app/views/layouts/application.html.erb +2 -2
  73. data/test/{rails_root → rails_test}/config/amazon_s3.yml +0 -0
  74. data/test/{rails_root → rails_test}/config/application.rb +6 -12
  75. data/test/rails_test/config/boot.rb +13 -0
  76. data/test/{rails_root → rails_test}/config/database.yml +3 -11
  77. data/test/rails_test/config/environment.rb +5 -0
  78. data/test/rails_test/config/environments/development.rb +26 -0
  79. data/test/rails_test/config/environments/production.rb +49 -0
  80. data/test/rails_test/config/environments/test.rb +35 -0
  81. data/test/{rails_root → rails_test}/config/global_config.yml +0 -0
  82. data/test/{rails_root → rails_test}/config/initializers/backtrace_silencers.rb +0 -0
  83. data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
  84. data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
  85. data/test/{rails_root → rails_test}/config/initializers/s3_credentials.rb +1 -1
  86. data/test/{rails_root → rails_test}/config/initializers/secret_token.rb +1 -1
  87. data/test/rails_test/config/initializers/session_store.rb +8 -0
  88. data/test/rails_test/config/locales/en.yml +5 -0
  89. data/test/rails_test/config/routes.rb +13 -0
  90. data/test/rails_test/config.ru +4 -0
  91. data/test/{rails_root → rails_test}/db/.keep +0 -0
  92. data/test/{rails_root → rails_test}/db/migrate/20090517040220_create_uploads.rb +0 -0
  93. data/test/{rails_root → rails_test}/db/migrate/20090602041838_create_users.rb +0 -0
  94. data/test/rails_test/db/seeds.rb +7 -0
  95. data/test/rails_test/doc/README_FOR_APP +2 -0
  96. data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
  97. data/test/{rails_root → rails_test}/features/support/env.rb +0 -0
  98. data/test/{rails_root → rails_test}/lib/daemons/amazonaws.rb +0 -0
  99. data/test/{rails_root/public/favicon.ico → rails_test/lib/tasks/.gitkeep} +0 -0
  100. data/test/rails_test/public/404.html +26 -0
  101. data/test/rails_test/public/422.html +26 -0
  102. data/test/rails_test/public/500.html +26 -0
  103. data/test/{rails_root/public/stylesheets/.keep → rails_test/public/favicon.ico} +0 -0
  104. data/test/{rails_root → rails_test}/public/images/file_icons/excel.gif +0 -0
  105. data/test/{rails_root → rails_test}/public/images/file_icons/file.gif +0 -0
  106. data/test/{rails_root → rails_test}/public/images/file_icons/file.png +0 -0
  107. data/test/{rails_root → rails_test}/public/images/file_icons/file_aac.gif +0 -0
  108. data/test/{rails_root → rails_test}/public/images/file_icons/file_ai.gif +0 -0
  109. data/test/{rails_root → rails_test}/public/images/file_icons/file_avi.gif +0 -0
  110. data/test/{rails_root → rails_test}/public/images/file_icons/file_bin.gif +0 -0
  111. data/test/{rails_root → rails_test}/public/images/file_icons/file_bmp.gif +0 -0
  112. data/test/{rails_root → rails_test}/public/images/file_icons/file_cue.gif +0 -0
  113. data/test/{rails_root → rails_test}/public/images/file_icons/file_divx.gif +0 -0
  114. data/test/{rails_root → rails_test}/public/images/file_icons/file_doc.gif +0 -0
  115. data/test/{rails_root → rails_test}/public/images/file_icons/file_eps.gif +0 -0
  116. data/test/{rails_root → rails_test}/public/images/file_icons/file_flac.gif +0 -0
  117. data/test/{rails_root → rails_test}/public/images/file_icons/file_flv.gif +0 -0
  118. data/test/{rails_root → rails_test}/public/images/file_icons/file_gif.gif +0 -0
  119. data/test/{rails_root → rails_test}/public/images/file_icons/file_html.gif +0 -0
  120. data/test/{rails_root → rails_test}/public/images/file_icons/file_ical.gif +0 -0
  121. data/test/{rails_root → rails_test}/public/images/file_icons/file_indd.gif +0 -0
  122. data/test/{rails_root → rails_test}/public/images/file_icons/file_inx.gif +0 -0
  123. data/test/{rails_root → rails_test}/public/images/file_icons/file_iso.gif +0 -0
  124. data/test/{rails_root → rails_test}/public/images/file_icons/file_jpg.gif +0 -0
  125. data/test/{rails_root → rails_test}/public/images/file_icons/file_mov.gif +0 -0
  126. data/test/{rails_root → rails_test}/public/images/file_icons/file_mp3.gif +0 -0
  127. data/test/{rails_root → rails_test}/public/images/file_icons/file_mpg.gif +0 -0
  128. data/test/{rails_root → rails_test}/public/images/file_icons/file_pdf.gif +0 -0
  129. data/test/{rails_root → rails_test}/public/images/file_icons/file_php.gif +0 -0
  130. data/test/{rails_root → rails_test}/public/images/file_icons/file_png.gif +0 -0
  131. data/test/{rails_root → rails_test}/public/images/file_icons/file_pps.gif +0 -0
  132. data/test/{rails_root → rails_test}/public/images/file_icons/file_ppt.gif +0 -0
  133. data/test/{rails_root → rails_test}/public/images/file_icons/file_psd.gif +0 -0
  134. data/test/{rails_root → rails_test}/public/images/file_icons/file_qxd.gif +0 -0
  135. data/test/{rails_root → rails_test}/public/images/file_icons/file_qxp.gif +0 -0
  136. data/test/{rails_root → rails_test}/public/images/file_icons/file_raw.gif +0 -0
  137. data/test/{rails_root → rails_test}/public/images/file_icons/file_rtf.gif +0 -0
  138. data/test/{rails_root → rails_test}/public/images/file_icons/file_svg.gif +0 -0
  139. data/test/{rails_root → rails_test}/public/images/file_icons/file_tif.gif +0 -0
  140. data/test/{rails_root → rails_test}/public/images/file_icons/file_txt.gif +0 -0
  141. data/test/{rails_root → rails_test}/public/images/file_icons/file_vcf.gif +0 -0
  142. data/test/{rails_root → rails_test}/public/images/file_icons/file_wav.gif +0 -0
  143. data/test/{rails_root → rails_test}/public/images/file_icons/file_wma.gif +0 -0
  144. data/test/{rails_root → rails_test}/public/images/file_icons/file_xls.gif +0 -0
  145. data/test/{rails_root → rails_test}/public/images/file_icons/file_xml.gif +0 -0
  146. data/test/{rails_root → rails_test}/public/images/file_icons/mp3.gif +0 -0
  147. data/test/{rails_root → rails_test}/public/images/file_icons/pdf.gif +0 -0
  148. data/test/{rails_root → rails_test}/public/images/file_icons/pdf.png +0 -0
  149. data/test/{rails_root → rails_test}/public/images/file_icons/text.gif +0 -0
  150. data/test/{rails_root → rails_test}/public/images/file_icons/text.png +0 -0
  151. data/test/{rails_root → rails_test}/public/images/file_icons/word.gif +0 -0
  152. data/test/rails_test/public/images/rails.png +0 -0
  153. data/test/{rails_root/public/images → rails_test/public/images/swfupload}/SWFUploadButton.png +0 -0
  154. data/test/{rails_root/public/images → rails_test/public/images/swfupload}/cancelbutton.gif +0 -0
  155. data/test/{rails_root → rails_test}/public/images/uploadify/cancel.png +0 -0
  156. data/test/{rails_root → rails_test}/public/javascripts/application.js +0 -0
  157. data/test/{rails_root → rails_test}/public/javascripts/controls.js +75 -73
  158. data/test/{rails_root → rails_test}/public/javascripts/dragdrop.js +171 -169
  159. data/test/{rails_root → rails_test}/public/javascripts/effects.js +180 -177
  160. data/test/{rails_root/public/javascripts/jquery/jquery.js → rails_test/public/javascripts/jquery/jquery-1.4.2.min.js} +0 -0
  161. data/test/{rails_root/public/javascripts/jquery/jquery-ui.js → rails_test/public/javascripts/jquery/jquery-ui-1.8.4.custom.min.js} +0 -0
  162. data/test/{rails_root → rails_test}/public/javascripts/jquery/jquery.uploadify.min.js +0 -0
  163. data/test/rails_test/public/javascripts/prototype.js +6001 -0
  164. data/test/rails_test/public/javascripts/rails.js +175 -0
  165. data/test/{rails_root → rails_test}/public/javascripts/swf/swfobject.js +0 -0
  166. data/test/{rails_root → rails_test}/public/javascripts/swfupload/fileprogress.js +0 -0
  167. data/test/{rails_root → rails_test}/public/javascripts/swfupload/handlers.js +0 -0
  168. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.cookies.js +0 -0
  169. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.js +0 -0
  170. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.proxy.js +0 -0
  171. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.queue.js +0 -0
  172. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.speed.js +0 -0
  173. data/test/{rails_root → rails_test}/public/javascripts/swfupload/swfupload.swfobject.js +0 -0
  174. data/test/rails_test/public/robots.txt +5 -0
  175. data/test/{rails_root/test/functional/.keep → rails_test/public/stylesheets/.gitkeep} +0 -0
  176. data/test/{rails_root → rails_test}/public/stylesheets/swfupload.css +0 -0
  177. data/test/{rails_root → rails_test}/public/stylesheets/uploadify.css +0 -0
  178. data/test/{rails_root → rails_test}/public/swf/expressInstall.swf +0 -0
  179. data/test/{rails_root → rails_test}/public/swf/swfupload.swf +0 -0
  180. data/test/{rails_root → rails_test}/public/swf/swfupload_fp9.swf +0 -0
  181. data/test/{rails_root → rails_test}/public/swf/uploadify.swf +0 -0
  182. data/test/rails_test/script/rails +6 -0
  183. data/test/{rails_root → rails_test}/test/factories.rb +1 -1
  184. data/test/{rails_root → rails_test}/test/fixtures/files/5k.png +0 -0
  185. data/test/{rails_root → rails_test}/test/fixtures/files/IT'sUPPERCASE!AND WeIRD.JPG +0 -0
  186. data/test/rails_test/test/fixtures/rails.png +0 -0
  187. data/test/{rails_root/test → rails_test/test/fixtures}/test.doc +0 -0
  188. data/test/{rails_root/test → rails_test/test/fixtures}/test.pdf +0 -0
  189. data/test/rails_test/test/fixtures/test.txt +1 -0
  190. data/test/{rails_root/test → rails_test/test/fixtures}/test.xls +0 -0
  191. data/test/{rails_root/test/integration → rails_test/test/functional}/.keep +0 -0
  192. data/test/{rails_root → rails_test}/test/functional/default_controller_test.rb +0 -0
  193. data/test/{rails_root → rails_test}/test/functional/uploads_controller_test.rb +0 -0
  194. data/test/{rails_root/test/mocks/development → rails_test/test/integration}/.keep +0 -0
  195. data/test/rails_test/test/performance/browsing_test.rb +9 -0
  196. data/test/{rails_root → rails_test}/test/shoulda_macros/paperclip.rb +0 -0
  197. data/test/rails_test/test/test_helper.rb +25 -0
  198. data/test/{rails_root/test/mocks/test → rails_test/test/unit}/.keep +0 -0
  199. data/test/{rails_root → rails_test}/test/unit/upload_test.rb +9 -18
  200. data/test/{rails_root/test/unit/.keep → rails_test/vendor/plugins/.gitkeep} +0 -0
  201. data/uploader.gemspec +225 -255
  202. metadata +228 -258
  203. data/Gemfile +0 -13
  204. data/config/uploader_routes.rb +0 -3
  205. data/lib/active_record/acts/uploader_upload.rb +0 -279
  206. data/lib/uploader/initialize_routes.rb +0 -8
  207. data/lib/uploader/tasks.rb +0 -42
  208. data/rails/init.rb +0 -38
  209. data/tasks/rails.rake +0 -2
  210. data/test/rails_root/Capfile +0 -3
  211. data/test/rails_root/app/controllers/default_controller.rb +0 -12
  212. data/test/rails_root/app/models/upload.rb +0 -55
  213. data/test/rails_root/app/views/default/uploadify.html.erb +0 -17
  214. data/test/rails_root/config/boot.rb +0 -109
  215. data/test/rails_root/config/environment.rb +0 -29
  216. data/test/rails_root/config/environments/development.rb +0 -19
  217. data/test/rails_root/config/environments/production.rb +0 -1
  218. data/test/rails_root/config/environments/test.rb +0 -27
  219. data/test/rails_root/config/initializers/requires.rb +0 -13
  220. data/test/rails_root/config/initializers/session_store.rb +0 -8
  221. data/test/rails_root/config/initializers/uploader.rb +0 -11
  222. data/test/rails_root/config/routes.rb +0 -13
  223. data/test/rails_root/db/development.sqlite3 +0 -0
  224. data/test/rails_root/db/schema.rb +0 -47
  225. data/test/rails_root/db/test.sqlite3 +0 -0
  226. data/test/rails_root/public/.htaccess +0 -40
  227. data/test/rails_root/public/404.html +0 -30
  228. data/test/rails_root/public/422.html +0 -30
  229. data/test/rails_root/public/500.html +0 -30
  230. data/test/rails_root/public/dispatch.rb +0 -10
  231. data/test/rails_root/public/images/rails.png +0 -0
  232. data/test/rails_root/public/images/swfupload/SWFUploadButton.png +0 -0
  233. data/test/rails_root/public/images/swfupload/cancelbutton.gif +0 -0
  234. data/test/rails_root/public/javascripts/builder.js +0 -136
  235. data/test/rails_root/public/javascripts/jquery/jquery.easing.js +0 -1
  236. data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +0 -9
  237. data/test/rails_root/public/javascripts/jquery/jquery.form.js +0 -637
  238. data/test/rails_root/public/javascripts/jquery/jquery.jgrowl.js +0 -2
  239. data/test/rails_root/public/javascripts/jquery/jquery.tips.js +0 -69
  240. data/test/rails_root/public/javascripts/jquery/jrails.js +0 -1
  241. data/test/rails_root/public/javascripts/prototype.js +0 -4225
  242. data/test/rails_root/public/javascripts/scriptaculous.js +0 -58
  243. data/test/rails_root/public/javascripts/slider.js +0 -277
  244. data/test/rails_root/public/javascripts/sound.js +0 -60
  245. data/test/rails_root/public/robots.txt +0 -1
  246. data/test/rails_root/script/about +0 -3
  247. data/test/rails_root/script/breakpointer +0 -3
  248. data/test/rails_root/script/console +0 -3
  249. data/test/rails_root/script/create_project.rb +0 -52
  250. data/test/rails_root/script/cucumber +0 -7
  251. data/test/rails_root/script/dbconsole +0 -3
  252. data/test/rails_root/script/destroy +0 -3
  253. data/test/rails_root/script/generate +0 -3
  254. data/test/rails_root/script/performance/benchmarker +0 -3
  255. data/test/rails_root/script/performance/profiler +0 -3
  256. data/test/rails_root/script/performance/request +0 -3
  257. data/test/rails_root/script/plugin +0 -3
  258. data/test/rails_root/script/process/inspector +0 -3
  259. data/test/rails_root/script/process/reaper +0 -3
  260. data/test/rails_root/script/process/spawner +0 -3
  261. data/test/rails_root/script/runner +0 -3
  262. data/test/rails_root/script/server +0 -3
  263. data/test/rails_root/test/test_helper.rb +0 -26
@@ -14,4 +14,14 @@
14
14
 
15
15
  <p>Upload With Background Button using transparent:
16
16
  <%= upload_form(@user, false, container_prefix = 'background', :transparent => true) %>
17
- </p>
17
+ </p>
18
+
19
+ <h2>Uploaded files:</h2>
20
+ <div id="results"></div>
21
+
22
+ <script type='text/javascript'>
23
+ function upload_completed_callback(data){
24
+ jQuery('#results').append(data);
25
+ return true;
26
+ }
27
+ </script>
@@ -0,0 +1,27 @@
1
+ <h1>Uploadify</h1>
2
+
3
+ <p>
4
+ <a href="/">SWFUpload</a> | <a href="/default/uploadify">uploadify</a>
5
+ </p>
6
+
7
+ <p>Upload One restricted to 10 MB:
8
+ <%= uploadify_form(@user, { :display_upload_indicators => true, :container_prefix => '' }, { :sizeLimit => 1310720 }) %>
9
+ </p>
10
+
11
+ <p>Upload restricted to images:
12
+ <%= uploadify_form(@user, { :display_upload_indicators => false, :container_prefix => 'a_container_with_a_long_name' }, { :fileExt => '*.jpg;*.gif;*.png', :fileDesc => 'Images' }) %>
13
+ </p>
14
+
15
+ <p>Upload With Custom Background Button and rollover:
16
+ <%= uploadify_form(@user, { :display_upload_indicators => false, :container_prefix => 'background' }, { :buttonImg => '/images/swfupload/SWFUploadButton.png', :width => 61, :height => 22, :rollover => true }) %>
17
+ </p>
18
+
19
+ <h2>Uploaded files:</h2>
20
+ <div id="results"></div>
21
+
22
+ <script type='text/javascript'>
23
+ function upload_completed_callback(data){
24
+ jQuery('#results').append(data);
25
+ return true;
26
+ }
27
+ </script>
@@ -5,8 +5,8 @@
5
5
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
6
  <title>Uploader</title>
7
7
  <%= javascript_include_tag %w{
8
- jquery/jquery.js
9
- jquery/jquery-ui.js
8
+ jquery/jquery-1.4.2.min.js
9
+ jquery/jquery-ui-1.8.4.custom.min.js
10
10
  application.js }, :cache => 'all_js_cached' %>
11
11
  <%= yield :head -%>
12
12
  </head>
@@ -1,22 +1,16 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require "active_model/railtie"
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_view/railtie"
7
- require "action_mailer/railtie"
3
+ require 'rails/all'
8
4
 
9
- Bundler.require
10
- require "uploader"
5
+ # If you have a Gemfile, require the gems listed there, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
11
8
 
12
- # Load a global constant so the initializers can use them
13
9
  require 'ostruct'
14
10
  require 'yaml'
11
+ ::GlobalConfig = OpenStruct.new(YAML.load_file(File.expand_path('../global_config.yml', __FILE__))[Rails.env])
15
12
 
16
- ::GlobalConfig = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/global_config.yml")[RAILS_ENV])
17
-
18
-
19
- module RailsRoot
13
+ module RailsTest
20
14
  class Application < Rails::Application
21
15
  # Settings in config/environments/* take precedence over those specified here.
22
16
  # Application configuration should go into files in config/initializers
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
@@ -1,22 +1,14 @@
1
1
  development:
2
2
  adapter: mysql
3
- encoding: utf8
4
3
  database: uploader_development
5
4
  username: root
6
5
  password:
7
- host: 127.0.0.1
6
+ host: localhost
7
+ encoding: utf8
8
8
  test:
9
9
  adapter: mysql
10
- encoding: utf8
11
10
  database: uploader_test
12
11
  username: root
13
12
  password:
14
- socket: /tmp/mysql.sock
15
-
16
- production:
17
- adapter: mysql
13
+ host: localhost
18
14
  encoding: utf8
19
- database: uploader_production
20
- username: root
21
- password:
22
- socket: /tmp/mysql.sock
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ RailsTest::Application.initialize!
@@ -0,0 +1,26 @@
1
+ RailsTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+ end
26
+
@@ -0,0 +1,49 @@
1
+ RailsTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end
@@ -0,0 +1,35 @@
1
+ RailsTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
@@ -1,8 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
3
+ # Add new inflection rules using the following format
4
4
  # (all these examples are active by default):
5
- # Inflector.inflections do |inflect|
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
6
  # inflect.plural /^(ox)$/i, '\1en'
7
7
  # inflect.singular /^(ox)en/i, '\1'
8
8
  # inflect.irregular 'person', 'people'
@@ -1,4 +1,4 @@
1
- s3_file = "#{RAILS_ROOT}/config/s3.yml"
1
+ s3_file = "#{::Rails.root.to_s}/config/s3.yml"
2
2
  if File.exist?(s3_file)
3
3
  AMAZON_S3_CREDENTIALS = s3_file
4
4
  else
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = GlobalConfig.session_secret
7
+ RailsTest::Application.config.secret_token = '00660fb150b4de2e86515b327062db21f9b2f6ef379c131062eda31fde4db790bb6425b4e5077790ea4bbe6a0712baeeb08b8861bf75d7051efaab0276b48736'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ RailsTest::Application.config.session_store :cookie_store, :key => '_empty_rails_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rake db:sessions:create")
8
+ # RailsTest::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,13 @@
1
+ RailsTest::Application.routes.draw do
2
+
3
+ root :to => "default#index"
4
+
5
+ resources :uploads do
6
+ collection do
7
+ post :multiupload
8
+ end
9
+ end
10
+ resources :users
11
+
12
+ match ':controller(/:action(/:id(.:format)))'
13
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run RailsTest::Application
File without changes
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Daley', :city => cities.first)
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>