Skip to content

Refactor Blanket::Wrapper#uri_from_parts to allow full paths#16

Merged
inf0rmer merged 3 commits intoinf0rmer:masterfrom
nicooga:feature/more_flexible_pathing
Feb 2, 2015
Merged

Refactor Blanket::Wrapper#uri_from_parts to allow full paths#16
inf0rmer merged 3 commits intoinf0rmer:masterfrom
nicooga:feature/more_flexible_pathing

Conversation

@nicooga
Copy link
Contributor

@nicooga nicooga commented Jan 27, 2015

This tiny refactor allows you to send full paths to the wrapper:

api = Blanket.wrap('https://api.github.com/')
=> #<Blanket::Wrapper:0x007fb04eeffd20
 @base_uri="https://api.github.com/",
 @extension=nil,
 @headers={},
 @params={},
 @uri_parts=[]>

api.get('users/inf0rmer/repos')
=> Response!

# or even/maybe, if you dont want to perform the request yet
api.send('users/inf0rmer/repos')
=> #<Blanket::Wrapper:0x007fb04a4fd3a8
 @base_uri="https://api.github.com/users/inf0rmer/repos",
 @extension=nil,
 @headers={},
 @params={},
 @uri_parts=[]>

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.15% when pulling f04f008 on nicooga:feature/more_flexible_pathing into 78ecc7b on inf0rmer:master.

@inf0rmer
Copy link
Owner

Hi, thanks for contributing!

The code looks great, however would you mind complementing your PR with the following:

  • A test case for the new functionality (so that we're sure future developments don't break the behaviour)
  • Adding a small explanation of how the feature works to the README file

@inf0rmer inf0rmer mentioned this pull request Jan 30, 2015
@nicooga nicooga force-pushed the feature/more_flexible_pathing branch from 6c1ae2a to 1b32d2f Compare January 30, 2015 20:02
@nicooga
Copy link
Contributor Author

nicooga commented Jan 30, 2015

There, docs and readme ready. And I also pushed the minor version number up to 2.0.1.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 99.16% when pulling 6c1ae2a on nicooga:feature/more_flexible_pathing into 78ecc7b on inf0rmer:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 99.16% when pulling f79e4e3 on nicooga:feature/more_flexible_pathing into 72226f0 on inf0rmer:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 99.16% when pulling f79e4e3 on nicooga:feature/more_flexible_pathing into 72226f0 on inf0rmer:master.

@nicooga nicooga changed the title Refactor Blanket::Wrapper#uri_from_parts to be more flexible Refactor Blanket::Wrapper#uri_from_parts to allow full paths Feb 2, 2015
@inf0rmer
Copy link
Owner

inf0rmer commented Feb 2, 2015

Thanks!

inf0rmer added a commit that referenced this pull request Feb 2, 2015
Refactors `Blanket::Wrapper#uri_from_parts` to allow full paths
@inf0rmer inf0rmer merged commit 8c52f19 into inf0rmer:master Feb 2, 2015
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.

3 participants