Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileWrapper.fullpath fails on Windows #60

Open
raghurajah opened this issue Feb 18, 2012 · 6 comments
Open

FileWrapper.fullpath fails on Windows #60

raghurajah opened this issue Feb 18, 2012 · 6 comments

Comments

@raghurajah
Copy link

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
@bloemendal
Copy link

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

@dudleyf
Copy link
Contributor

dudleyf commented Mar 8, 2012

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 ;)

@raghurajah
Copy link
Author

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:
#60 (comment)

dudleyf added a commit to dudleyf/rake-pipeline that referenced this issue Mar 8, 2012
@dudleyf dudleyf closed this as completed in 7c525b4 Mar 9, 2012
@thekevinbrown
Copy link

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?

@dudleyf dudleyf reopened this Mar 13, 2012
@dudleyf
Copy link
Contributor

dudleyf commented Mar 13, 2012

@blargity Sure, that would be great, thanks.

@bobspryn
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants