rake-pipeline icon indicating copy to clipboard operation
rake-pipeline copied to clipboard

FileWrapper.fullpath fails on Windows

Open raghurajah opened this issue 13 years ago • 6 comments

FileWrapper.fullpath expects root to start with a '/'. In windows this fails because root path starts with a 'drive-letter:'

      def fullpath
        raise "#{root}, #{path}" unless root =~ /^\//
        File.join(root, path)
      end

raghurajah avatar Feb 18 '12 15:02 raghurajah

Have you tried forking and removing that line? :) Because I did remove the screw-all-windows-devs line and it worked for me.

bloemendal avatar Feb 21 '12 16:02 bloemendal

For those of us who are Windows-challenged, what's the correct fix? Something like:

      def fullpath
        raise "#{root}, #{path}" unless root =~ /^(\/|[a-zA-Z]:\\)/
        File.join(root, path)
      end

? We're really not trying to screw all Windows devs on purpose ;)

dudleyf avatar Mar 08 '12 19:03 dudleyf

I think that would work. Thanks Dudley.

On Mar 8, 2012, at 2:56 PM, Dudley [email protected] wrote:

For those of us who are Windows-challenged, what's the correct fix? Something like:

     def fullpath
       raise "#{root}, #{path}" unless root =~ /^(\/|[a-zA-Z]:\\)/
       File.join(root, path)
     end

? We're really not trying to screw all Windows devs on purpose ;)


Reply to this email directly or view it on GitHub: https://github.com/livingsocial/rake-pipeline/issues/60#issuecomment-4400881

raghurajah avatar Mar 08 '12 21:03 raghurajah

I was getting this issue on Windows, and when I went into the file_wrapper.rb file, the above fix was present in my installed version of file_wrapper.rb:

raise "#{root}, #{path}" unless root =~ /^(\/|[a-zA-Z]:\\)/

But I was still getting an error, as fullpath at that time is not defined in Ruby as, for example, C:, but instead as c:/. I did the following to the line and am now able to build:

raise "#{root}, #{path}" unless root =~ /^(\/|[a-zA-Z]:\/)/

Note the use of a forward slash instead of a back slash on the end of the windows portion of the regex.

Would you like me to issue a pull request?

thekevinbrown avatar Mar 13 '12 07:03 thekevinbrown

@blargity Sure, that would be great, thanks.

dudleyf avatar Mar 13 '12 13:03 dudleyf

+1 (Sorry for the plus one, but it lets me know when this is fixed)

bobspryn avatar Mar 13 '12 22:03 bobspryn