I am using ruby with watir to make some small scripts. I want to obtain
the name of the computer where my script is running from. Is there a
way to obtain the computer name using ruby?
On Tue, Apr 15, 2008 at 2:48 PM, Mike Johnson <freezingsmile@gmail.com> wrote:
Hi, all
I am using ruby with watir to make some small scripts. I want to obtain
the name of the computer where my script is running from. Is there a
way to obtain the computer name using ruby?
I am using ruby with watir to make some small scripts. I want to obtain
the name of the computer where my script is running from. Is there a
way to obtain the computer name using ruby?
Thanks
Well, there's ENV['USERDOMAIN'], and ENV['LOGONSERVER'], taken from the
environment variables.
Those might not be useful in an LDAP / Active directory environment,
though. But then an LDAP gem should have an API to get the computer's name.
~ Thank you. before I begin, I'd like everyone to notice that my report
is in a professional, clear plastic binder...When a report looks this
good, you know it'll get an A. That's a tip kids. Write it down. -- Calvin
I am using ruby with watir to make some small scripts. I want to obtain
the name of the computer where my script is running from. Is there a
way to obtain the computer name using ruby?
Thanks
name = `hostname`
More or less.
Don't recall if this works in Windows, but there should be something similar that returns machine info
···
--
James Britt
"Judge a man by his questions, rather than his answers."
- Voltaire