-
Notifications
You must be signed in to change notification settings - Fork 103
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
Allow for Nexpose::Connection.new to consume URI objects #38
Conversation
@host = ip | ||
@port = port | ||
@username = user | ||
@password = pass | ||
@silo_id = silo_id | ||
@session_id = nil | ||
@url = "https://#{@host}:#{@port}/api/API_VERSION/xml" | ||
@url = File.join("https://#{@host}:#{@port}", '/api/API_VERSION/xml') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File.join ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a habit you pick up from using Chef too much. 😄 I've seen it in other libraries like Octokit.rb too. It can also be used to join uri components (URI.join does the same and adds validation on some components). I'll revert this line, since it doesn't change anything until the suggestion in my comment is addressed. I think I'll remove the comment, address your suggestions, and create a new issue.
Do you have some example usages? My inclination would be to have a function that generates the Connection. Something like
|
Yeah, that sounds good. I mostly wanted a way to parse it out. Having a |
nx_uri = URI.parse('https://nexpose.local:3780')
Nexpose::Connection.new('nexpose', 3780, 'nxadmin', 'password', nil)
Nexpose::Connection.from_uri(nx_uri, 'nxadmin', 'password', nil)
Nexpose::Connection.from_uri('https://nexpose.local:3780', 'nxadmin', 'password', nil) |
That should be it for this PR. As for the rest, I guess it won't apply until we update the actual Nexpose API. On an unrelated note check out this file I've been using to add extensions to this gem: Nexpose::Console. |
Allow for Nexpose::Connection.new to consume URI objects
No description provided.