file_upload 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/file_upload/application.js +13 -0
- data/app/assets/javascripts/file_upload.js.erb +148 -0
- data/app/assets/stylesheets/file_upload/application.css +13 -0
- data/app/assets/stylesheets/file_upload.css +3 -0
- data/app/controllers/file_upload/application_controller.rb +4 -0
- data/app/controllers/file_upload/redis_files_controller.rb +54 -0
- data/app/helpers/file_upload/application_helper.rb +4 -0
- data/app/helpers/file_upload/tag_helper.rb +25 -0
- data/app/models/file_upload/builder_mixin.rb +13 -0
- data/app/models/file_upload/redis_file.rb +159 -0
- data/app/models/file_upload/redis_file_readable.rb +21 -0
- data/app/models/file_upload/temp_file.rb +17 -0
- data/app/views/file_upload/redis_files/index.html.erb +1 -0
- data/app/views/file_upload/redis_files/new.html.erb +9 -0
- data/app/views/file_upload/redis_files/show.html.erb +15 -0
- data/app/views/file_upload/tags/_multiple.html.erb +44 -0
- data/app/views/file_upload/tags/_single.html.erb +46 -0
- data/app/views/layouts/file_upload/application.html.erb +14 -0
- data/config/routes.rb +6 -0
- data/lib/file_upload/engine.rb +40 -0
- data/lib/file_upload/version.rb +3 -0
- data/lib/file_upload.rb +7 -0
- data/lib/tasks/file_upload_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/jquery-1.10.2.min.js +6 -0
- data/test/dummy/app/assets/javascripts/jquery-ui.js +15003 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/db_files_controller.rb +8 -0
- data/test/dummy/app/controllers/emails_controller.rb +43 -0
- data/test/dummy/app/controllers/users_controller.rb +42 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/db_file.rb +13 -0
- data/test/dummy/app/models/email.rb +10 -0
- data/test/dummy/app/models/user.rb +9 -0
- data/test/dummy/app/views/db_files/_db_file.html.erb +1 -0
- data/test/dummy/app/views/emails/_email.html.erb +3 -0
- data/test/dummy/app/views/emails/_form.html.erb +24 -0
- data/test/dummy/app/views/emails/edit.html.erb +3 -0
- data/test/dummy/app/views/emails/index.html.erb +5 -0
- data/test/dummy/app/views/emails/new.html.erb +3 -0
- data/test/dummy/app/views/emails/show.html.erb +14 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/users/_form.html.erb +20 -0
- data/test/dummy/app/views/users/_user.html.erb +1 -0
- data/test/dummy/app/views/users/edit.html.erb +3 -0
- data/test/dummy/app/views/users/index.html.erb +5 -0
- data/test/dummy/app/views/users/new.html.erb +3 -0
- data/test/dummy/app/views/users/show.html.erb +8 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +28 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +31 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130820025256_add_users.rb +21 -0
- data/test/dummy/db/schema.rb +34 -0
- data/test/dummy/log/development.log +15541 -0
- data/test/dummy/log/test.log +26004 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1027254ad9f9317017cee3f9f844a862 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/21e0ff88cf13ca60a86a9b629cdca847 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/24cf35cebd10e0755a5585f9e486aa35 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/27413a86db5db5977d5dd1d87c724907 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5c6d9c2c3107f94ad59710d3b31f75 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3131541e8089635bc8595e2da83d1d81 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/32f1d616324cf52e9876bb83b9b0841a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/33474263b3841cd98ef63cde45dc85b2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3fa0d13a4820d4aa56f86ed4af4b88fc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4e07f6f4475a0dca9066eec990db088a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5512d0b5788ce193fd26bfadccd21304 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5d5ab91fa7d1eee7502e703747d4e933 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6b7e97595c37161f619adfd2b7724ea2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/87fa3cc4e2e49762d146f3d1709b3fb0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8806d06f37e08b22f9546e50ab98d671 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8cdad172c92eaf76e1b71c84f58a192e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/91e53bdf30a2b8e78bf99ca794addf70 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/96e2b2964d1d31d997a1af35ad0afed2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ab5c07d7e81fb5d5cf7460715f22bef6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b94837629e2fb2ef40ea66348764a9a2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c360bf7b66d29ebdf71b5814574b5fed +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e046b0166566aeeb2da51f2bde543364 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ec2d15616d5d09eb1693b761c72948ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fc0327db3eb7c687c31f2acf94871f86 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/1027254ad9f9317017cee3f9f844a862 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/21e0ff88cf13ca60a86a9b629cdca847 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/24cf35cebd10e0755a5585f9e486aa35 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/27413a86db5db5977d5dd1d87c724907 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/32f1d616324cf52e9876bb83b9b0841a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3fa0d13a4820d4aa56f86ed4af4b88fc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5d5ab91fa7d1eee7502e703747d4e933 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6b7e97595c37161f619adfd2b7724ea2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/87fa3cc4e2e49762d146f3d1709b3fb0 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8806d06f37e08b22f9546e50ab98d671 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ab5c07d7e81fb5d5cf7460715f22bef6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b94837629e2fb2ef40ea66348764a9a2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c360bf7b66d29ebdf71b5814574b5fed +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e046b0166566aeeb2da51f2bde543364 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ec2d15616d5d09eb1693b761c72948ce +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/fc0327db3eb7c687c31f2acf94871f86 +0 -0
- data/test/fixtures/avatar.jpeg +0 -0
- data/test/fixtures/test_upload.txt +1 -0
- data/test/integration/multiple_upload_test.rb +131 -0
- data/test/integration/single_upload_test.rb +157 -0
- data/test/test_helper.rb +60 -0
- data/test/unit/redis_file_readable_test.rb +30 -0
- data/test/unit/redis_file_test.rb +30 -0
- data/vendor/assets/javascripts/jquery.fileupload.js +1113 -0
- data/vendor/assets/javascripts/load-image.js +232 -0
- 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
|