[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Mixins conflict? FileUtils and mini_exiftool

12 34

7/6/2007 5:52:00 PM

Not sure if Mixins is the right word. But I have

require 'rubygems' # # Needed by rbosa, mini_exiftool, appscript, --at
least in my installation
require 'FileUtils'
require 'mini_exiftool' # a wrapper for the Perl ExifTool
# I have a couple of others in my script, but these two are the ones
conflicting

FileUtils and mini_exiftool are apparently both trying to use the same
contant. Here's the error I get using TextMate:

/usr/local/lib/ruby/1.8/fileutils.rb:93: warning: already initialized
constant OPT_TABLE
/usr/local/lib/ruby/1.8/fileutils.rb:1163: warning: already initialized
constant S_IF_DOOR
/usr/local/lib/ruby/1.8/fileutils.rb:1513: warning: already initialized
constant METHODS

Script runs and is doing what I want AFAIK, but there may be some glitch
that I haven't detected yet.

Thanks

--
Posted via http://www.ruby-....

2 Answers

Alex Young

7/6/2007 5:56:00 PM

0

12 34 wrote:
> Not sure if Mixins is the right word. But I have
>
> require 'rubygems' # # Needed by rbosa, mini_exiftool, appscript, --at
> least in my installation
> require 'FileUtils'
> require 'mini_exiftool' # a wrapper for the Perl ExifTool
> # I have a couple of others in my script, but these two are the ones
> conflicting
>
> FileUtils and mini_exiftool are apparently both trying to use the same
> contant. Here's the error I get using TextMate:
>
> /usr/local/lib/ruby/1.8/fileutils.rb:93: warning: already initialized
> constant OPT_TABLE
> /usr/local/lib/ruby/1.8/fileutils.rb:1163: warning: already initialized
> constant S_IF_DOOR
> /usr/local/lib/ruby/1.8/fileutils.rb:1513: warning: already initialized
> constant METHODS
>
> Script runs and is doing what I want AFAIK, but there may be some glitch
> that I haven't detected yet.
Your fileutils require is "require 'FileUtils'", while mini_exiftools
probably requires is as "require 'fileutils'". Because of the case
difference, require thinks it hasn't seen fileutils before when
mini_exiftool require's it, and tries to load it again. At least,
that's my guess. Try changing your "require 'FileUtils'" to "require
'fileutils'" and see if the warnings go away.

--
Alex

12 34

7/7/2007 12:08:00 AM

0

Alex Young wrote:
> 12 34 wrote:
>> contant. Here's the error I get using TextMate:
>>
>>
> Your fileutils require is "require 'FileUtils'", while mini_exiftools
> probably requires is as "require 'fileutils'". Because of the case
> difference, require thinks it hasn't seen fileutils before when
> mini_exiftool require's it, and tries to load it again. At least,
> that's my guess. Try changing your "require 'FileUtils'" to "require
> 'fileutils'" and see if the warnings go away.
Good guess. Thanks.

--
Posted via http://www.ruby-....