Skip to content

Conversation

jasonkarns
Copy link
Contributor

This refactor centralizes the logic around reading/writing the authentication token file.

It is primarily intended to clean up the code in preparation for XDG standard directory support

lib/gist.rb Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't work on ruby 1.8, or on the standalone script version used by Homebrew. (see rake standalone)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: 8fc7c7a (lib already added to load path. created lib/gist so requires look like gist/auth_token_file)

@jasonkarns
Copy link
Contributor Author

Any other comments or suggestions on this refactor? Any concern around the AuthTokenFile being a module vs class?

@ConradIrwin
Copy link
Collaborator

I would just leave it as methods on the Gist module. Otherwise we'll have to update the rake standalone task.

I'm not very good at object-orientation, but a module seems fine to me if you don't like that idea.

@jasonkarns
Copy link
Contributor Author

@ConradIrwin I still think the extraction is worthwhile, but it needn't be in a separate file. Can move the module back to gist.rb

@jasonkarns
Copy link
Contributor Author

I think this is ready to merge now, and will make the XDG support almost trivial.

ConradIrwin added a commit that referenced this pull request Nov 3, 2014
extract AuthTokenFile domain object
@ConradIrwin ConradIrwin merged commit 3bb1b09 into defunkt:master Nov 3, 2014
@ConradIrwin
Copy link
Collaborator

Looks good to me, thanks for being flexible and patient.

The main remaining problem with the XDG stuff is working out how people interpret the spec with regard to auth tokens.

@jasonkarns jasonkarns deleted the auth_token_filename branch November 4, 2014 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants