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

On Windows, the 'dot' (or other progs) command fails #4

Closed
test-org-rename opened this issue Dec 9, 2009 · 2 comments
Closed

On Windows, the 'dot' (or other progs) command fails #4

test-org-rename opened this issue Dec 9, 2009 · 2 comments

Comments

@test-org-rename
Copy link

This is due to a limitation where when run via backquote or execute strings a command should have its complete name with extension. so running dot -Tpng will fail on windows. Instead dot.exe -Tpng will work.

Here is a patched find_executable() method that should work on *NIX and Windows (grab it here also: http://gist.github.com/252527 )

def find_executable(bin = @prog, *paths) #:nodoc:
  paths = ENV['PATH'].split(File::PATH_SEPARATOR) if paths.empty?
  paths.each do |path|
    file = File.join(path,bin)
    if File.executable?(file) then
      return file
    elsif RUBY_PLATFORM =~ /mswin|mingw/
      found_ext = (ENV['PATHEXT'] || '.exe;.bat;.com').split(";").find {|ext| File.executable?(file + ext) }
      return file + found_ext if found_ext
    end
  end
  return nil
end
@glejeune
Copy link
Owner

Ok, just commited

@test-org-rename
Copy link
Author

I did check, and everything is okay (tested on WinXP pro). Thanx

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

No branches or pull requests

1 participant