fclay 0.1.35 → 0.1.36
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 +4 -4
- data/lib/fclay/attachment.rb +10 -6
- data/lib/fclay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57729275c262e15813840370c7462a452641bbac
|
4
|
+
data.tar.gz: b8f567bfd5704815ef95af1dd2ad58e7640da865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9db12763ad77f2a1d98a0ac7ac835e6121f996f2d58f0e6da6c71f0878bffc1ff1317c25a6298e6c8dabd08b3facc025d4e6e0240cb7a5539d2937bb5d404cae
|
7
|
+
data.tar.gz: a02585d27ba42d4bbfd04e4e8db6d7ecb6475a41b82750e1f9cac428e6065500a81e4f7128f9ec76260051fae42367370adc1047edbf2efe2f0b084700ad9b50
|
data/lib/fclay/attachment.rb
CHANGED
@@ -154,14 +154,18 @@ module Fclay
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def process_file
|
157
|
-
|
157
|
+
self.log("process_file called")
|
158
|
+
self.log("@file: #{@file.try(:to_s)}")
|
158
159
|
return unless @file
|
159
|
-
|
160
|
+
|
160
161
|
delete_files
|
161
|
-
|
162
|
-
|
162
|
+
path = @file.try(:path) || @file.try(:[],:path)
|
163
|
+
|
164
|
+
self.log("fetched path: #{path.try(:to_s)}")
|
163
165
|
return unless path
|
164
166
|
|
167
|
+
self.content_type = @file.try(:content_type) || @file.try(:[],:content_type)
|
168
|
+
|
165
169
|
if path[0..3] == "http"
|
166
170
|
self.file_status = 'idle'
|
167
171
|
self.file_location = 'external_link'
|
@@ -172,14 +176,14 @@ module Fclay
|
|
172
176
|
|
173
177
|
(self.class.fclay_options[:styles] || [nil]).each do |style|
|
174
178
|
FileUtils.cp(path,local_file_path(style))
|
175
|
-
`chmod
|
179
|
+
`chmod 777 #{local_file_path(style)}`
|
176
180
|
end
|
177
181
|
|
178
|
-
|
179
182
|
delete_tmp_file
|
180
183
|
set_file_size self.class.fclay_options[:styles].try(:first)
|
181
184
|
self.file_location = 'local'
|
182
185
|
self.file_status = need_upload ? "processing" : "idle"
|
186
|
+
self.log("file_processed, file_status: #{self.file_status}")
|
183
187
|
end
|
184
188
|
end
|
185
189
|
|
data/lib/fclay/version.rb
CHANGED