Sha256: 9976dcb9755bccfd63315f697207b3cd962466b4245e398ca6b5699168332a8d

Contents?: true

Size: 1 KB

Versions: 12

Compression:

Stored size: 1 KB

Contents

class Property::Dspam< Property

  def self.service; DSPAM ;end

  default_scope where(:service => self.service)


  def self.on_off_pref_template(a, locals)
    a.edit :file => "#{etc_dspam}/dspam.conf" do
      locals.each do |key, value|
        value = value == true or value == 'on' ? 'on' : 'off'
        delete /^Preference\s+"#{key}/
        append "Preference\t\t\"#{key}=#{value}\""
      end
    end
  end

  def self.preference_template(a, locals)
    a.edit :file => "#{etc_dspam}/dspam.conf" do
      locals.each do |key, value|
        delete /^Preference\s+"#{key}/
        append "Preference\t\t\"#{key}=#{value}\""
      end
    end
  end

  def self.enum_template(a, locals)
    a.edit :file => "#{etc_dspam}/dspam.conf" do
      locals.each do |key, value|
        value = value.split(';').select {|s| sfirst=='+' }. first[1..-1]
        delete /^Preference\s+"#{key}/
        append "Preference\t\t\"#{key}=#{value}\""
      end
    end
  end


protected

  def self.etc_dspam
    '/etc/dspam'
  end


end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rmails-0.2.5 app/models/property/dspam.rb
rmails-0.2.4 app/models/property/dspam.rb
rmails-0.2.3 app/models/property/dspam.rb
rmails-0.2.2 app/models/property/dspam.rb
rmails-0.2.1 app/models/property/dspam.rb
rmails-0.2.0 app/models/property/dspam.rb
rmails-0.1.6 app/models/property/dspam.rb
rmails-0.1.5 app/models/property/dspam.rb
rmails-0.1.4 app/models/property/dspam.rb
rmails-0.1.3 app/models/property/dspam.rb
rmails-0.1.2 app/models/property/dspam.rb
rmails-0.1.1 app/models/property/dspam.rb