Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amendments
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LQDN Adminsys
amendments
Commits
f86ecc27
Commit
f86ecc27
authored
Mar 31, 2013
by
Michael Witrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find amendments
parent
8f1665e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
extract_amendments.rb
extract_amendments.rb
+17
-0
No files found.
extract_amendments.rb
View file @
f86ecc27
...
...
@@ -28,4 +28,21 @@ end
text
=
doc
.
xpath
(
'//office:text'
).
first
raise
"no office:text found"
unless
text
amend_start
=
nil
amend_nodes
=
[]
text
.
children
.
each_with_index
do
|
node
,
i
|
if
node
.
search
(
"[text()='<Amend>']"
).
size
>
0
amend_start
=
i
elsif
node
.
search
(
"[text()='</Amend>']"
).
size
>
0
if
amend_start
.
nil?
raise
"amend end before amend start"
end
amend_end
=
i
amend_nodes
<<
text
.
children
.
slice
(
amend_start
..
amend_end
)
amend_start
=
nil
end
end
p
amend_nodes
.
length
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment