attachment_magick 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- attachment_magick (0.2.3)
4
+ attachment_magick (0.2.5)
5
5
  dragonfly (>= 0.9.4)
6
6
  jquery-rails (>= 0.2.7)
7
7
  marcosinger-auto_html (>= 1.3.4)
data/README.rdoc CHANGED
@@ -27,7 +27,8 @@ Create a initializer like this (config/initializers/attachment_magick_setup.rb)
27
27
  config.columns_amount = 16
28
28
  config.columns_width = 52
29
29
  config.gutter = 8
30
-
30
+ config.orms = ["ActiveRecord", "Mongoid"] # Mongoid is default
31
+
31
32
  config.custom_styles do
32
33
  publisher "52x"
33
34
  my_custom_style "50x50"
@@ -7,12 +7,14 @@ module AttachmentMagick
7
7
  attr_accessor :columns_width
8
8
  attr_accessor :gutter
9
9
  attr_accessor :default_add_partial
10
+ attr_accessor :orms
10
11
 
11
12
  def initialize
12
13
  @columns_amount = 19
13
14
  @columns_width = 54
14
15
  @gutter = 3
15
16
  @custom_styles = []
17
+ @orms = ["Mongoid"]
16
18
  @default_add_partial = "/attachment_magick/add_image"
17
19
  end
18
20
 
@@ -1,3 +1,3 @@
1
1
  module AttachmentMagick
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -18,10 +18,15 @@ module AttachmentMagick
18
18
 
19
19
  included do
20
20
  cattr_accessor :attachment_magick_default_options
21
-
22
- embeds_many :images, :class_name => "AttachmentMagick::MongoidImage", :polymorphic => true if self.include?(Mongoid::Document) if defined? Mongoid::Document
23
- has_many :images, :class_name => "AttachmentMagick::ActiveRecordImage", :as => :imageable, :dependent => :destroy if self.include?(ActiveRecord::Persistence) if defined? ActiveRecord::Persistence
24
-
21
+
22
+ if AttachmentMagick.configuration.orms.include?("Mongoid")
23
+ embeds_many :images, :class_name => "AttachmentMagick::MongoidImage", :polymorphic => true if self.include?(Mongoid::Document)
24
+ end
25
+
26
+ if AttachmentMagick.configuration.orms.include?("ActiveRecord")
27
+ has_many :images, :class_name => "AttachmentMagick::ActiveRecordImage", :as => :imageable, :dependent => :destroy if self.include?(ActiveRecord::Persistence)
28
+ end
29
+
25
30
  accepts_nested_attributes_for :images
26
31
  end
27
32
 
@@ -2,7 +2,8 @@ AttachmentMagick.setup do |config|
2
2
  config.columns_amount = 19
3
3
  config.columns_width = 54
4
4
  config.gutter = 3
5
-
5
+ config.orms = ["ActiveRecord", "Mongoid"]
6
+
6
7
  config.custom_styles do
7
8
  thumb "36x36"
8
9
  portrait "x700>"
metadata CHANGED
@@ -1,98 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: attachment_magick
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.6
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 5
10
- version: 0.2.5
11
6
  platform: ruby
12
- authors:
13
- - "Marco Ant\xC3\xB4nio Singer"
7
+ authors:
8
+ - Marco Antônio Singer
14
9
  - Carlos Brando
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-08-05 00:00:00 -03:00
13
+ date: 2011-08-29 00:00:00.000000000 -03:00
20
14
  default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: dragonfly
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: &2153526700 !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 51
31
- segments:
32
- - 0
33
- - 9
34
- - 4
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
35
23
  version: 0.9.4
36
24
  type: :runtime
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: rack-cache
40
25
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: *2153526700
27
+ - !ruby/object:Gem::Dependency
28
+ name: rack-cache
29
+ requirement: &2153526200 !ruby/object:Gem::Requirement
42
30
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 15
47
- segments:
48
- - 1
49
- - 0
50
- version: "1.0"
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '1.0'
51
35
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: jquery-rails
55
36
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
37
+ version_requirements: *2153526200
38
+ - !ruby/object:Gem::Dependency
39
+ name: jquery-rails
40
+ requirement: &2153525740 !ruby/object:Gem::Requirement
57
41
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 25
62
- segments:
63
- - 0
64
- - 2
65
- - 7
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
66
45
  version: 0.2.7
67
46
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: marcosinger-auto_html
71
47
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
48
+ version_requirements: *2153525740
49
+ - !ruby/object:Gem::Dependency
50
+ name: marcosinger-auto_html
51
+ requirement: &2153525280 !ruby/object:Gem::Requirement
73
52
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 19
78
- segments:
79
- - 1
80
- - 3
81
- - 4
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
82
56
  version: 1.3.4
83
57
  type: :runtime
84
- version_requirements: *id004
58
+ prerelease: false
59
+ version_requirements: *2153525280
85
60
  description:
86
- email:
61
+ email:
87
62
  - markaum@gmail.com
88
63
  - eduardobrando@gmail.com
89
64
  executables: []
90
-
91
65
  extensions: []
92
-
93
66
  extra_rdoc_files: []
94
-
95
- files:
67
+ files:
96
68
  - .gitignore
97
69
  - Gemfile
98
70
  - Gemfile.lock
@@ -201,38 +173,29 @@ files:
201
173
  has_rdoc: true
202
174
  homepage: http://github.com/marcosinger/attachment_magick
203
175
  licenses: []
204
-
205
176
  post_install_message:
206
177
  rdoc_options: []
207
-
208
- require_paths:
178
+ require_paths:
209
179
  - lib
210
- required_ruby_version: !ruby/object:Gem::Requirement
180
+ required_ruby_version: !ruby/object:Gem::Requirement
211
181
  none: false
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- hash: 3
216
- segments:
217
- - 0
218
- version: "0"
219
- required_rubygems_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ! '>='
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ required_rubygems_version: !ruby/object:Gem::Requirement
220
187
  none: false
221
- requirements:
222
- - - ">="
223
- - !ruby/object:Gem::Version
224
- hash: 3
225
- segments:
226
- - 0
227
- version: "0"
188
+ requirements:
189
+ - - ! '>='
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
228
192
  requirements: []
229
-
230
193
  rubyforge_project: attachment_magick
231
194
  rubygems_version: 1.6.2
232
195
  signing_key:
233
196
  specification_version: 3
234
197
  summary: little more magick when you upload image files (with SwfUpload and Dragonfly)
235
- test_files:
198
+ test_files:
236
199
  - test/attachment_magick/controllers/images_controller_test.rb
237
200
  - test/attachment_magick/generators/install_generator_test.rb
238
201
  - test/attachment_magick/generators/migration_generator_test.rb