Skip to content
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

Move file reading responsibility to the CLI #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevenocchipinti
Copy link

This means Scanner is a simple wrapper for LockfileParser and accepts
the same arguments (content in the form of a string, not a directory path).

This also means that Scanner is able to be called with content from
anywhere (for example, github's content API) instead of a hardcoded file
path and makes it more useful as a library other projects can depend on.

This means Scanner is a simple wrapper for LockfileParser and accepts
the same arguments (content in the form of a string, not a directory path).

This also means that Scanner is able to be called with content from
anywhere (for example, github's content API) instead of a hardcoded file
path and makes it more useful as a library other projects can depend on.
@postmodern
Copy link
Member

Sounds reasonable. Perhaps we should add Scanner.parse and Scanner.open?

@stevenocchipinti
Copy link
Author

Could do that. So just to clarify, would you imagine moving the file reading logic back in to Scanner and allow either of these invocations:

scanner = Scanner.open('Gemfile.lock')

and

scanner = Scanner.parse(File.read(File.join(root, 'Gemfile.lock')))

How would you expect #initialize to behave?

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.

2 participants