Skip to content
GitLab
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
22553978
Commit
22553978
authored
Apr 04, 2011
by
Michael Witrant
Browse files
extrait toutes les infos
parent
c557a385
Changes
1
Hide whitespace changes
Inline
Side-by-side
convert
View file @
22553978
...
...
@@ -26,10 +26,42 @@ amendements = sections.map do |xml|
num
,
note
=
doc
.
css
(
'NumAm'
).
text
.
split
(
' '
,
2
)
note
.
gsub!
(
/\s/
,
''
)
if
note
color
=
case
note
.
to_s
.
gsub
(
/[^-+]/
,
''
)
when
"--"
"green"
when
"-"
"lightgreen"
when
"++"
"red"
when
"+"
"lightred"
when
""
"lightgrey"
else
raise
"Invalid note:
#{
note
.
inspect
}
"
end
infos
=
xml
.
scan
(
%r(Text proposed by the Commission
\n
Amendment
\n
(.+)
\n
Or.)m
).
first
raise
"No info found"
unless
infos
infos
=
infos
.
first
.
split
(
/\n/
)
commission_rows
=
[]
amendement_rows
=
[]
infos
.
each_slice
(
2
)
do
|
commission
,
amendement
|
commission_rows
<<
commission
amendement_rows
<<
amendement
end
{
:num
=>
num
,
:note
=>
note
,
:color
=>
color
,
:members
=>
doc
.
css
(
'Members'
).
text
,
:article
=>
doc
.
css
(
'Article'
).
text
,
:commission_rows
=>
commission_rows
,
:amendement_rows
=>
amendement_rows
,
}
end
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment