Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dagbrown committed Jun 7, 2006
1 parent 6f0e207 commit 33f7cfc
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions gurgitate-mail.RB
Expand Up @@ -16,7 +16,6 @@ module Gurgitate
class Gurgitate < Mailmessage
include Deliver

<<<<<<< gurgitate-mail.RB
# Instead of the usual attributes, I went with a
# reader-is-writer type thing (as seen quite often in Perl and
# C++ code) so that in your .gurgitate-rules, you can say
Expand All @@ -41,7 +40,6 @@ module Gurgitate
def #{sym} (*vals)
if vals.length == 1
@#{sym} = vals[0]
log "Config param #{sym} set to \#{vals[0]}"
elsif vals.length == 0
@#{sym}
else
Expand All @@ -59,49 +57,6 @@ module Gurgitate
end
end

=======
# Instead of the usual attributes, I went with a
# reader-is-writer type thing (as seen quite often in Perl and
# C++ code) so that in your .gurgitate-rules, you can say
#
# maildir "#{homedir}/Mail"
# sendmail "/usr/sbin/sendmail"
# spoolfile "Maildir"
# spooldir homedir
#
# This is because of an oddity in Ruby where, even if an
# accessor exists in the current object, if you say:
# name = value
# it'll always create a local variable. Not quite what you
# want when you're trying to set a config parameter. You have
# to say "self.name = value", which (I think) is ugly.
#
# In the interests of promoting harmony, of course, the previous
# syntax will continue to work.
def self.attr_configparam(*syms)
syms.each do |sym|
class_eval %{
def #{sym} (*vals)
if vals.length == 1
@#{sym} = vals[0]
elsif vals.length == 0
@#{sym}
else
raise ArgumentError,
"wrong number of arguments " +
"(\#{vals.length} for 0 or 1)"
end
end
# Don't break it for the nice people who use
# old-style accessors though. Breaking people's
# .gurgitate-rules is a bad idea.
attr_writer :#{sym}
}
end
end

>>>>>>> 1.28.4.5
# The directory you want to put mail folders into
attr_configparam :maildir

Expand Down

0 comments on commit 33f7cfc

Please sign in to comment.