Skip to content

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