opensearch-project / opensearch-ruby-aws-sigv4

Sigv4 Wrapper for Ruby OpenSearch Client
https://super-disco-wl98v3r.pages.github.io/
Apache License 2.0
4 stars 11 forks source link

USER_GUIDE: fix require hyphen to underscore #23

Closed dla-c-box closed 1 year ago

dla-c-box commented 1 year ago

Description

There is a typo in the USER_GUIDE, require 'opensearch-aws-sigv4' gives the error LoadError: cannot load such file -- opensearch-aws-sigv4, because the file name has underscores, not hyphens.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

nhtruong commented 1 year ago

@dla-c-box but the gem name is opensearch-aws-sigv4 The end user will use the game, not the source code.

dla-c-box commented 1 year ago

Weird, I'm using bundler to install the gem from a cloned repo: gem "opensearch-aws-sigv4", git: "https://github.com/<clone in sync with here>/opensearch-ruby-aws-sigv4/", branch: "main"

And the require version with hyphens does not work even when executed through bundle exec, but this works with no problem: require 'opensearch_aws_sigv4'

nhtruong commented 1 year ago

You're right. But current users are using require 'opensearch-aws-sigv4. I got it working before. Lemme take look on what changed and look for a workaround.

nhtruong commented 1 year ago

@dla-c-box So the file name used to be opensearch-aws-sigv4.rb when I migrated this game to this repo. Then I implemented Rubocop, which complained about the filename using hyphens instead of underscore.

Would you mind renaming the file back to opensearch-aws-sigv4.rb and disable that Rubocop rule? Thanks.

dblock commented 1 year ago

Small note on Rubocop in general. I think we could just advise folks to run rubocop -a ; rubocop --auto-gen-config and not worry about it. 90% of the value is from auto-formatting.

dla-c-box commented 1 year ago

I deactivated the cop and renamed the file.

dblock commented 1 year ago

Before I merge, we could have both files, is that better? This way you can require file/gem the same.

Check out https://github.com/dblock/ruby-enum/tree/master/lib for an example.

dla-c-box commented 1 year ago

Done