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

Already on GitHub? Sign in to your account

Verify command existence before executing load sections dependent on those commands. #19

Merged
merged 7 commits into from Apr 19, 2012

Conversation

Projects
None yet
2 participants
Contributor

sephonicus commented Apr 17, 2012

No description provided.

@jqr jqr and 1 other commented on an outdated diff Apr 17, 2012

bin/instrument_server
@@ -35,6 +35,14 @@ class SystemInspector
end
end
+ def self.command_missing(command, section)
+ puts "Command #{command} not found. Metrics for #{section} will not be collected."
+ end
+
+ def self.command_present?(command, section)
+ `command -v #{command}`.length > 0 || command_missing(command, section)
+ end
+
@jqr

jqr Apr 17, 2012

Contributor

Using Kernel#system should be easier/safer/better http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-system

@sephonicus

sephonicus Apr 18, 2012

Contributor

Sounds good. And... done.

Contributor

jqr commented Apr 18, 2012

👍

@sephonicus sephonicus merged commit bc873db into master Apr 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment