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

Use Addressable::URI, allowing IPv6 URLs #339

Closed

Conversation

mgrobelin
Copy link
Contributor

"Addressable is a replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4), additionally providing support for IRIs and URI templates.", see https://github.com/sporkmonger/addressable

Fixes #110

Signed-off-by: Markus Grobelin [email protected]

"Addressable is a replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4), additionally providing support for IRIs and URI templates.", see https://github.com/sporkmonger/addressable

Fixes inspec#110

Signed-off-by: Markus Grobelin <[email protected]>
@mgrobelin
Copy link
Contributor Author

mgrobelin commented Aug 23, 2018

I didn't add gem 'addressable' to the Gemfile, as it seems to be already dependent. Or shall I?

@jquick
Copy link
Contributor

jquick commented Aug 23, 2018

Thanks for this @mgrobelin ! I would go ahead and add the gem as a dependency for both the gemfile and gemspec incase something else is removed that is depending on it.

Copy link
Contributor

@jquick jquick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

lib/train.rb Outdated
string += '//dummy'
else
raise Train::UserError, e
if u.scheme and (u.host.nil? or u.host.empty?) and u.path.empty?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our standard is to use the || and &&, instead of and/or due to the precedence differences.

@mgrobelin mgrobelin force-pushed the addressable_gem_instead_of_stdlib_uri branch from 94659ad to 5810940 Compare August 24, 2018 09:42
@clintoncwolfe clintoncwolfe changed the title Replace usage of Ruby's stdlib URI by Addressable::URI Use Addressable::URI, allowing IPv6 URLs Mar 15, 2019
Copy link
Contributor

@clintoncwolfe clintoncwolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! A few simple changes...

  • Please remove addressable from the Gemfile
  • You have a couple of linting failures. Run 'bundle exec rubocop' to see them - any linting failures will fail the tests, which fails CI, which means we can't accept it yet.

Thanks so much!

Gemfile Outdated
@@ -12,6 +12,8 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
gem 'json', '< 2.0'
end

gem 'addressable', '~> 2.5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a development need - it should only be in the gemspec. Gemfile pulls in all gemspec requirements, so this is redundant.

@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.0'

spec.add_dependency 'addressable', '~> 2.5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pin here on 2.5 is going to conflict with Chef which is pinned to 2.4 due to another gem. Does this need to be 2.5 or would 2.4 work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, addressable 2.4 is from end of 2015. Maybe I was required to bump the gem while working on a project for Ruby 2.5 support, but maybe I remember wrong.

For sure a lot of fixes happened since 2.4. I don't know whether the change to addressable gem is even smart when not used with 2.5

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're currently waiting on Travis to release this gem so we can pull in the latest addressable to our overall stack: travis-ci/gh#33

zenspider pushed a commit that referenced this pull request Jan 31, 2020
zenspider pushed a commit that referenced this pull request Jan 31, 2020
@zenspider zenspider mentioned this pull request Jan 31, 2020
@zenspider
Copy link
Contributor

Closing in favor of #566, which I'll try to merge soon.

@zenspider zenspider closed this Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test remote host via ipv6 address
5 participants