francois / mephisto forked from halorgium/mephisto

A refactored Mephisto that has multiple spam detection engines.

This URL has Read+Write access

francois (author)
Mon Mar 17 19:02:47 -0700 2008
commit  cf11753a6d59fbbfcbd0e063706395ff31600059
tree    99cad4a4e7cbdd79c3c9781008d0ee9d0cbc4451
parent  f1068ff008b7da9263fd9037d1a37b3813e70991
mephisto / app / models / attachments.rb
100644 13 lines (12 sloc) 0.304 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
class Attachments < Array
  attr_accessor :theme
 
  def write(relative_path, data = nil)
    full_path = self[relative_path]
    unless data.nil?
      path, filename = full_path.split
      FileUtils.mkdir_p path.to_s
      File.open(full_path, 'wb') { |f| f.write data }
    end
    full_path
  end
end