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
c8b0bc57
Commit
c8b0bc57
authored
Sep 26, 2011
by
Michael Witrant
Browse files
script de finition de conversion net neutrality
parent
528ad570
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
net_neutrality/base.mediawiki
0 → 100644
View file @
c8b0bc57
This diff is collapsed.
Click to expand it.
net_neutrality/result.mediawiki
0 → 100644
View file @
c8b0bc57
This diff is collapsed.
Click to expand it.
net_neutrality/update.rb
0 → 100644
View file @
c8b0bc57
require
'rubygems'
require
'active_support/all'
include
ActiveSupport
::
Inflector
data
=
File
.
read
(
'base.mediawiki'
)
data
.
gsub!
%r((Amendement
\d
+
\n
<br/>
\n
.+
\n
<br/>
\n
)(.+)(
\n
<br/>[-+]*
\n
))
do
|
match
|
prefix
,
names
,
suffix
=
$1
,
$2
,
$3
new_names
=
names
.
split
(
", "
).
map
do
|
name
|
page
=
transliterate
(
name
.
split
(
/\s+|-/
).
map
(
&
:capitalize
).
reject
{
|
part
|
part
==
"A."
}.
join
)
"[[
#{
page
}
|
#{
name
}
]]"
end
.
join
(
", "
)
prefix
+
new_names
+
suffix
end
data
.
gsub!
%r(
\|
-
\n\|
width="50%"
\|\n
('''Or. '''<Original>'''
\{
..
\}
..'''|'''.'''|)</Original>
\n\|
width="50%"
\|\n
(<Original>)?</Original>
\n
)
,
''
File
.
open
(
"result.mediawiki"
,
"w"
)
do
|
f
|
f
.
write
data
end
data
.
scan
(
/=== Amendment .+?\n\|\}/m
).
each
do
|
amendment
|
end
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