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
528ad570
Commit
528ad570
authored
Sep 24, 2011
by
Michael Witrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish to wiki
parent
967369f5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
3 deletions
+75
-3
consultation_ipred/.gitignore
consultation_ipred/.gitignore
+1
-0
consultation_ipred/Gemfile
consultation_ipred/Gemfile
+1
-1
consultation_ipred/Gemfile.lock
consultation_ipred/Gemfile.lock
+15
-2
consultation_ipred/publish.rb
consultation_ipred/publish.rb
+45
-0
consultation_ipred/wiki_page.erb
consultation_ipred/wiki_page.erb
+13
-0
No files found.
consultation_ipred/.gitignore
0 → 100644
View file @
528ad570
wiki.yaml
consultation_ipred/Gemfile
View file @
528ad570
source
"http://rubygems.org"
gem
'nokogiri'
gem
'selenium-webdriver'
gem
'mediawiki-gateway'
,
:git
=>
"git://github.com/piglop/mediawiki-gateway.git"
consultation_ipred/Gemfile.lock
View file @
528ad570
GIT
remote: git://github.com/piglop/mediawiki-gateway.git
revision: 745f3c9395fd68805f18d7a93d5857a0dd43e98b
specs:
mediawiki-gateway (0.4.3)
activesupport
rest-client (>= 1.3.0)
GEM
remote: http://rubygems.org/
specs:
activesupport (3.1.0)
multi_json (~> 1.0)
childprocess (0.2.2)
ffi (~> 1.0.6)
ffi (1.0.9)
json_pure (1.6.1)
nokogiri (1.5.0)
mime-types (1.16)
multi_json (1.0.3)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.4)
selenium-webdriver (2.7.0)
childprocess (>= 0.2.1)
...
...
@@ -17,5 +30,5 @@ PLATFORMS
ruby
DEPENDENCIES
nokogiri
mediawiki-gateway!
selenium-webdriver
consultation_ipred/publish.rb
0 → 100644
View file @
528ad570
require
"rubygems"
require
"bundler/setup"
require
'media_wiki'
require
'yaml'
require
'erb'
require
'answer'
require
'cgi'
env
=
ARGV
.
first
||
"development"
wiki
=
YAML
.
load
(
File
.
read
(
"wiki.yaml"
))[
env
]
types
=
YAML
.
load
(
File
.
read
(
"answers.yaml"
))
mw
=
MediaWiki
::
Gateway
.
new
(
wiki
[
"url"
])
mw
.
login
(
wiki
[
"username"
],
wiki
[
"password"
])
erb
=
ERB
.
new
File
.
read
(
"wiki_page.erb"
),
nil
,
"<>"
text
=
""
text
<<
"==Analyse des réponses à la consultation IPRED==
à vous…
"
types
.
each
do
|
type
,
answers
|
case
type
when
"organisations"
title
=
"Organisations"
when
"public_authorities"
title
=
"Public authorities"
else
raise
"unknown:
#{
type
.
inspect
}
"
end
text
<<
"===
#{
title
}
===
\n
"
answers
.
sort
.
each
do
|
name
,
answer
|
name_with_languages
=
answer
.
name
name_with_languages
+=
" ("
+
answer
.
languages
.
join
(
", "
)
+
")"
unless
answer
.
languages
.
empty?
text
<<
erb
.
result
(
binding
)
end
text
<<
"
\n
"
text
<<
"[[Category:IPRED fr]]
\n
"
end
mw
.
edit
(
'Analyse reponses consultation IPRED'
,
text
,
:summary
=>
'Update from script'
,
:section
=>
6
)
consultation_ipred/wiki_page.erb
0 → 100644
View file @
528ad570
====
<%=
name_with_languages
%>
====
<%
(
answer
.
files
+
answer
.
annexes
).
each
do
|
file
|
%>
* [
<%=
file
%>
<%=
CGI
.
unescape
(
File
.
basename
(
URI
.
parse
(
file
).
path
))
%>
]
<%
end
%>
=====coopération=====
=====measures=====
=====filtering=====
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