Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cosmetic changes:

Removed the parens around method parameters, and cleaned up trailing
whitespace.
  • Loading branch information...
commit c080c4c668fc354b3378929b1d04a589eafb8efd 1 parent 271bd6c
Dave Brown authored May 06, 2008 Dave Brown committed May 06, 2008
8  gurgitate/deliver/maildir.RB
@@ -15,7 +15,7 @@ module Gurgitate
15 15
             #   message to.  If it is of the form "=mailbox", it saves
16 16
             #   the message to +Maildir+/+mailbox+.  Otherwise, it
17 17
             #   simply saves the message to the file +mailbox+.
18  
-            def self::check_mailbox(mailbox)
  18
+            def self::check_mailbox mailbox
19 19
                 begin
20 20
                     if File.stat(mailbox).directory? then
21 21
                         if File.stat(File.join(mailbox,"cur")).directory? then
@@ -33,7 +33,7 @@ module Gurgitate
33 33
             #   One of "+mailbox+/tmp" or "+mailbox+/new", but that's
34 34
             #   only because that's what the maildir spec
35 35
             #   (http://cr.yp.to/proto/maildir.html) says.
36  
-            def maildir_getfilename(dir)
  36
+            def maildir_getfilename dir
37 37
                 time=Time.now.to_f
38 38
                 counter=0
39 39
                 hostname=Socket::gethostname
@@ -50,7 +50,7 @@ module Gurgitate
50 50
             # Creates a new Maildir folder +mailbox+
51 51
             # mailbox::
52 52
             #   The full path of the new folder to be created
53  
-            def make_mailbox(mailbox)
  53
+            def make_mailbox mailbox
54 54
                 Dir.mkdir(mailbox)
55 55
                 %w{cur tmp new}.each do |dir|
56 56
                     Dir.mkdir(File.join(mailbox,dir))
@@ -63,7 +63,7 @@ module Gurgitate
63 63
             #   message to.  If it is of the form "=mailbox", it saves
64 64
             #   the message to +Maildir+/+mailbox+.  Otherwise, it
65 65
             #   simply saves the message to the file +mailbox+.
66  
-            def deliver_message(mailbox)
  66
+            def deliver_message mailbox
67 67
                 begin
68 68
                     File.stat(mailbox)
69 69
                 rescue Errno::ENOENT
10  gurgitate/deliver/mbox.RB
@@ -13,10 +13,10 @@ module Gurgitate
13 13
             #   the message to.  If it is of the form "=mailbox", it
14 14
             #   saves the message to +Maildir+/+mailbox+.  Otherwise,
15 15
             #   it simply saves the message to the file +mailbox+.
16  
-            def self::check_mailbox(mailbox)
  16
+            def self::check_mailbox mailbox
17 17
 
18 18
                 begin
19  
-                    if File.stat(mailbox).file? then 
  19
+                    if File.stat(mailbox).file? then
20 20
                         return MBox
21 21
                     else
22 22
                         return nil
@@ -32,9 +32,9 @@ module Gurgitate
32 32
             #   the message to.  If it is of the form "=mailbox", it
33 33
             #   saves the message to +Maildir+/+mailbox+.  Otherwise,
34 34
             #   it simply saves the message to the file +mailbox+.
35  
-            def deliver_message(mailbox) 
36  
-                File.open(mailbox,File::WRONLY | 
37  
-                                  File::APPEND | 
  35
+            def deliver_message mailbox
  36
+                File.open(mailbox,File::WRONLY |
  37
+                                  File::APPEND |
38 38
                                   File::CREAT) do |f|
39 39
                     f.flock(File::LOCK_EX)
40 40
                     message=(if f.stat.size > 0 then "\n" else "" end) + to_mbox
30  gurgitate/deliver/mh.RB
@@ -15,7 +15,7 @@ module Gurgitate
15 15
             #   the message to.  If it is of the form "=mailbox", it
16 16
             #   saves the message to +Maildir+/+mailbox+.  Otherwise,
17 17
             #   it simply saves the message to the file +mailbox+.
18  
-            def self::check_mailbox(mailbox)
  18
+            def self::check_mailbox mailbox
19 19
                 begin
20 20
                     # Rather annoyingly, pretty well any directory can
21 21
                     # be a MH mailbox, but this just checks to make sure
@@ -24,10 +24,10 @@ module Gurgitate
24 24
                     # I could put in a check for the path given in
25 25
                     # $HOME/.mh_profile, but Claws-Mail uses MH mailboxes and
26 26
                     # disregards $HOME/.mh_profile.
27  
-                    if File.stat(mailbox).directory? and 
28  
-                        not ( File.exists?(File.join(mailbox, "cur")) or 
29  
-                              File.exists?(File.join(mailbox, "tmp")) or 
30  
-                              File.exists?(File.join(mailbox, "new"))) then 
  27
+                    if File.stat(mailbox).directory? and
  28
+                        not ( File.exists?(File.join(mailbox, "cur")) or
  29
+                              File.exists?(File.join(mailbox, "tmp")) or
  30
+                              File.exists?(File.join(mailbox, "new"))) then
31 31
                         return MH
32 32
                     end
33 33
                 rescue Errno::ENOENT
@@ -41,7 +41,7 @@ module Gurgitate
41 41
             #   the message to.  If it is of the form "=mailbox", it
42 42
             #   saves the message to +Maildir+/+mailbox+.  Otherwise,
43 43
             #   it simply saves the message to the file +mailbox+.
44  
-            def deliver_message(mailbox) 
  44
+            def deliver_message mailbox
45 45
                 if ! File.exists? mailbox then
46 46
                     Dir.mkdir(mailbox)
47 47
                 end
@@ -59,16 +59,16 @@ module Gurgitate
59 59
 
60 60
             private
61 61
 
62  
-            def update_sequences(mailbox, msgnum)
  62
+            def update_sequences mailbox, msgnum
63 63
                 sequences = File.join(mailbox, ".mh_sequences")
64 64
                 lockfile = sequences + ".lock" # how quaint
65 65
                 loop do
66 66
                     begin
67  
-                        File.open(lockfile, 
68  
-                                  File::WRONLY | 
69  
-                                  File::CREAT | 
  67
+                        File.open(lockfile,
  68
+                                  File::WRONLY |
  69
+                                  File::CREAT |
70 70
                                   File::EXCL ) do |lock|
71  
-                            File.open(sequences, 
  71
+                            File.open(sequences,
72 72
                                       File::RDWR | File::CREAT) do |seq|
73 73
 
74 74
                                 seq.flock(File::LOCK_EX)
@@ -91,7 +91,7 @@ module Gurgitate
91 91
                     rescue Errno::EEXIST
92 92
                         # some other process is doing something, so wait a few
93 93
                         # milliseconds until it's done
94  
-                        sleep(0.01) 
  94
+                        sleep(0.01)
95 95
                     end
96 96
                 end
97 97
             end
@@ -115,13 +115,13 @@ module Gurgitate
115 115
                 end
116 116
             end
117 117
 
118  
-            def next_message(mailbox)
  118
+            def next_message mailbox
119 119
                 next_msgnum = Dir.open(mailbox).map { |ent| ent.to_i }.max + 1
120 120
                 loop do
121 121
                     begin
122 122
                         File.open(File.join(mailbox, next_msgnum.to_s),
123  
-                                  File::WRONLY | 
124  
-                                  File::CREAT | 
  123
+                                  File::WRONLY |
  124
+                                  File::CREAT |
125 125
                                   File::EXCL ) do |filehandle|
126 126
                             yield filehandle
127 127
                         end

0 notes on commit c080c4c

Please sign in to comment.
Something went wrong with that request. Please try again.