paperclip_attributes 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +167 -0
- data/MIT-LICENSE +20 -0
- data/README.md +105 -0
- data/Rakefile +21 -0
- data/app/assets/images/paperclip_attributes/.keep +0 -0
- data/app/assets/javascripts/paperclip_attributes/.keep +0 -0
- data/app/assets/stylesheets/paperclip_attributes/.keep +0 -0
- data/app/controllers/.keep +0 -0
- data/app/helpers/.keep +0 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/views/.keep +0 -0
- data/bin/rails +12 -0
- data/config/routes.rb +2 -0
- data/lib/generators/paperclip_attributes/USAGE +17 -0
- data/lib/generators/paperclip_attributes/paperclip_attributes_generator.rb +34 -0
- data/lib/paperclip/has_attached_file_override.rb +21 -0
- data/lib/paperclip_attributes/attributes.rb +34 -0
- data/lib/paperclip_attributes/command.rb +44 -0
- data/lib/paperclip_attributes/commands/add_photo_dimensions.rb +27 -0
- data/lib/paperclip_attributes/commands/add_photo_dominant_color.rb +35 -0
- data/lib/paperclip_attributes/engine.rb +15 -0
- data/lib/paperclip_attributes/error.rb +21 -0
- data/lib/paperclip_attributes/version.rb +3 -0
- data/lib/paperclip_attributes.rb +7 -0
- data/lib/tasks/paperclip_attributes_tasks.rake +4 -0
- data/paperclip_attributes.gemspec +28 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +31 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20160429182529_create_users.rb +9 -0
- data/spec/dummy/db/migrate/20160429182620_add_attachment_avatar_to_users.rb +11 -0
- data/spec/dummy/db/migrate/20160429205001_add_avatar_dimensions_to_users.rb +6 -0
- data/spec/dummy/db/migrate/20160501021321_add_avatar_color_to_users.rb +5 -0
- data/spec/dummy/db/schema.rb +29 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +83 -0
- data/spec/dummy/log/test.log +4753 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/system/users/avatars/000/000/001/original/pikachu.png +0 -0
- data/spec/dummy/spec/assets/bukowski.jpg +0 -0
- data/spec/dummy/spec/assets/pikachu.png +0 -0
- data/spec/dummy/spec/assets/video.mp4 +0 -0
- data/spec/dummy/spec/factories/users.rb +4 -0
- data/spec/dummy/spec/lib/paperclip_attributes/commands/add_photo_dimensions_spec.rb +29 -0
- data/spec/dummy/spec/lib/paperclip_attributes/commands/add_photo_dominant_color_spec.rb +27 -0
- data/spec/dummy/spec/models/user_spec.rb +53 -0
- data/spec/rails_helper.rb +61 -0
- data/spec/spec_helper.rb +92 -0
- metadata +284 -0
|
@@ -0,0 +1,29 @@
|
|
|
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: 20160501021321) do
|
|
15
|
+
|
|
16
|
+
create_table "users", force: :cascade do |t|
|
|
17
|
+
t.string "name"
|
|
18
|
+
t.datetime "created_at", null: false
|
|
19
|
+
t.datetime "updated_at", null: false
|
|
20
|
+
t.string "avatar_file_name"
|
|
21
|
+
t.string "avatar_content_type"
|
|
22
|
+
t.integer "avatar_file_size"
|
|
23
|
+
t.datetime "avatar_updated_at"
|
|
24
|
+
t.integer "avatar_height"
|
|
25
|
+
t.integer "avatar_width"
|
|
26
|
+
t.string "avatar_dominant_color"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
|
2
|
+
[1m[35m (0.4ms)[0m select sqlite_version(*)
|
|
3
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
|
5
|
+
Migrating to CreateUsers (20160429182529)
|
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
7
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
|
8
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160429182529"]]
|
|
9
|
+
[1m[35m (0.6ms)[0m commit transaction
|
|
10
|
+
Migrating to AddAttachmentAvatarToUsers (20160429182620)
|
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
|
12
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
|
13
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
14
|
+
Migrating to AddAttachmentAvatarToUsers (20160429182620)
|
|
15
|
+
[1m[35m (0.1ms)[0m begin transaction
|
|
16
|
+
[1m[36m (0.4ms)[0m [1mALTER TABLE "users" ADD "avatar_file_name" varchar[0m
|
|
17
|
+
[1m[35m (0.1ms)[0m ALTER TABLE "users" ADD "avatar_content_type" varchar
|
|
18
|
+
[1m[36m (0.1ms)[0m [1mALTER TABLE "users" ADD "avatar_file_size" integer[0m
|
|
19
|
+
[1m[35m (0.1ms)[0m ALTER TABLE "users" ADD "avatar_updated_at" datetime
|
|
20
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160429182620"]]
|
|
21
|
+
[1m[35m (0.6ms)[0m commit transaction
|
|
22
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
23
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
24
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
25
|
+
Migrating to AddAvatarDimensionsToUsers (20160429205001)
|
|
26
|
+
[1m[35m (0.1ms)[0m begin transaction
|
|
27
|
+
[1m[36m (0.5ms)[0m [1mALTER TABLE "users" ADD "avatar_height" integer[0m
|
|
28
|
+
[1m[35m (0.2ms)[0m ALTER TABLE "users" ADD "avatar_width" integer
|
|
29
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160429205001"]]
|
|
30
|
+
[1m[35m (1.1ms)[0m commit transaction
|
|
31
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
32
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
33
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-04-29 21:21:07.109778"], ["updated_at", "2016-04-29 21:21:07.109778"]]
|
|
34
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
|
35
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
36
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-04-30 22:30:49.361488"], ["updated_at", "2016-04-30 22:30:49.361488"]]
|
|
37
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
|
38
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
39
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
|
40
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
41
|
+
[1m[35mUser Load (0.8ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
|
42
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
43
|
+
Migrating to AddAvatarColorToUsers (20160501021321)
|
|
44
|
+
[1m[35m (0.1ms)[0m begin transaction
|
|
45
|
+
[1m[36m (0.7ms)[0m [1mALTER TABLE "users" ADD "avatar_dominant_color" varchar[0m
|
|
46
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160501021321"]]
|
|
47
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
|
48
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
|
49
|
+
Command :: file -b --mime '/var/folders/bl/fzn_995j28x9hvtjvsb8vb4h0000gn/T/9c532ce2a80fc7bcbcf19a41de67568c20160430-66827-jbsbfd.jpg'
|
|
50
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
51
|
+
Command :: file -b --mime '/var/folders/bl/fzn_995j28x9hvtjvsb8vb4h0000gn/T/9c532ce2a80fc7bcbcf19a41de67568c20160430-66827-1kdmu18.jpg'
|
|
52
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "users" ("avatar_file_name", "avatar_content_type", "avatar_file_size", "avatar_updated_at", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["avatar_file_name", "gohan.jpg"], ["avatar_content_type", "image/jpeg"], ["avatar_file_size", 69455], ["avatar_updated_at", "2016-05-01 02:53:28.208756"], ["created_at", "2016-05-01 02:53:28.229420"], ["updated_at", "2016-05-01 02:53:28.229420"]]
|
|
53
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
|
54
|
+
[1m[35mUser Load (0.3ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
|
55
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
56
|
+
[1m[35mUser Load (0.2ms)[0m SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
|
|
57
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Started GET "/" for ::1 at 2016-05-01 00:20:05 -0300
|
|
61
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.9ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
62
|
+
Processing by Rails::WelcomeController#index as HTML
|
|
63
|
+
Rendered /opt/rubies/2.0.0-p645/lib/ruby/gems/2.0.0/gems/railties-4.2.5.2/lib/rails/templates/rails/welcome/index.html.erb (1.5ms)
|
|
64
|
+
Completed 200 OK in 10ms (Views: 9.3ms | ActiveRecord: 0.0ms)
|
|
65
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
66
|
+
[1m[35m (0.1ms)[0m begin transaction
|
|
67
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2016-05-01 03:20:30.153268"], ["updated_at", "2016-05-01 03:20:30.153268"]]
|
|
68
|
+
[1m[35m (1.0ms)[0m commit transaction
|
|
69
|
+
[1m[36mUser Load (0.5ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
70
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
71
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
72
|
+
[1m[36mUser Load (0.4ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
73
|
+
[1m[36mUser Load (0.3ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1[0m
|
|
74
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
75
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
|
76
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
77
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
|
78
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
79
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "LEANDR"], ["created_at", "2016-05-02 17:49:35.069512"], ["updated_at", "2016-05-02 17:49:35.069512"]]
|
|
80
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
|
81
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
|
82
|
+
[1m[35mSQL (1.3ms)[0m INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "leandr"], ["created_at", "2016-05-02 17:50:15.155565"], ["updated_at", "2016-05-02 17:50:15.155565"]]
|
|
83
|
+
[1m[36m (1.4ms)[0m [1mcommit transaction[0m
|