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

Split up json #70

Closed
wants to merge 19 commits into from
Closed

Split up json #70

wants to merge 19 commits into from

Conversation

niquerio
Copy link
Collaborator

No description provided.

include Traject::Macros::Marc21Semantics
def initialize(raw)
@raw = raw
@record = MARC::JSONLReader.new(StringIO.new(@raw)).first
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be MARC::Record.new_from_hash(JSON.parse(@raw))

S.logger.info "Writing filtered records from #{full_zephir_file} to the #{scratch_dir} directory"
Zinzout.zin(full_zephir_file) do |infile|
# count = 0
infile.each.each_slice(batch_size) do |lines|
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can just use each_slice


@line_count = 0
@file_count = 0
_update_current_file_path
Copy link
Collaborator

Choose a reason for hiding this comment

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

Turn these into functions that take what they need and return a string, so you end up with
@current_file_path = _update_current_file_path(blah blah gblah)

@niquerio niquerio closed this Mar 27, 2024
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