paperclip_attributes 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ script:
6
+ - cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:migrate
7
+ - cd ../.. && bundle exec rspec spec
8
+ deploy:
9
+ provider: rubygems
10
+ api_key:
11
+ secure: vCkiG5yfu9KE/I4JQNG6gihE8ayBYsDbYRRmVIYw09DUC3C7En+mvGYjtwZTLMt4gmdltRngL20VQ8+OLqCxP4OneDg36R46CskkDim1OgKsk9M8++QKMbc3MGblxAfSkzxvsZ0w4T1APFzqcHbxwJberpkVTw/eweUK85WJTMX8hwYSqlXdYb1xMyeGFUhRp0qt9GHXma+qhg/vMM1e7aymbZQrE00d9WzHaW4egwzM4J0Ggk+XOXVs7CDdblKB1Ui87wOz3WcakwjTRQ289FjInAasFYVVphoo7R5fAWAahgjQ3ubD/nN00+TkT+No+9zCwKWMjfzSsDMg9r++GkarC8QS7F2/DUCRtxzfAbzZvPEndbyTWIji0iBHTkrWAa7+COGeBNdZ+yNqc76mITPxnwfBN5za5RtEUNNtaD/qiRQnq/1blYEOz1xQ0NG46HxrZ7FQ60Wtv5+Rt3LsfG9LYravurueINVdIJTZadeDp2hfSHP6AF9T9Q6XQZKeb3chEwoaETJfEfz4PRGfWF8fM8HzlB/Vd63DRdt+uaCVKSypt/GpkWWFzuMFTgQB/Cwfp482S/qs8mFGWor2qOdxJmHZz1LvtTy0wEEvh91O3ad97Z7jQPNU71tAV6V4ifMTSKocDGn6Av/6vT95+fqjP/G+a6BwHWJf4ca63pQ=
12
+ gem: paperclip_attributes
13
+ on:
14
+ tags: true
15
+ repo: platanus/paperclip_attributes
@@ -2,6 +2,14 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ### v0.2.0
6
+
7
+ ##### Added
8
+
9
+ * Add Hound configuration.
10
+ * Deploy with Travis CI
11
+ * Configure coveralls
12
+
5
13
  ### v0.1.2
6
14
 
7
15
  ##### Fixed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperclip_attributes (0.1.2)
4
+ paperclip_attributes (0.2.0)
5
5
  miro (~> 0.3.0)
6
6
  paperclip (~> 4.2, >= 4.2.0)
7
7
  rails (~> 4.2, >= 4.2.0)
@@ -44,24 +44,30 @@ GEM
44
44
  minitest (~> 5.1)
45
45
  thread_safe (~> 0.3, >= 0.3.4)
46
46
  tzinfo (~> 1.1)
47
- arel (6.0.3)
47
+ arel (6.0.4)
48
48
  builder (3.2.2)
49
49
  chunky_png (1.3.5)
50
- climate_control (0.0.3)
51
- activesupport (>= 3.0)
50
+ climate_control (0.1.0)
52
51
  cocaine (0.5.8)
53
52
  climate_control (>= 0.0.3, < 1.0)
54
53
  coderay (1.1.1)
55
54
  color (1.8)
56
- concurrent-ruby (1.0.2)
55
+ concurrent-ruby (1.0.5)
56
+ coveralls (0.8.19)
57
+ json (>= 1.8, < 3)
58
+ simplecov (~> 0.12.0)
59
+ term-ansicolor (~> 1.3)
60
+ thor (~> 0.19.1)
61
+ tins (~> 1.6)
57
62
  diff-lcs (1.2.5)
63
+ docile (1.1.5)
58
64
  erubis (2.7.0)
59
65
  factory_girl (4.5.0)
60
66
  activesupport (>= 3.0.0)
61
67
  factory_girl_rails (4.6.0)
62
68
  factory_girl (~> 4.5.0)
63
69
  railties (>= 3.0.0)
64
- globalid (0.3.6)
70
+ globalid (0.3.7)
65
71
  activesupport (>= 4.1.0)
66
72
  i18n (0.7.0)
67
73
  json (1.8.3)
@@ -70,9 +76,9 @@ GEM
70
76
  mail (2.6.4)
71
77
  mime-types (>= 1.16, < 4)
72
78
  method_source (0.8.2)
73
- mime-types (3.0)
79
+ mime-types (3.1)
74
80
  mime-types-data (~> 3.2015)
75
- mime-types-data (3.2016.0221)
81
+ mime-types-data (3.2016.0521)
76
82
  mimemagic (0.3.0)
77
83
  mini_portile2 (2.0.0)
78
84
  minitest (5.8.4)
@@ -84,7 +90,7 @@ GEM
84
90
  mini_portile2 (~> 2.0.0.rc2)
85
91
  oily_png (1.2.0)
86
92
  chunky_png (~> 1.3.1)
87
- paperclip (4.3.6)
93
+ paperclip (4.3.7)
88
94
  activemodel (>= 3.2.0)
89
95
  activesupport (>= 3.2.0)
90
96
  cocaine (~> 0.5.5)
@@ -139,17 +145,25 @@ GEM
139
145
  rspec-mocks (~> 3.4.0)
140
146
  rspec-support (~> 3.4.0)
141
147
  rspec-support (3.4.1)
148
+ simplecov (0.12.0)
149
+ docile (~> 1.1.0)
150
+ json (>= 1.8, < 3)
151
+ simplecov-html (~> 0.10.0)
152
+ simplecov-html (0.10.0)
142
153
  slop (3.6.0)
143
- sprockets (3.6.0)
154
+ sprockets (3.7.1)
144
155
  concurrent-ruby (~> 1.0)
145
156
  rack (> 1, < 3)
146
- sprockets-rails (3.0.4)
157
+ sprockets-rails (3.2.0)
147
158
  actionpack (>= 4.0)
148
159
  activesupport (>= 4.0)
149
160
  sprockets (>= 3.0.0)
150
161
  sqlite3 (1.3.11)
162
+ term-ansicolor (1.4.0)
163
+ tins (~> 1.0)
151
164
  thor (0.19.1)
152
165
  thread_safe (0.3.5)
166
+ tins (1.13.2)
153
167
  tzinfo (1.2.2)
154
168
  thread_safe (~> 0.1)
155
169
 
@@ -157,6 +171,7 @@ PLATFORMS
157
171
  ruby
158
172
 
159
173
  DEPENDENCIES
174
+ coveralls
160
175
  factory_girl_rails (~> 4.6.0)
161
176
  paperclip_attributes!
162
177
  pry
@@ -164,4 +179,4 @@ DEPENDENCIES
164
179
  sqlite3
165
180
 
166
181
  BUNDLED WITH
167
- 1.11.2
182
+ 1.14.4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Paperclip Attributes
1
+ # Paperclip Attributes [![Build Status](https://travis-ci.org/platanus/paperclip_attributes.svg?branch=master)](https://travis-ci.org/platanus/paperclip_attributes) [![Coverage Status](https://coveralls.io/repos/github/platanus/paperclip_attributes/badge.svg)](https://coveralls.io/github/platanus/paperclip_attributes)
2
2
 
3
3
  Rails Engine built on top of [Paperclip](https://github.com/thoughtbot/paperclip) gem to add attributes, as columns in your models, related to your attachments.
4
4
 
@@ -19,9 +19,9 @@ module PaperclipAttributes
19
19
  end
20
20
  rescue Exception => e
21
21
  default_color = "#BCBABA"
22
- Rails.logger.info("Error trying to get dominant color...")
23
- Rails.logger.info(e.message)
24
- Rails.logger.info("Returning default: #{default_color}")
22
+ Rails.logger.error("Error trying to get dominant color...")
23
+ Rails.logger.error(e.message)
24
+ Rails.logger.error("Returning default: #{default_color}")
25
25
  default_color
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module PaperclipAttributes
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -25,4 +25,5 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "sqlite3"
26
26
  s.add_development_dependency "rspec-rails", "~> 3.4.0"
27
27
  s.add_development_dependency "factory_girl_rails", "~> 4.6.0"
28
+ s.add_development_dependency "coveralls"
28
29
  end
@@ -4,6 +4,9 @@ RSpec.describe PaperclipAttributes::Commands::AddPhotoDominantColor do
4
4
  describe "#perform" do
5
5
  context "with image content type" do
6
6
  before do
7
+ allow_any_instance_of(Miro::DominantColors).to(
8
+ receive(:to_hex).and_return(double(first: "#6a675c"))
9
+ )
7
10
  @user = User.new(avatar: fixture_file_upload("bukowski.jpg", "image/png"))
8
11
  described_class.new(@user, :avatar).perform
9
12
  end
@@ -17,6 +17,9 @@ RSpec.describe User, type: :model do
17
17
 
18
18
  context "saving instance" do
19
19
  before do
20
+ allow_any_instance_of(Miro::DominantColors).to(
21
+ receive(:to_hex).and_return(double(first: "#6a675c"))
22
+ )
20
23
  @user.name = "Leandro"
21
24
  @user.save
22
25
  end
@@ -29,6 +32,10 @@ RSpec.describe User, type: :model do
29
32
 
30
33
  context "changing image" do
31
34
  before do
35
+ allow_any_instance_of(Miro::DominantColors).to(
36
+ receive(:to_hex).and_return(double(first: "#fffd76"))
37
+ )
38
+
32
39
  @user.avatar = fixture_file_upload("pikachu.png", "image/png")
33
40
  @user.save
34
41
  end
@@ -36,7 +43,7 @@ RSpec.describe User, type: :model do
36
43
  it "recalculates values after change image" do
37
44
  expect(@user.avatar_width).to eq(249)
38
45
  expect(@user.avatar_height).to eq(307)
39
- expect(@user.avatar_dominant_color).to eq("#fffd76")
46
+ expect(@user.avatar_dominant_color).to eq("#ffffa9")
40
47
  end
41
48
  end
42
49
  end
@@ -1,3 +1,23 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter::new(formatters)
6
+
7
+ SimpleCov.start do
8
+ add_filter do |src|
9
+ r = [
10
+ src.filename =~ /lib/,
11
+ src.filename =~ /models/,
12
+ src.filename =~ /controllers/
13
+ ].uniq
14
+ r.count == 1 && r.first.nil?
15
+ end
16
+
17
+ add_filter "engine.rb"
18
+ add_filter "spec.rb"
19
+ end
20
+
1
21
  # This file is copied to spec/ when you run 'rails generate rspec:install'
2
22
  ENV['RAILS_ENV'] ||= 'test'
3
23
  require File.expand_path("../../spec/dummy/config/environment", __FILE__)
@@ -6,6 +26,7 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
6
26
  require 'spec_helper'
7
27
  require 'rspec/rails'
8
28
  require 'factory_girl_rails'
29
+
9
30
  # Add additional requires below this line. Rails is not loaded until this point!
10
31
 
11
32
  # Requires supporting ruby files with custom matchers and macros, etc, in
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
@@ -9,118 +9,132 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-04 00:00:00.000000000 Z
12
+ date: 2017-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '4.2'
21
- - - '>='
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 4.2.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ~>
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
30
  version: '4.2'
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 4.2.0
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: paperclip
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.2'
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 4.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ~>
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '4.2'
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 4.2.0
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: miro
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.3.0
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: 0.3.0
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: pry
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: sqlite3
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: rspec-rails
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ~>
100
+ - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 3.4.0
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ~>
107
+ - - "~>"
108
108
  - !ruby/object:Gem::Version
109
109
  version: 3.4.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: factory_girl_rails
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ~>
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: 4.6.0
117
117
  type: :development
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - ~>
121
+ - - "~>"
122
122
  - !ruby/object:Gem::Version
123
123
  version: 4.6.0
124
+ - !ruby/object:Gem::Dependency
125
+ name: coveralls
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
124
138
  description: Rails Engine built on top of Paperclip gem to add extra attributes to
125
139
  your attachments.
126
140
  email:
@@ -130,8 +144,12 @@ executables: []
130
144
  extensions: []
131
145
  extra_rdoc_files: []
132
146
  files:
133
- - .gitignore
134
- - .rspec
147
+ - ".coveralls.yml"
148
+ - ".gitignore"
149
+ - ".hound.yml"
150
+ - ".rspec"
151
+ - ".rubocop.yml"
152
+ - ".travis.yml"
135
153
  - CHANGELOG.md
136
154
  - Gemfile
137
155
  - Gemfile.lock
@@ -192,14 +210,12 @@ files:
192
210
  - spec/dummy/config/locales/en.yml
193
211
  - spec/dummy/config/routes.rb
194
212
  - spec/dummy/config/secrets.yml
195
- - spec/dummy/db/development.sqlite3
196
213
  - spec/dummy/db/migrate/20160429182529_create_users.rb
197
214
  - spec/dummy/db/migrate/20160429182620_add_attachment_avatar_to_users.rb
198
215
  - spec/dummy/db/migrate/20160429205001_add_avatar_dimensions_to_users.rb
199
216
  - spec/dummy/db/migrate/20160501021321_add_avatar_color_to_users.rb
200
217
  - spec/dummy/db/schema.rb
201
218
  - spec/dummy/db/test.sqlite3
202
- - spec/dummy/log/development.log
203
219
  - spec/dummy/log/test.log
204
220
  - spec/dummy/public/404.html
205
221
  - spec/dummy/public/422.html
@@ -225,21 +241,23 @@ require_paths:
225
241
  - lib
226
242
  required_ruby_version: !ruby/object:Gem::Requirement
227
243
  requirements:
228
- - - '>='
244
+ - - ">="
229
245
  - !ruby/object:Gem::Version
230
246
  version: '0'
231
247
  required_rubygems_version: !ruby/object:Gem::Requirement
232
248
  requirements:
233
- - - '>='
249
+ - - ">="
234
250
  - !ruby/object:Gem::Version
235
251
  version: '0'
236
252
  requirements: []
237
253
  rubyforge_project:
238
- rubygems_version: 2.6.1
254
+ rubygems_version: 2.4.5
239
255
  signing_key:
240
256
  specification_version: 4
241
257
  summary: Gem to add extra data to paperclip's attachments.
242
258
  test_files:
259
+ - spec/dummy/README.rdoc
260
+ - spec/dummy/Rakefile
243
261
  - spec/dummy/app/assets/javascripts/application.js
244
262
  - spec/dummy/app/assets/stylesheets/application.css
245
263
  - spec/dummy/app/controllers/application_controller.rb
@@ -250,6 +268,7 @@ test_files:
250
268
  - spec/dummy/bin/rails
251
269
  - spec/dummy/bin/rake
252
270
  - spec/dummy/bin/setup
271
+ - spec/dummy/config.ru
253
272
  - spec/dummy/config/application.rb
254
273
  - spec/dummy/config/boot.rb
255
274
  - spec/dummy/config/database.yml
@@ -268,23 +287,18 @@ test_files:
268
287
  - spec/dummy/config/locales/en.yml
269
288
  - spec/dummy/config/routes.rb
270
289
  - spec/dummy/config/secrets.yml
271
- - spec/dummy/config.ru
272
- - spec/dummy/db/development.sqlite3
273
290
  - spec/dummy/db/migrate/20160429182529_create_users.rb
274
291
  - spec/dummy/db/migrate/20160429182620_add_attachment_avatar_to_users.rb
275
292
  - spec/dummy/db/migrate/20160429205001_add_avatar_dimensions_to_users.rb
276
293
  - spec/dummy/db/migrate/20160501021321_add_avatar_color_to_users.rb
277
294
  - spec/dummy/db/schema.rb
278
295
  - spec/dummy/db/test.sqlite3
279
- - spec/dummy/log/development.log
280
296
  - spec/dummy/log/test.log
281
297
  - spec/dummy/public/404.html
282
298
  - spec/dummy/public/422.html
283
299
  - spec/dummy/public/500.html
284
300
  - spec/dummy/public/favicon.ico
285
301
  - spec/dummy/public/system/users/avatars/000/000/001/original/pikachu.png
286
- - spec/dummy/Rakefile
287
- - spec/dummy/README.rdoc
288
302
  - spec/dummy/spec/assets/bukowski.jpg
289
303
  - spec/dummy/spec/assets/pikachu.png
290
304
  - spec/dummy/spec/assets/video.mp4