calendar-assistant icon indicating copy to clipboard operation
calendar-assistant copied to clipboard

refactor the user interactions in "setup" and "authorize"

Open flavorjones opened this issue 6 years ago • 1 comments

Currently "setup" interaction code is embedded in cli.rb

And "authorize" interaction code is embedded in authorizer.rb

They're both probably wrong:

  • Authorizer doesn't have access to CLI Helpers like Out#puts and #prompt
  • CLI shouldn't have such complex code in it. Ideally it has one branch and calls out to methods for everything

I think this probably means introducing a new class of some kind to do this work. Or maybe just jam more methods into CLIHelpers.

flavorjones avatar Oct 31 '18 22:10 flavorjones

Would be you happy with an approach where a lot of the code in commands.rb end up in individual classes that get called? (ex. commands/setup.rb)

osis avatar May 06 '20 23:05 osis