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

Add CDN repo Source to allow retrieving specs from a web URL #469

Merged
merged 1 commit into from Dec 15, 2018

Conversation

igor-makarov
Copy link
Contributor

This PR complements #8280 in the main repo.

See all the details there.

lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
@igor-makarov
Copy link
Contributor Author

I've made (hopefully) all the requested changes.

@igor-makarov
Copy link
Contributor Author

I've added a threadpool to handle all the concurrency, using ruby-concurrent.

In addition, I've moved all the optimizations that were previously in the analyzer, into the CDNSource file.

Copy link
Member

@amorde amorde left a comment

Choose a reason for hiding this comment

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

This is awesome! Would love to see tests for this before merging

lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
@igor-makarov
Copy link
Contributor Author

So I've picked all the nits, and made most of the implementation-related methods private.

I've begun adding unit tests. I'm using webrick for mocking the CDN server. I had to put its hookup in spec_helper to ensure no tests fail. I think it works better than VCR, because what I need is a read-only, static-hosted HTTP server that supports ETag out of the box.

@igor-makarov
Copy link
Contributor Author

I've added the tests for CDNSource. It's now 93% covered, according to what I can see.

@igor-makarov
Copy link
Contributor Author

I've pruned the new mock_cdn_repo_remote fixture to have significantly less files. Hope that's better.

Copy link
Member

@amorde amorde left a comment

Choose a reason for hiding this comment

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

Haven't gotten the chance to try it out yet but the diff looks good to me

lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
lib/cocoapods-core/cdn_source.rb Outdated Show resolved Hide resolved
@igor-makarov
Copy link
Contributor Author

I've made the changes requested by @segiddins.

@dnkoutso dnkoutso merged commit 87c71c4 into CocoaPods:master Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants