file_upload 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/app/assets/javascripts/file_upload/application.js +13 -0
  5. data/app/assets/javascripts/file_upload.js.erb +148 -0
  6. data/app/assets/stylesheets/file_upload/application.css +13 -0
  7. data/app/assets/stylesheets/file_upload.css +3 -0
  8. data/app/controllers/file_upload/application_controller.rb +4 -0
  9. data/app/controllers/file_upload/redis_files_controller.rb +54 -0
  10. data/app/helpers/file_upload/application_helper.rb +4 -0
  11. data/app/helpers/file_upload/tag_helper.rb +25 -0
  12. data/app/models/file_upload/builder_mixin.rb +13 -0
  13. data/app/models/file_upload/redis_file.rb +159 -0
  14. data/app/models/file_upload/redis_file_readable.rb +21 -0
  15. data/app/models/file_upload/temp_file.rb +17 -0
  16. data/app/views/file_upload/redis_files/index.html.erb +1 -0
  17. data/app/views/file_upload/redis_files/new.html.erb +9 -0
  18. data/app/views/file_upload/redis_files/show.html.erb +15 -0
  19. data/app/views/file_upload/tags/_multiple.html.erb +44 -0
  20. data/app/views/file_upload/tags/_single.html.erb +46 -0
  21. data/app/views/layouts/file_upload/application.html.erb +14 -0
  22. data/config/routes.rb +6 -0
  23. data/lib/file_upload/engine.rb +40 -0
  24. data/lib/file_upload/version.rb +3 -0
  25. data/lib/file_upload.rb +7 -0
  26. data/lib/tasks/file_upload_tasks.rake +4 -0
  27. data/test/dummy/README.rdoc +28 -0
  28. data/test/dummy/Rakefile +6 -0
  29. data/test/dummy/app/assets/javascripts/application.js +15 -0
  30. data/test/dummy/app/assets/javascripts/jquery-1.10.2.min.js +6 -0
  31. data/test/dummy/app/assets/javascripts/jquery-ui.js +15003 -0
  32. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  33. data/test/dummy/app/controllers/application_controller.rb +5 -0
  34. data/test/dummy/app/controllers/db_files_controller.rb +8 -0
  35. data/test/dummy/app/controllers/emails_controller.rb +43 -0
  36. data/test/dummy/app/controllers/users_controller.rb +42 -0
  37. data/test/dummy/app/helpers/application_helper.rb +2 -0
  38. data/test/dummy/app/models/db_file.rb +13 -0
  39. data/test/dummy/app/models/email.rb +10 -0
  40. data/test/dummy/app/models/user.rb +9 -0
  41. data/test/dummy/app/views/db_files/_db_file.html.erb +1 -0
  42. data/test/dummy/app/views/emails/_email.html.erb +3 -0
  43. data/test/dummy/app/views/emails/_form.html.erb +24 -0
  44. data/test/dummy/app/views/emails/edit.html.erb +3 -0
  45. data/test/dummy/app/views/emails/index.html.erb +5 -0
  46. data/test/dummy/app/views/emails/new.html.erb +3 -0
  47. data/test/dummy/app/views/emails/show.html.erb +14 -0
  48. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  49. data/test/dummy/app/views/users/_form.html.erb +20 -0
  50. data/test/dummy/app/views/users/_user.html.erb +1 -0
  51. data/test/dummy/app/views/users/edit.html.erb +3 -0
  52. data/test/dummy/app/views/users/index.html.erb +5 -0
  53. data/test/dummy/app/views/users/new.html.erb +3 -0
  54. data/test/dummy/app/views/users/show.html.erb +8 -0
  55. data/test/dummy/bin/bundle +3 -0
  56. data/test/dummy/bin/rails +4 -0
  57. data/test/dummy/bin/rake +4 -0
  58. data/test/dummy/config/application.rb +28 -0
  59. data/test/dummy/config/boot.rb +5 -0
  60. data/test/dummy/config/database.yml +31 -0
  61. data/test/dummy/config/environment.rb +5 -0
  62. data/test/dummy/config/environments/development.rb +29 -0
  63. data/test/dummy/config/environments/production.rb +80 -0
  64. data/test/dummy/config/environments/test.rb +36 -0
  65. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  66. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  67. data/test/dummy/config/initializers/inflections.rb +16 -0
  68. data/test/dummy/config/initializers/mime_types.rb +5 -0
  69. data/test/dummy/config/initializers/secret_token.rb +12 -0
  70. data/test/dummy/config/initializers/session_store.rb +3 -0
  71. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  72. data/test/dummy/config/locales/en.yml +23 -0
  73. data/test/dummy/config/routes.rb +7 -0
  74. data/test/dummy/config.ru +4 -0
  75. data/test/dummy/db/development.sqlite3 +0 -0
  76. data/test/dummy/db/migrate/20130820025256_add_users.rb +21 -0
  77. data/test/dummy/db/schema.rb +34 -0
  78. data/test/dummy/log/development.log +15541 -0
  79. data/test/dummy/log/test.log +26004 -0
  80. data/test/dummy/public/404.html +58 -0
  81. data/test/dummy/public/422.html +58 -0
  82. data/test/dummy/public/500.html +57 -0
  83. data/test/dummy/public/favicon.ico +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/1027254ad9f9317017cee3f9f844a862 +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/21e0ff88cf13ca60a86a9b629cdca847 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/24cf35cebd10e0755a5585f9e486aa35 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/27413a86db5db5977d5dd1d87c724907 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/2f5c6d9c2c3107f94ad59710d3b31f75 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/3131541e8089635bc8595e2da83d1d81 +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/32f1d616324cf52e9876bb83b9b0841a +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/33474263b3841cd98ef63cde45dc85b2 +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/3fa0d13a4820d4aa56f86ed4af4b88fc +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/4e07f6f4475a0dca9066eec990db088a +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/5512d0b5788ce193fd26bfadccd21304 +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/5d5ab91fa7d1eee7502e703747d4e933 +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/6b7e97595c37161f619adfd2b7724ea2 +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/87fa3cc4e2e49762d146f3d1709b3fb0 +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/8806d06f37e08b22f9546e50ab98d671 +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/8cdad172c92eaf76e1b71c84f58a192e +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/91e53bdf30a2b8e78bf99ca794addf70 +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/96e2b2964d1d31d997a1af35ad0afed2 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/ab5c07d7e81fb5d5cf7460715f22bef6 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/b94837629e2fb2ef40ea66348764a9a2 +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/c360bf7b66d29ebdf71b5814574b5fed +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/e046b0166566aeeb2da51f2bde543364 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/ec2d15616d5d09eb1693b761c72948ce +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/fc0327db3eb7c687c31f2acf94871f86 +0 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/1027254ad9f9317017cee3f9f844a862 +0 -0
  115. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/21e0ff88cf13ca60a86a9b629cdca847 +0 -0
  117. data/test/dummy/tmp/cache/assets/test/sprockets/24cf35cebd10e0755a5585f9e486aa35 +0 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/27413a86db5db5977d5dd1d87c724907 +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  120. data/test/dummy/tmp/cache/assets/test/sprockets/32f1d616324cf52e9876bb83b9b0841a +0 -0
  121. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  122. data/test/dummy/tmp/cache/assets/test/sprockets/3fa0d13a4820d4aa56f86ed4af4b88fc +0 -0
  123. data/test/dummy/tmp/cache/assets/test/sprockets/5d5ab91fa7d1eee7502e703747d4e933 +0 -0
  124. data/test/dummy/tmp/cache/assets/test/sprockets/6b7e97595c37161f619adfd2b7724ea2 +0 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/87fa3cc4e2e49762d146f3d1709b3fb0 +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/8806d06f37e08b22f9546e50ab98d671 +0 -0
  127. data/test/dummy/tmp/cache/assets/test/sprockets/ab5c07d7e81fb5d5cf7460715f22bef6 +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/b94837629e2fb2ef40ea66348764a9a2 +0 -0
  129. data/test/dummy/tmp/cache/assets/test/sprockets/c360bf7b66d29ebdf71b5814574b5fed +0 -0
  130. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/e046b0166566aeeb2da51f2bde543364 +0 -0
  133. data/test/dummy/tmp/cache/assets/test/sprockets/ec2d15616d5d09eb1693b761c72948ce +0 -0
  134. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  135. data/test/dummy/tmp/cache/assets/test/sprockets/fc0327db3eb7c687c31f2acf94871f86 +0 -0
  136. data/test/fixtures/avatar.jpeg +0 -0
  137. data/test/fixtures/test_upload.txt +1 -0
  138. data/test/integration/multiple_upload_test.rb +131 -0
  139. data/test/integration/single_upload_test.rb +157 -0
  140. data/test/test_helper.rb +60 -0
  141. data/test/unit/redis_file_readable_test.rb +30 -0
  142. data/test/unit/redis_file_test.rb +30 -0
  143. data/vendor/assets/javascripts/jquery.fileupload.js +1113 -0
  144. data/vendor/assets/javascripts/load-image.js +232 -0
  145. metadata +401 -0
@@ -0,0 +1,21 @@
1
+ class AddUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :name
5
+ end
6
+
7
+ create_table :emails do |t|
8
+ t.string :subject
9
+ t.string :message
10
+ end
11
+
12
+ create_table :db_files do |t|
13
+ t.string :owner_type
14
+ t.string :owner_id
15
+ t.string :name
16
+ t.integer :size
17
+ t.string :content_type
18
+ t.binary :data, limit: 10.megabyte
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,34 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20130820025256) do
15
+
16
+ create_table "db_files", force: true do |t|
17
+ t.string "owner_type"
18
+ t.string "owner_id"
19
+ t.string "name"
20
+ t.integer "size"
21
+ t.string "content_type"
22
+ t.binary "data", limit: 16777215
23
+ end
24
+
25
+ create_table "emails", force: true do |t|
26
+ t.string "subject"
27
+ t.string "message"
28
+ end
29
+
30
+ create_table "users", force: true do |t|
31
+ t.string "name"
32
+ end
33
+
34
+ end