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

Allow path prefix for non forge module repositories #36

Closed
wants to merge 2 commits into from

Conversation

brianhks
Copy link
Contributor

I've created a plugin for nexus to mimic a forge module repository. The problem is that the url paths (/v3/releases/...) are not off the root.

For example my base url is http://nexus_host:8081/nexus/service/siesta/puppetforge/puppet and I need the library to query http://nexus_host:8081/nexus/service/siesta/puppetforge/puppet/v3/releases/...

This change allows the user to specify a longer url that will prefix initial requests to the server.

else
uri_path = "/v3/#{resource}/#{item}"
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks to me like just dropping the leading slash here will allow things to work without any other changes. path_prefix seems to get automatically set to / if the url_prefix doesn't include a path component.

@brianhks
Copy link
Contributor Author

scotje, had a good comment and I tested it out so the last commit changes the code to be much simpler.

@scotje
Copy link
Contributor

scotje commented Jul 22, 2016

Nice! If you have a moment, it would be neat to have a simple unit test for path prefix support. Probably in spec/unit/forge/v3/base_spec.rb. If you don't have time, I should be able to write one and get this merged next week. Thanks!

@brianhks
Copy link
Contributor Author

I'm a ruby noob. I couldn't figure out how to run the tests from rake so I avoided it.

@austb
Copy link
Contributor

austb commented Jul 22, 2016

bundle exec rspec should do the trick if all the gems are installed correctly.

@austb
Copy link
Contributor

austb commented Aug 11, 2016

@brianhks I'm going to close this and move to this PR. It's your code changes plus tests.

@austb austb closed this Aug 11, 2016
@austb austb mentioned this pull request Aug 11, 2016
@brianhks
Copy link
Contributor Author

Thanks, I would not have figured out how to create that test.

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

Successfully merging this pull request may close these issues.

4 participants