paperclip_attributes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +3 -0
  4. data/CHANGELOG.md +7 -0
  5. data/Gemfile +14 -0
  6. data/Gemfile.lock +167 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +105 -0
  9. data/Rakefile +21 -0
  10. data/app/assets/images/paperclip_attributes/.keep +0 -0
  11. data/app/assets/javascripts/paperclip_attributes/.keep +0 -0
  12. data/app/assets/stylesheets/paperclip_attributes/.keep +0 -0
  13. data/app/controllers/.keep +0 -0
  14. data/app/helpers/.keep +0 -0
  15. data/app/mailers/.keep +0 -0
  16. data/app/models/.keep +0 -0
  17. data/app/views/.keep +0 -0
  18. data/bin/rails +12 -0
  19. data/config/routes.rb +2 -0
  20. data/lib/generators/paperclip_attributes/USAGE +17 -0
  21. data/lib/generators/paperclip_attributes/paperclip_attributes_generator.rb +34 -0
  22. data/lib/paperclip/has_attached_file_override.rb +21 -0
  23. data/lib/paperclip_attributes/attributes.rb +34 -0
  24. data/lib/paperclip_attributes/command.rb +44 -0
  25. data/lib/paperclip_attributes/commands/add_photo_dimensions.rb +27 -0
  26. data/lib/paperclip_attributes/commands/add_photo_dominant_color.rb +35 -0
  27. data/lib/paperclip_attributes/engine.rb +15 -0
  28. data/lib/paperclip_attributes/error.rb +21 -0
  29. data/lib/paperclip_attributes/version.rb +3 -0
  30. data/lib/paperclip_attributes.rb +7 -0
  31. data/lib/tasks/paperclip_attributes_tasks.rake +4 -0
  32. data/paperclip_attributes.gemspec +28 -0
  33. data/spec/dummy/README.rdoc +28 -0
  34. data/spec/dummy/Rakefile +6 -0
  35. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  36. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  37. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  38. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  39. data/spec/dummy/app/models/user.rb +6 -0
  40. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/spec/dummy/bin/bundle +3 -0
  42. data/spec/dummy/bin/rails +4 -0
  43. data/spec/dummy/bin/rake +4 -0
  44. data/spec/dummy/bin/setup +29 -0
  45. data/spec/dummy/config/application.rb +31 -0
  46. data/spec/dummy/config/boot.rb +5 -0
  47. data/spec/dummy/config/database.yml +25 -0
  48. data/spec/dummy/config/environment.rb +5 -0
  49. data/spec/dummy/config/environments/development.rb +41 -0
  50. data/spec/dummy/config/environments/production.rb +79 -0
  51. data/spec/dummy/config/environments/test.rb +42 -0
  52. data/spec/dummy/config/initializers/assets.rb +11 -0
  53. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  54. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  55. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  56. data/spec/dummy/config/initializers/inflections.rb +16 -0
  57. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  58. data/spec/dummy/config/initializers/session_store.rb +3 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  60. data/spec/dummy/config/locales/en.yml +23 -0
  61. data/spec/dummy/config/routes.rb +56 -0
  62. data/spec/dummy/config/secrets.yml +22 -0
  63. data/spec/dummy/config.ru +4 -0
  64. data/spec/dummy/db/development.sqlite3 +0 -0
  65. data/spec/dummy/db/migrate/20160429182529_create_users.rb +9 -0
  66. data/spec/dummy/db/migrate/20160429182620_add_attachment_avatar_to_users.rb +11 -0
  67. data/spec/dummy/db/migrate/20160429205001_add_avatar_dimensions_to_users.rb +6 -0
  68. data/spec/dummy/db/migrate/20160501021321_add_avatar_color_to_users.rb +5 -0
  69. data/spec/dummy/db/schema.rb +29 -0
  70. data/spec/dummy/db/test.sqlite3 +0 -0
  71. data/spec/dummy/log/development.log +83 -0
  72. data/spec/dummy/log/test.log +4753 -0
  73. data/spec/dummy/public/404.html +67 -0
  74. data/spec/dummy/public/422.html +67 -0
  75. data/spec/dummy/public/500.html +66 -0
  76. data/spec/dummy/public/favicon.ico +0 -0
  77. data/spec/dummy/public/system/users/avatars/000/000/001/original/pikachu.png +0 -0
  78. data/spec/dummy/spec/assets/bukowski.jpg +0 -0
  79. data/spec/dummy/spec/assets/pikachu.png +0 -0
  80. data/spec/dummy/spec/assets/video.mp4 +0 -0
  81. data/spec/dummy/spec/factories/users.rb +4 -0
  82. data/spec/dummy/spec/lib/paperclip_attributes/commands/add_photo_dimensions_spec.rb +29 -0
  83. data/spec/dummy/spec/lib/paperclip_attributes/commands/add_photo_dominant_color_spec.rb +27 -0
  84. data/spec/dummy/spec/models/user_spec.rb +53 -0
  85. data/spec/rails_helper.rb +61 -0
  86. data/spec/spec_helper.rb +92 -0
  87. 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
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.4ms) select sqlite_version(*)
3
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateUsers (20160429182529)
6
+  (0.1ms) begin transaction
7
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160429182529"]]
9
+  (0.6ms) commit transaction
10
+ Migrating to AddAttachmentAvatarToUsers (20160429182620)
11
+  (0.0ms) begin transaction
12
+  (0.0ms) rollback transaction
13
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
+ Migrating to AddAttachmentAvatarToUsers (20160429182620)
15
+  (0.1ms) begin transaction
16
+  (0.4ms) ALTER TABLE "users" ADD "avatar_file_name" varchar
17
+  (0.1ms) ALTER TABLE "users" ADD "avatar_content_type" varchar
18
+  (0.1ms) ALTER TABLE "users" ADD "avatar_file_size" integer
19
+  (0.1ms) ALTER TABLE "users" ADD "avatar_updated_at" datetime
20
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160429182620"]]
21
+  (0.6ms) commit transaction
22
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
24
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
+ Migrating to AddAvatarDimensionsToUsers (20160429205001)
26
+  (0.1ms) begin transaction
27
+  (0.5ms) ALTER TABLE "users" ADD "avatar_height" integer
28
+  (0.2ms) ALTER TABLE "users" ADD "avatar_width" integer
29
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160429205001"]]
30
+  (1.1ms) commit transaction
31
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
+  (0.1ms) begin transaction
33
+ SQL (0.9ms) 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
+  (0.6ms) commit transaction
35
+  (0.1ms) begin transaction
36
+ SQL (0.8ms) 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
+  (0.6ms) commit transaction
38
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
39
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
40
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
41
+ User Load (0.8ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
42
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
43
+ Migrating to AddAvatarColorToUsers (20160501021321)
44
+  (0.1ms) begin transaction
45
+  (0.7ms) ALTER TABLE "users" ADD "avatar_dominant_color" varchar
46
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160501021321"]]
47
+  (0.5ms) commit transaction
48
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
49
+ Command :: file -b --mime '/var/folders/bl/fzn_995j28x9hvtjvsb8vb4h0000gn/T/9c532ce2a80fc7bcbcf19a41de67568c20160430-66827-jbsbfd.jpg'
50
+  (0.1ms) begin transaction
51
+ Command :: file -b --mime '/var/folders/bl/fzn_995j28x9hvtjvsb8vb4h0000gn/T/9c532ce2a80fc7bcbcf19a41de67568c20160430-66827-1kdmu18.jpg'
52
+ SQL (0.9ms) 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
+  (0.5ms) commit transaction
54
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
55
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
56
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
57
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
58
+
59
+
60
+ Started GET "/" for ::1 at 2016-05-01 00:20:05 -0300
61
+ ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
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
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
66
+  (0.1ms) begin transaction
67
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2016-05-01 03:20:30.153268"], ["updated_at", "2016-05-01 03:20:30.153268"]]
68
+  (1.0ms) commit transaction
69
+ User Load (0.5ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
70
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
71
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
72
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
73
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
74
+  (0.1ms) begin transaction
75
+  (0.2ms) rollback transaction
76
+  (0.1ms) begin transaction
77
+  (0.1ms) rollback transaction
78
+  (0.1ms) begin transaction
79
+ SQL (0.9ms) 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
+  (0.6ms) commit transaction
81
+  (0.1ms) begin transaction
82
+ SQL (1.3ms) 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
+  (1.4ms) commit transaction