-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Archive
and GitArchive
output formats
#173
base: 0.2.0
Are you sure you want to change the base?
Add Archive
and GitArchive
output formats
#173
Conversation
c086226
to
5d844e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sub-classing Ronin::Web::Spider::Archive
classes might come back to bite us, if we ever change their APIs or if we add a <<
method to them. Using composition and initializing ivars might be a better option.
# | ||
# Represents a web archive directory. | ||
# | ||
class Archive < Ronin::Web::Spider::Archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sub-classing Ronin::Web::Spider::Archive
might cause problems for us in the future if we ever change it's API. Might be safer to initialize it as an ivar in initialize
.
# The path to the root directory. | ||
# | ||
def initialize(root) | ||
super(root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be safer to initialize Ronin::Web::Spider::GitArchive
as an ivar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid confusion, we should name these new output formats web_archive
and git_web_archive
(or web_git_archive
). This should indicate to the user that only the URLs will be saved into the archive.
5d844e0
to
8d62799
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to rename the classes to match the output-format names.
register :png, '.png', PNG | ||
register :pdf, '.pdf', PDF | ||
register :web_archive, '', Archive | ||
register :web_git_archive, '', GitArchive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename classes to WebArchive
and GitArchive
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file-exts can be omitted now that they are optional.
# | ||
# Represents a web archive directory. | ||
# | ||
class Archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename class to WebArchive
.
# | ||
# Represents a web archive directory that is backed by Git. | ||
# | ||
class GitArchive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename class to WebGitArchive
.
#146