paperclip_attributes 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ed112180691c94255c56909ea7649f89e6fa9ad
4
- data.tar.gz: 310bd0f61c716d8625113b72ebec324cf42493bb
3
+ metadata.gz: 79d2fafa457cd4d1cfb5ed275080f6adf89815a6
4
+ data.tar.gz: 6e24680efc5ba929e0e4827d2cb0c5d6ddcb4298
5
5
  SHA512:
6
- metadata.gz: b4f0cf2b8d45a8ffc2029d3366f13ce7eeac0ab21a2e13747bce98182e15fa8ff043ed936aa7a0dca6e8c49e2c309bc64d56587879cb2e1344380bbe0956d464
7
- data.tar.gz: cbf7ad026b2925beeb80adc491d601cc6c1fed73816a12a3f15077ec6bf1c2079eb99ae28e95c852eb6ddf36a7cedad78c8a9e86fec9a8225419c45b0fc133bd
6
+ metadata.gz: d8fc1a6478ca427f459354e5134028221ae5cf90f282bf419deead251fb5389a33da954cd9705a82828349ff1ff013c868abbbad77122340c5b4cdb192a2103f
7
+ data.tar.gz: 1b540c390d571bb062fb84880a101ca5633651471ec319d69aaae320b2558e1b85513bda0a980727e3f7335a9f156ed81ff3e46e62fa276f9bc3b5c2c0bdbbce
@@ -2,6 +2,12 @@
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.1.2
6
+
7
+ ##### Fixed
8
+
9
+ * Return default color if miro gem can't do it.
10
+
5
11
  ### v0.1.1
6
12
 
7
13
  ##### Fixed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperclip_attributes (0.1.1)
4
+ paperclip_attributes (0.1.2)
5
5
  miro (~> 0.3.0)
6
6
  paperclip (~> 4.2, >= 4.2.0)
7
7
  rails (~> 4.2, >= 4.2.0)
@@ -11,7 +11,7 @@ module ::Paperclip
11
11
  end
12
12
 
13
13
  def attachmets_recipes
14
- @attachmets_recipes
14
+ @attachmets_recipes || {}
15
15
  end
16
16
 
17
17
  def attachments_names
@@ -17,8 +17,12 @@ module PaperclipAttributes
17
17
  colors = Miro::DominantColors.new(tempfile.path)
18
18
  lighten_color(colors.to_hex.first)
19
19
  end
20
- rescue
21
- nil
20
+ rescue Exception => e
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}")
25
+ default_color
22
26
  end
23
27
 
24
28
  def lighten_color(hex_color, amount = 0.2)
@@ -1,3 +1,3 @@
1
1
  module PaperclipAttributes
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus