Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Webpage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LEAPS WG3
Webpage
Commits
e05f5c15
Commit
e05f5c15
authored
3 months ago
by
Paul Millar
Browse files
Options
Downloads
Patches
Plain Diff
Remove arrow anti-pattern
parent
08b36634
No related branches found
No related tags found
No related merge requests found
Pipeline
#474573
passed with warnings
3 months ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/update_oai-pmh.rb
+18
-17
18 additions, 17 deletions
scripts/update_oai-pmh.rb
with
18 additions
and
17 deletions
scripts/update_oai-pmh.rb
+
18
−
17
View file @
e05f5c15
...
...
@@ -9,26 +9,27 @@ def check_oai_pmh_endpoint(endpoint_url)
queryIdentify_url
=
endpoint_url
+
"?verb=Identify"
begin
response
=
HTTParty
.
head
(
queryIdentify_url
)
if
response
.
success?
response
=
HTTParty
.
get
(
queryIdentify_url
)
if
!
(
response
.
body
.
nil?
||
response
.
body
.
empty?
)
xml_response
=
Nokogiri
::
XML
(
response
.
body
)
oai_pmh_tag
=
xml_response
.
at_xpath
(
'//*[name()="OAI-PMH"]'
)
if
oai_pmh_tag
puts
" Endpoint is active."
return
"Active"
else
puts
" Error: Identify response has no OAI-PMH tag."
return
"Error"
end
else
puts
" Error: Identify response is empty."
return
"Error"
end
else
if
!
response
.
success?
puts
" Error: Identify response has HTTP status code
#{
response
.
code
}
."
return
"Error"
end
response
=
HTTParty
.
get
(
queryIdentify_url
)
if
response
.
body
.
nil?
||
response
.
body
.
empty?
puts
" Error: Identify response is empty."
return
"Error"
end
xml_response
=
Nokogiri
::
XML
(
response
.
body
)
oai_pmh_tag
=
xml_response
.
at_xpath
(
'//*[name()="OAI-PMH"]'
)
if
!
oai_pmh_tag
puts
" Error: Identify response has no OAI-PMH tag."
return
"Error"
end
puts
" Endpoint is active."
return
"Active"
rescue
StandardError
=>
e
puts
" Error: Identify request failed:
#{
e
.
message
}
"
return
"Error"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment