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

cover_me: calls wrong command open (probably mean xdg-open?) #45

Open
edwintorok opened this issue May 4, 2011 · 1 comment
Open

cover_me: calls wrong command open (probably mean xdg-open?) #45

edwintorok opened this issue May 4, 2011 · 1 comment

Comments

@edwintorok
Copy link

Ever since cover_me got added to Gemfile on every rake command I invoke I see this:
Couldn't get a file descriptor referring to the console

And if logged on the console I get access denied to /dev/tty7

strace shows cover_me tries to do this:
[pid 4722] execve("/bin/open", ["open", "...site/coverage/index.html"], [/* 18 vars */]) = 0

cover_me has this code:
c.set_default(:at_exit, Proc.new {
if CoverMe.config.formatter == CoverMe::HtmlFormatter
index = File.join(CoverMe.config.html_formatter.output_path, 'index.html')
if File.exists?(index)
open #{index}

I don't know under what OS "open index.html" opens the file in your browser, but on Linux open does something completely different:
lrwxrwxrwx 1 root root 6 Feb 1 21:12 /bin/open -> openvt

DESCRIPTION
openvt will find the first available VT, and run on it the given command with the given command options, standard input, output and error are
directed to that terminal. The current search path ($PATH) is used to find the requested command. If no command is specified then the environment
variable $SHELL is used.

What you are looking for probably is xdg-open:

DESCRIPTION
xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser.
If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https
URLs.

If xdg-open is installed that is...

@dicom
Copy link

dicom commented May 4, 2011

This crashes on windows as well, where the equivalent command to 'open' is 'start'.

Seems to me there needs to be a platform detection in the code in order to select the appropriate command to launch this document.

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

2 participants