refinerycms-images 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- module ::Refinery
1
+ module Refinery
2
2
  module Admin
3
3
  class ImagesController < ::Refinery::AdminController
4
4
 
@@ -1,12 +1,16 @@
1
+ require 'dragonfly'
2
+
1
3
  module Refinery
2
4
  class Image < Refinery::Core::BaseModel
5
+ ::Refinery::Images::Dragonfly.setup!
6
+
3
7
  include Images::Validators
4
8
 
5
9
  image_accessor :image
6
10
 
7
11
  validates :image, :presence => true
8
12
  validates_with ImageSizeValidator
9
- validates_property :mime_type, :of => :image, :in => %w(image/jpeg image/png image/gif image/tiff),
13
+ validates_property :mime_type, :of => :image, :in => ::Refinery::Images.whitelisted_mime_types,
10
14
  :message => :incorrect_format
11
15
 
12
16
  # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
@@ -15,6 +15,9 @@ Refinery::Images.configure do |config|
15
15
  # Configure image sizes
16
16
  # config.user_image_sizes = <%= Refinery::Images.user_image_sizes.inspect %>
17
17
 
18
+ # Configure white-listed mime types for validation
19
+ # config.whitelisted_mime_types = <%= Refinery::Images.whitelisted_mime_types.inspect %>
20
+
18
21
  # Configure image view options
19
22
  # config.image_views = <%= Refinery::Images.image_views.inspect %>
20
23
 
@@ -7,7 +7,8 @@ module Refinery
7
7
  :pages_per_dialog_that_have_size_options, :user_image_sizes,
8
8
  :image_views, :preferred_image_view, :datastore_root_path,
9
9
  :s3_backend, :s3_bucket_name, :s3_region,
10
- :s3_access_key_id, :s3_secret_access_key, :trust_file_extensions
10
+ :s3_access_key_id, :s3_secret_access_key, :trust_file_extensions,
11
+ :whitelisted_mime_types
11
12
 
12
13
  self.dragonfly_insert_before = 'ActionDispatch::Callbacks'
13
14
  self.dragonfly_secret = Refinery::Core.dragonfly_secret
@@ -24,6 +25,9 @@ module Refinery
24
25
  :medium => '225x255>',
25
26
  :large => '450x450>'
26
27
  }
28
+
29
+ self.whitelisted_mime_types = %w[image/jpeg image/png image/gif image/tiff]
30
+
27
31
  self.image_views = [:grid, :list]
28
32
  self.preferred_image_view = :grid
29
33
 
@@ -9,7 +9,7 @@ module Refinery
9
9
  app_images = ::Dragonfly[:refinery_images]
10
10
  app_images.configure_with(:imagemagick)
11
11
 
12
- app_images.define_macro(::Refinery::Core::BaseModel, :image_accessor)
12
+ app_images.define_macro(::Refinery::Image, :image_accessor)
13
13
 
14
14
  app_images.analyser.register(::Dragonfly::ImageMagick::Analyser)
15
15
  app_images.analyser.register(::Dragonfly::Analysis::FileCommandAnalyser)
@@ -8,10 +8,6 @@ module Refinery
8
8
 
9
9
  config.autoload_paths += %W( #{config.root}/lib )
10
10
 
11
- initializer 'setup-refinery-images-with-dragonfly', :before => :load_config_initializers do
12
- ::Refinery::Images::Dragonfly.setup!
13
- end
14
-
15
11
  initializer 'attach-refinery-images-with-dragonfly', :after => :load_config_initializers do |app|
16
12
  ::Refinery::Images::Dragonfly.configure!
17
13
  ::Refinery::Images::Dragonfly.attach!(app)
metadata CHANGED
@@ -1,82 +1,73 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-images
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.3
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 2
10
- version: 2.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Philip Arndt
14
- - "U\xC4\xA3is Ozols"
9
+ - Uģis Ozols
15
10
  - David Jones
16
11
  - Steven Heidel
17
12
  autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
-
21
- date: 2012-03-15 00:00:00 Z
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
15
+ date: 2012-04-02 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: dragonfly
19
+ requirement: !ruby/object:Gem::Requirement
26
20
  none: false
27
- requirements:
21
+ requirements:
28
22
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 43
31
- segments:
32
- - 0
33
- - 9
34
- - 8
23
+ - !ruby/object:Gem::Version
35
24
  version: 0.9.8
36
- version_requirements: *id001
37
- name: dragonfly
38
25
  type: :runtime
39
- - !ruby/object:Gem::Dependency
40
26
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ version_requirements: !ruby/object:Gem::Requirement
42
28
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 13
47
- segments:
48
- - 0
49
- - 5
50
- - 3
51
- version: 0.5.3
52
- version_requirements: *id002
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.9.8
33
+ - !ruby/object:Gem::Dependency
53
34
  name: rack-cache
35
+ requirement: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.3
54
41
  type: :runtime
55
- - !ruby/object:Gem::Dependency
56
42
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
43
+ version_requirements: !ruby/object:Gem::Requirement
58
44
  none: false
59
- requirements:
60
- - - "="
61
- - !ruby/object:Gem::Version
62
- hash: 11
63
- segments:
64
- - 2
65
- - 0
66
- - 2
67
- version: 2.0.2
68
- version_requirements: *id003
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: 0.5.3
49
+ - !ruby/object:Gem::Dependency
69
50
  name: refinerycms-core
51
+ requirement: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - '='
55
+ - !ruby/object:Gem::Version
56
+ version: 2.0.3
70
57
  type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - '='
63
+ - !ruby/object:Gem::Version
64
+ version: 2.0.3
71
65
  description: Handles all image upload and processing functionality in Refinery CMS.
72
66
  email: info@refinerycms.com
73
67
  executables: []
74
-
75
68
  extensions: []
76
-
77
69
  extra_rdoc_files: []
78
-
79
- files:
70
+ files:
80
71
  - app/controllers/refinery/admin/images_controller.rb
81
72
  - app/helpers/refinery/admin/images_helper.rb
82
73
  - app/models/refinery/image.rb
@@ -139,39 +130,37 @@ files:
139
130
  - spec/models/refinery/image_spec.rb
140
131
  - spec/requests/refinery/admin/images_spec.rb
141
132
  homepage: http://refinerycms.com
142
- licenses:
133
+ licenses:
143
134
  - MIT
144
135
  post_install_message:
145
136
  rdoc_options: []
146
-
147
- require_paths:
137
+ require_paths:
148
138
  - lib
149
- required_ruby_version: !ruby/object:Gem::Requirement
139
+ required_ruby_version: !ruby/object:Gem::Requirement
150
140
  none: false
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- hash: 3
155
- segments:
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ segments:
156
146
  - 0
157
- version: "0"
158
- required_rubygems_version: !ruby/object:Gem::Requirement
147
+ hash: 2455254302820496676
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
149
  none: false
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- hash: 3
164
- segments:
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ segments:
165
155
  - 0
166
- version: "0"
156
+ hash: 2455254302820496676
167
157
  requirements: []
168
-
169
158
  rubyforge_project: refinerycms
170
- rubygems_version: 1.8.17
159
+ rubygems_version: 1.8.19
171
160
  signing_key:
172
161
  specification_version: 3
173
162
  summary: Images extension for Refinery CMS
174
- test_files:
163
+ test_files:
175
164
  - spec/factories/image.rb
176
165
  - spec/fixtures/beach.jpeg
177
166
  - spec/fixtures/fathead.png