Skip to content

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

@jhunschejones jhunschejones merged commit 7a545ac into master Aug 1, 2025
9 checks passed
@jhunschejones jhunschejones deleted the 12/move-access-token-generation-into-client branch August 8, 2025 18:07
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

2 participants