uploadbox 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 637d6b0f57de21816a043ba94ee4e95261447acf
4
- data.tar.gz: af78732210e3644d7e3814c18afbcb258ecf89f9
3
+ metadata.gz: a228230591c42ba12a0d67a19d78687d517b0999
4
+ data.tar.gz: 20665764002ee49e024075d09019cb929927453c
5
5
  SHA512:
6
- metadata.gz: 7f61d7328f6e8693a6969fb4440b5031527f3f205c8dcb60f726d789ddddc94980e8f5d1ea71df477f4f3bd8e7db885ba68607a241f51c2f71945b0203de9291
7
- data.tar.gz: 8ca89bc71b260627903c25a9aec839b03ff6b83e241b4aa42e56af4da61d8c7917f744b370a187c73e7bf8c082258962e0ce1cb798cfa84fcbd9ad6b1b896857
6
+ metadata.gz: 94e8e924cc31221601c5138249e18ff68fa3234d1dd0a914fc3c65fc519d1ab0dcf78e2bb9d19e50069770140d8a2fe7267ae42ba9cc28552bd025f256584204
7
+ data.tar.gz: 339752d9959bf1b1b741b812ad08c9344f8d52e88a4d568ece70019d14629bda5666bab491e5eec21eacab3fb130994a5b5fe50f0fa12137a63e91a4b6933265
@@ -7,9 +7,10 @@ class @Manager
7
7
 
8
8
  for className in classNames
9
9
  try
10
- instance = new (eval(className))(container)
11
10
  instanceName = Manager.getInstanceName(className)
12
- container.data(instanceName, instance)
11
+ unless container.data(instanceName)
12
+ instance = new (eval(className))(container)
13
+ container.data(instanceName, instance)
13
14
  catch error
14
15
  try
15
16
  console.warn "#{className} component not found"
@@ -15,7 +15,10 @@ module Uploadbox
15
15
  imageable_type = self.to_s
16
16
  upload_class_name = imageable_type + upload_name.to_s.camelize
17
17
  upload_class = Class.new(Image)
18
- Uploadbox.const_set(upload_class_name, upload_class)
18
+
19
+ unless Uploadbox.const_defined?(upload_class_name)
20
+ Uploadbox.const_set(upload_class_name, upload_class)
21
+ end
19
22
 
20
23
  # @post.picture?
21
24
  define_method("#{upload_name}?") do
@@ -83,7 +86,9 @@ module Uploadbox
83
86
 
84
87
  # Uploabox::PostPictureUploader < UploadBox::ImgProcessing < CarrierWave
85
88
  dynamic_uploader = Class.new(Uploadbox::ImageProcessingUploader)
86
- Uploadbox.const_set(self.name.demodulize + 'Uploader', dynamic_uploader)
89
+ unless Uplaodbox.const_defined?(self.name.demodulize + 'Uploader')
90
+ Uploadbox.const_set(self.name.demodulize + 'Uploader', dynamic_uploader)
91
+ end
87
92
  dynamic_uploader.class_eval do
88
93
  upload_versions.each do |version_name, dimensions|
89
94
  if options[:retina]
@@ -134,7 +139,10 @@ module Uploadbox
134
139
  imageable_type = self.to_s
135
140
  upload_class_name = imageable_type + upload_name.to_s.camelize
136
141
  upload_class = Class.new(Image)
137
- Uploadbox.const_set(upload_class_name, upload_class)
142
+
143
+ unless Uploadbox.const_defined?(upload_class_name)
144
+ Uploadbox.const_set(upload_class_name, upload_class)
145
+ end
138
146
 
139
147
  # @post.images?
140
148
  define_method("#{upload_name}?") do
@@ -171,7 +179,9 @@ module Uploadbox
171
179
 
172
180
  # Uploabox::PostPictureUploader < UploadBox::ImgProcessing < CarrierWave
173
181
  dynamic_uploader = Class.new(Uploadbox::ImageProcessingUploader)
174
- Uploadbox.const_set(self.name.demodulize + 'Uploader', dynamic_uploader)
182
+ Uploadbox.const_defined?(self.name.demodulize + 'Uploader')
183
+ Uploadbox.const_set(self.name.demodulize + 'Uploader', dynamic_uploader)
184
+ end
175
185
  dynamic_uploader.class_eval do
176
186
  upload_versions.each do |version_name, dimensions|
177
187
  if options[:retina]
@@ -1,3 +1,3 @@
1
1
  module Uploadbox
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julio Protzek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-28 00:00:00.000000000 Z
12
+ date: 2013-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails