-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
dir = | ||
case repo | ||
when 3 | ||
FileUtils.mkdir_p("mudd/publicpolicy") unless Dir.exists?("mudd/publicpolicy") |
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.
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)
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.
It does! Much cleaner. Thanks @sandbergja !
Co-authored-by: Regine Heberlein <[email protected]> Co-authored-by: Jane Sandberg <[email protected]>
Co-authored-by: Jane Sandberg <[email protected]> Co-authored-by: Christina Chortaria <[email protected]>
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.
@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 |
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.
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 |
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.
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 |
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.
Can we remove the comment?
end | ||
|
||
def write_eads_to_file(dir, repo, id) | ||
record = @client.get("/repositories/#{repo}/resource_descriptions/#{id}.xml") |
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.
Can we add a general comment why the namespace is removed and then added back?
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.
Thank you!
No description provided.