Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Ruby 1.9 required for git next?
@ 2010-01-04 18:49 Mark Alexander
  2010-01-04 18:58 ` Mark Alexander
  2010-01-04 19:00 ` Rich Lane
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Alexander @ 2010-01-04 18:49 UTC (permalink / raw)
  To: sup-talk

I finally bit the bullet and converted to Xapian after a doing git
pull and switching to the next branch.  (I had the problems mentioned
earlier with the xapian-full gem not installing correctly even though
it compiled.) Anyway, I'm now getting these warnings:

./lib/sup/maildir.rb:210: warning: encoding options not supported in 1.8:

at this line:

      File.open(fn, 'rb:BINARY') { |f| yield f }

Am I supposed to be using Ruby 1.9 with next?
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-talk] Ruby 1.9 required for git next?
  2010-01-04 18:49 [sup-talk] Ruby 1.9 required for git next? Mark Alexander
@ 2010-01-04 18:58 ` Mark Alexander
  2010-01-04 19:00 ` Rich Lane
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Alexander @ 2010-01-04 18:58 UTC (permalink / raw)
  To: sup-talk

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Excerpts from Mark Alexander's message of Mon Jan 04 13:49:31 -0500 2010:
> ./lib/sup/maildir.rb:210: warning: encoding options not supported in 1.8:

The attached horrible hack fixes it for me.  There's probably
a better way, but I was desperate.

[-- Attachment #2: binary.patch --]
[-- Type: application/octet-stream, Size: 1201 bytes --]

diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
index 0852576..899625d 100644
--- a/lib/sup/maildir.rb
+++ b/lib/sup/maildir.rb
@@ -34,6 +34,12 @@ class Maildir < Source
     #is a worthwhile effort
     @mtimes = { 'cur' => Time.at(0), 'new' => Time.at(0) }.merge(mtimes || {})
     @dir_ids = { 'cur' => [], 'new' => [] }
+    if RUBY_VERSION < "1.9"
+      @bin = ''
+    else
+      @bin = ':BINARY'
+    end
+
   end
 
   def file_path; @dir end
@@ -59,7 +65,7 @@ class Maildir < Source
         File.stat(tmp_path)
       rescue Errno::ENOENT #this is what we want.
         begin
-          File.open(tmp_path, 'wb:BINARY') do |f|
+          File.open(tmp_path, "wb#{@bin}") do |f|
             yield f #provide a writable interface for the caller
             f.fsync
           end
@@ -207,7 +213,7 @@ private
   def with_file_for id
     fn = @ids_to_fns[id] or raise OutOfSyncSourceError, "No such id: #{id.inspect}."
     begin
-      File.open(fn, 'rb:BINARY') { |f| yield f }
+      File.open(fn, "rb#{@bin}") { |f| yield f }
     rescue SystemCallError, IOError => e
       raise FatalSourceError, "Problem reading file for id #{id.inspect}: #{fn.inspect}: #{e.message}."
     end

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-talk] Ruby 1.9 required for git next?
  2010-01-04 18:49 [sup-talk] Ruby 1.9 required for git next? Mark Alexander
  2010-01-04 18:58 ` Mark Alexander
@ 2010-01-04 19:00 ` Rich Lane
  2010-01-04 19:32   ` Ben Walton
  1 sibling, 1 reply; 6+ messages in thread
From: Rich Lane @ 2010-01-04 19:00 UTC (permalink / raw)
  To: Mark Alexander; +Cc: sup-talk

Excerpts from Mark Alexander's message of 2010-01-04 13:49:31 -0500:
> I finally bit the bullet and converted to Xapian after a doing git
> pull and switching to the next branch.  (I had the problems mentioned
> earlier with the xapian-full gem not installing correctly even though
> it compiled.) Anyway, I'm now getting these warnings:
> 
> ./lib/sup/maildir.rb:210: warning: encoding options not supported in 1.8:
> 
> at this line:
> 
>       File.open(fn, 'rb:BINARY') { |f| yield f }
> 
> Am I supposed to be using Ruby 1.9 with next?

Those warnings are harmless. If you want to run with -w I suggest
redirecting stderr to a file.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-talk] Ruby 1.9 required for git next?
  2010-01-04 19:00 ` Rich Lane
@ 2010-01-04 19:32   ` Ben Walton
  2010-01-04 19:47     ` Rich Lane
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Walton @ 2010-01-04 19:32 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 462 bytes --]

Excerpts from Rich Lane's message of Mon Jan 04 14:00:51 -0500 2010:

> Those warnings are harmless. If you want to run with -w I suggest
> redirecting stderr to a file.

Not on 1.8.5.  It was dying with an exception until I removed all
instances of :BINARY.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-talk] Ruby 1.9 required for git next?
  2010-01-04 19:32   ` Ben Walton
@ 2010-01-04 19:47     ` Rich Lane
  2010-01-04 20:02       ` Ben Walton
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Lane @ 2010-01-04 19:47 UTC (permalink / raw)
  To: Ben Walton; +Cc: sup-talk

Excerpts from Ben Walton's message of 2010-01-04 14:32:09 -0500:
> Excerpts from Rich Lane's message of Mon Jan 04 14:00:51 -0500 2010:
> 
> > Those warnings are harmless. If you want to run with -w I suggest
> > redirecting stderr to a file.
> 
> Not on 1.8.5.  It was dying with an exception until I removed all
> instances of :BINARY.

Ok, I just sent in a patch that should fix this.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-talk] Ruby 1.9 required for git next?
  2010-01-04 19:47     ` Rich Lane
@ 2010-01-04 20:02       ` Ben Walton
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Walton @ 2010-01-04 20:02 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 379 bytes --]

Excerpts from Rich Lane's message of Mon Jan 04 14:47:12 -0500 2010:

> Ok, I just sent in a patch that should fix this.

I saw that.  It looks sound to my eyes.  +1 for this.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-04 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-04 18:49 [sup-talk] Ruby 1.9 required for git next? Mark Alexander
2010-01-04 18:58 ` Mark Alexander
2010-01-04 19:00 ` Rich Lane
2010-01-04 19:32   ` Ben Walton
2010-01-04 19:47     ` Rich Lane
2010-01-04 20:02       ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox