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

working towards sending EADs to SVN #511

Merged
merged 9 commits into from
Jun 27, 2023
Merged

working towards sending EADs to SVN #511

merged 9 commits into from
Jun 27, 2023

Conversation

regineheberlein
Copy link
Contributor

No description provided.

dir =
case repo
when 3
FileUtils.mkdir_p("mudd/publicpolicy") unless Dir.exists?("mudd/publicpolicy")
Copy link
Member

Choose a reason for hiding this comment

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

One possible simplification: would it behave the same if you remove all FileUtils and Dir lines from the case statement, and then just add the following after the end of the case statement?

FileUtils.mkdir_p(dir) unless Dir.exists?(dir)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does! Much cleaner. Thanks @sandbergja !

@sandbergja sandbergja marked this pull request as ready for review June 26, 2023 22:18
Copy link
Member

@christinach christinach left a comment

Choose a reason for hiding this comment

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

@regineheberlein @sandbergja thank you! I have a request regarding some comments in the code.

def write_eads_to_file(dir, repo, id)
record = @client.get("/repositories/#{repo}/resource_descriptions/#{id}.xml")
ead = Nokogiri::XML(record.body)
# i shouldn't have to do this but I do
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the comment?

# i shouldn't have to do this but I do
ead.remove_namespaces!
eadid = ead.at_xpath('//eadid/text()')
# save file with eadid as file name
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the comment?

eadid = ead.at_xpath('//eadid/text()')
# save file with eadid as file name
file = File.open("#{dir}/#{eadid}.EAD.xml", "w")
# add back a default namespace
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove the comment?

end

def write_eads_to_file(dir, repo, id)
record = @client.get("/repositories/#{repo}/resource_descriptions/#{id}.xml")
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a general comment why the namespace is removed and then added back?

Copy link
Member

@christinach christinach left a comment

Choose a reason for hiding this comment

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

Thank you!

@christinach christinach merged commit 9290b4d into main Jun 27, 2023
3 checks passed
@christinach christinach deleted the ead2svn branch June 27, 2023 18:54
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.

3 participants