Skip to content

Move interactive prompt to generate access token into client #17

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jhunschejones
Copy link
Owner

@jhunschejones jhunschejones commented May 5, 2023

Description:

This resolves #12 by moving the interactive prompt to generate an access token inside of the client module. This will allow users to require the gem into a Rails console or IRB session and run Pcloud::Client.generate_access_token to generate the prompts, instead of having to download a separate script.

Testing:

This script currently does not have any unit tests in the repo, so moving it into the gem code itself felt like the right time to add them. I used WebMock when converting the code from Net::HTTP to HTTParty to make sure my web request was the same before and after the change. I decided not to leave it in the final test as that dependency feels heavy for just one use.

@jhunschejones
Copy link
Owner Author

jhunschejones commented May 5, 2023

I tested this in a local project, configuring an access token and then using it to access my pCloud account 👍🏻

I think since I don't expect to iterate on this logic, a simple run through here is a good enough test to confirm it works for now. I can look at adding unit tests later if a regression or bug proves we need them.

@jhunschejones jhunschejones force-pushed the 12/move-access-token-generation-into-client branch from f5341f5 to beb9d52 Compare October 8, 2024 06:17
@jhunschejones
Copy link
Owner Author

Rebasing this on the latest version of master + adding a unit test for the new code

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.

🔨 Move initializer script to a helper method on Pcloud::Client
1 participant