ksk 0.2.14 → 0.2.15

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: ef720e96b674e2bf5490608944f4b4a744fbda45
4
- data.tar.gz: 03577de50627891f9f39a6751cffd67a10873706
3
+ metadata.gz: ed81b7b99a4deb66356de2adc6c8f036655477d8
4
+ data.tar.gz: 35360c3933051318c9a73f098d074bc0856db754
5
5
  SHA512:
6
- metadata.gz: ca31239d744a46d29561702ce037e54ff0ef87757475c1f0cedd88788172b702988d72ce08ba9cf105497af5746161bf62edcf5be858c9e93b77bbd1ef8530d8
7
- data.tar.gz: 8b05855ae0763ff68912f48cde38de453aaca0e366f36253cf74d149518e61d7292829f0c86a1b93d2f1e52b17006c5430ad3e8d11ae8d39b0b0123b8c190b46
6
+ metadata.gz: 91179ee7965f4870e388478e7325ccad75f275f1d6d8bc43310a22640fb7f411a6a7b00f96f384c440bea181247bce690664b24d83445c0eb7764bf0d8c56b7e
7
+ data.tar.gz: 7894a25d602a3790ce6a3683349849044a6159793a0e964a0de4abfb40120b136b27f587a4b506f41d042a816f95d348a60b7c69541c042ef97b62a0f99368df
@@ -12,17 +12,16 @@ module Ksk::Asset
12
12
  after_initialize :resize_attr_accessors
13
13
  before_save :crop_thumbs, if: :cropping?
14
14
 
15
- IMGTYPE = ['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif']
16
15
  do_not_validate_attachment_file_type :file
17
16
 
18
- scope :only_images, -> {where(file_content_type: IMGTYPE)}
17
+ scope :only_images, -> {where(file_content_type: Bhf::PAPERCLIP_IMAGE_TYPES)}
19
18
  scope :first_image, -> {only_images.limit(1)}
20
19
  scope :other_images, -> {only_images.offset(1)}
21
20
 
22
- scope :only_data_files, -> {where('file_content_type not in (?)', IMGTYPE)}
21
+ scope :only_data_files, -> {where('file_content_type not in (?)', Bhf::PAPERCLIP_IMAGE_TYPES)}
23
22
  scope :first_data_files, -> {only_data_files.limit(1)}
24
23
 
25
- before_file_post_process :allow_only_images
24
+ before_file_post_process :is_image?
26
25
  end
27
26
 
28
27
  def resize_attr_accessors
@@ -66,15 +65,8 @@ module Ksk::Asset
66
65
  file.queued_for_write[name] = Paperclip.io_adapters.for(file.queued_for_write[name])
67
66
  end
68
67
 
69
-
70
- def allow_only_images
71
- if !(file.content_type =~ %r{^(image|(x-)?application)/(x-png|pjpeg|jpeg|jpg|png|gif)$})
72
- return false
73
- end
74
- end
75
-
76
68
  def is_image?
77
- IMGTYPE.include?(file.content_type)
69
+ Bhf::PAPERCLIP_IMAGE_TYPES.include?(file.content_type)
78
70
  end
79
71
 
80
72
  def has_preview?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ksk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.13
19
+ version: 0.7.16
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.13
26
+ version: 0.7.16
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: stringex
29
29
  requirement: !ruby/object:Gem::Requirement