Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
amendments
Commits
0d4cd3ca
Commit
0d4cd3ca
authored
Mar 31, 2013
by
Michael Witrant
Browse files
parse amendment table
parent
9a85fa40
Changes
1
Hide whitespace changes
Inline
Side-by-side
extract_amendments.rb
View file @
0d4cd3ca
...
...
@@ -75,7 +75,19 @@ amend_nodes.each do |nodes|
raise
"too many tables"
if
tables
.
size
>
1
table
=
tables
.
first
original_column
=
nil
amendment_column
=
nil
text_table
=
table
.
css
(
"table|table-row"
).
map
{
|
row
|
row
.
css
(
"table|table-cell"
).
map
(
&
:text
)
}
debug
text_table:
text_table
header_index
=
text_table
.
index
([
"Text proposed by the Commission"
,
"Amendment"
])
raise
"first row not found in table of amendment
#{
num_am
}
"
unless
header_index
changes
=
text_table
[(
header_index
+
1
)
..-
1
]
raise
"amendment changes not found"
if
changes
.
size
==
0
debug
changes:
changes
amendment
[
:changes
]
=
changes
amendments
<<
amendment
...
...
Write
Preview
Supports
Markdown
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