Module: HasModerated::CarrierWave
- Defined in:
- lib/has_moderated/carrier_wave.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
6
7
8
9
10
11
|
# File 'lib/has_moderated/carrier_wave.rb', line 6
def self.included(base)
require File.expand_path('../carrier_wave_patches', __FILE__)
base.send :extend, ClassMethods
end
|
.photo_tmp_delete(value) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/has_moderated/carrier_wave.rb', line 13
def self.photo_tmp_delete(value)
begin
dirname = File.expand_path("..", value)
filename = File.basename(value)
r = Regexp.new("#{filename}\\Z")
Dir.foreach(dirname) do |f|
if f =~ r
FileUtils.rm("#{dirname}/#{f}") end
end
FileUtils.rmdir(File.expand_path("..", value)) rescue
end
end
|